Files
photocraft/crates/text/Cargo.toml
T
4e22c92889 fix(text): #8247 colour glyph review findings (fan-out graphs, hidden glyphs, CMYK, clips, radial)
Works through the five CodeRabbit threads on d9102e7e0a:

- A COLR graph that reuses both children of every composite was walked
  exponentially often (skrifa 0.44 only limits depth and cycles on the
  current path), stalling rendering and measuring. photocraft-text moves to
  skrifa 0.47, already in the lockfile, which caps a walk at 16384 paints;
  such a glyph falls back to its plain outline like a cycle does.
- Glyphs hidden by a transparent text colour are skipped before their graph
  is walked or painted, so they can't spend the budget and drop the
  visible text.
- In CMYK (and other non-RGB) documents, pixels in the text colour alone
  keep its own components instead of a round trip through sRGB, as plain
  glyphs do (a K-only black stays K only).
- Nested clips intersect by the smaller coverage, so a glyph clipped by its
  own outline twice keeps its anti-aliased edge.
- A radial gradient's shared point of touching circles (a = b = c = 0) is
  painted with the largest t instead of dividing 0 by 0.

Each fix has a test that fails without it.

Co-Authored-By: adi-1108 <adi-1108@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 15:21:10 +01:00

44 lines
2.1 KiB
TOML

[package]
name = "photocraft-text"
description = "Font database, text shaping/layout (parley) and text-layer rasterization"
version.workspace = true
edition.workspace = true
license.workspace = true
rust-version.workspace = true
[lints]
workspace = true
[dependencies]
photocraft-geom = { workspace = true }
photocraft-color = { workspace = true }
photocraft-raster = { workspace = true }
photocraft-doc = { workspace = true }
photocraft-psd = { workspace = true }
# No `system` feature: fontique's system backend links fontconfig on Linux. We scan font
# directories ourselves (native) and always register the bundled fonts (native + web).
parley = { version = "0.11", default-features = false, features = ["std"] }
skrifa = "0.47"
flate2 = { workspace = true }
# ICU dictionary data for Japanese word boundaries and complex-script (Thai, Lao, Khmer, Burmese)
# line breaking. Native only: the CJK dictionary alone is 3.8 MB of wasm, and the web build must
# stay under Cloudflare's 25 MiB per-file cap (packaging/web/package.sh). The web build falls back
# to the generic Unicode rules for those scripts.
# Native only: the glyph rasteriser composites and converts its pixel buffers on all cores.
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
parley = { version = "0.11", default-features = false, features = ["std", "complex-scripts"] }
rayon = { workspace = true }
# macOS only: the `system` feature adds fontique's Core Text backend, which lists every font the
# system offers wherever its file lives (fonts a font manager or Adobe Fonts activated, Office's
# own, Apple's on-demand downloads). `fonts.rs` reads only its list of files and registers them
# like the folder scan's, so our own collection keeps its behaviour (generic families, merging
# installed faces into the bundled families). It uses no fontconfig, unlike `system` on Linux.
[target.'cfg(target_os = "macos")'.dependencies]
parley = { version = "0.11", default-features = false, features = ["std", "complex-scripts", "system"] }
[build-dependencies]
# Deflates the bundled fonts (build.rs); `flate2` above inflates them.
flate2 = { workspace = true }