| 1 | [package] |
| 2 | name = "slides-pdf" |
| 3 | version = "0.1.0" |
| 4 | edition = "2021" |
| 5 | |
| 6 | [lib] |
| 7 | crate-type = ["cdylib", "rlib"] |
| 8 | |
| 9 | [dependencies] |
| 10 | # krilla is the PDF writer; krilla-svg draws a usvg tree onto one of its |
| 11 | # surfaces. It is the successor to svg2pdf, which this crate used until |
| 12 | # 2026-09-09 and whose repository (typst/svg2pdf) was archived on |
| 13 | # 2026-07-10 pointing here. `raster-images` is krilla's decoder set for |
| 14 | # `<image>` hrefs (PNG, JPEG, GIF, WebP); `simple-text` (rustybuzz |
| 15 | # shaping for krilla's own text API) is off because every glyph this |
| 16 | # crate draws is already positioned by usvg, and krilla-svg calls the |
| 17 | # glyph API directly. |
| 18 | # |
| 19 | # krilla-svg has no Cargo features of its own: its usvg, resvg, |
| 20 | # tiny-skia, fontdb, skrifa, flate2 and smallvec dependencies are all |
| 21 | # unconditional and all take default features, so there is nothing to |
| 22 | # turn off from here. That includes usvg's and fontdb's filesystem |
| 23 | # features (fs, memmap, fontconfig), which are pulled in whatever this |
| 24 | # manifest says because Cargo features are additive across the graph. |
| 25 | # It builds for wasm32-unknown-unknown regardless: memmap2 and |
| 26 | # fontconfig-parser carry stubs for non-unix, non-windows targets, and |
| 27 | # nothing here ever calls `load_system_fonts` — faces come only from |
| 28 | # `Database::load_font_data`. tiny-skia's default `simd` feature also |
| 29 | # builds clean for wasm32 (it falls back to scalar code where there is |
| 30 | # no `std::arch` to use). |
| 31 | krilla = { version = "=0.8.2", default-features = false, features = ["raster-images"] } |
| 32 | krilla-svg = "=0.8.1" |
| 33 | # Named directly so this crate can build a fontdb::Database from bytes |
| 34 | # handed over the ABI and parse the SVG itself. The versions must be the |
| 35 | # ones krilla-svg resolves, or `usvg::Tree` would be two distinct types. |
| 36 | usvg = { version = "=0.47.0", default-features = false, features = ["text"] } |
| 37 | fontdb = { version = "=0.23.0", default-features = false } |
| 38 | |
| 39 | # No getrandom: unlike the CRDT core (yrs -> fastrand -> getrandom), nothing |
| 40 | # in this graph draws entropy (`cargo tree -i getrandom` names no crate), so |
| 41 | # there is no backend to override and no `__getrandom_v03_custom` hook to |
| 42 | # define. The `--cfg getrandom_backend="custom"` in the root .cargo/config |
| 43 | # is inert for this crate. |
| 44 | |
| 45 | [profile.release] |
| 46 | opt-level = "s" |
| 47 | lto = true |
| 48 | panic = "abort" |
| 49 | |
| 50 | [dev-dependencies] |
| 51 | wasmparser = "=0.258.0" |
| 52 | flate2 = "1" |
| 53 | |