From f39922b214dc429bcf6551ef71ed3631337b2acf Mon Sep 17 00:00:00 2001 From: skylar taylor-barrick Date: Wed, 14 Oct 2026 00:01:36 -0600 Subject: [PATCH] fix(pdf): make backend text shaping opt-in --- Cargo.toml | 2 +- crates/pdf/Cargo.toml | 1 + crates/pdf/README.md | 8 +++++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 665729b0c..14277533e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ repository = "https://github.com/storytold/craft-libs" [workspace.dependencies] # internal: add each crate here as `craft- = { path = "crates/" }` craft-pdf = { path = "crates/pdf", version = "=0.1.0" } -krilla = "=0.8.2" +krilla = { version = "=0.8.2", default-features = false, features = ["raster-images"] } thiserror = "2" craft-atomic = { path = "crates/atomic" } craft-cms = { path = "crates/cms" } diff --git a/crates/pdf/Cargo.toml b/crates/pdf/Cargo.toml index ec34c3dde..e6a3e7889 100644 --- a/crates/pdf/Cargo.toml +++ b/crates/pdf/Cargo.toml @@ -14,6 +14,7 @@ workspace = true default = [] write = ["dep:krilla", "dep:thiserror"] write-pdf = ["write", "krilla/pdf"] +write-simple-text = ["write", "krilla/simple-text"] [dependencies] krilla = { workspace = true, optional = true } diff --git a/crates/pdf/README.md b/crates/pdf/README.md index 5fd6ad4e6..cc3f51cda 100644 --- a/crates/pdf/README.md +++ b/crates/pdf/README.md @@ -5,10 +5,12 @@ layout, shaping, font selection and licensing, tagging, colour policy, print pre export presets and postprocessing. There is no GUI or application dependency. Features are explicit: `default = []`; `write` enables authoring; `write-pdf` additionally -supports embedding existing PDF pages. WordCraft, DeckCraft and VectorCraft use `write`. +supports embedding existing PDF pages. WordCraft and VectorCraft use `write`. +Applications that call Krilla's `draw_text`, such as DeckCraft, also need `write-simple-text`. DesignCraft uses `write-pdf` for placed PDF pages and book composition. Plain `write` does -not enable Hayro parsing, interpretation or its image codecs; Krilla's existing raster-image -and simple-text support remain enabled. Reading dependencies used to inspect test outputs +not enable Hayro parsing, interpretation or its image codecs. Krilla's raster-image support +remains enabled, while its optional text shaper is enabled only by `write-simple-text`. +Applications that supply shaped glyphs do not need that feature. Reading dependencies used to inspect test outputs are dev-only. A reader migration can be reviewed and adopted separately. The writer pins Krilla 0.8.2, with a local unwind-cleanup patch documented in