mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-10-30 13:08:48 -06:00
- js: `host()` returns a script error instead of panicking when the host state is missing. - optimize, a11y: the graphics-state stack is read with `last`/`last_mut` instead of `expect`. - fonts: the standard-14 ASCII map is built from `u8`, which can't fail. - filters: zlib encoding into a `Vec` keeps the standard's narrow, documented `expect` exception. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
printcraft-fonts
Layer L2. Font helpers for the appearance streams PrintCraft generates (comments, form fields).
Today it holds what generated appearances need without a font program:
helvetica_width: an approximation of Helvetica's proportions by character class. No metrics file or font program from any vendor is bundled; widths are PrintCraft's own estimates, good enough for line breaking and alignment, not for typesetting.wrap: greedy line breaking with that measure (paragraphs on newlines, long words split).win_ansi: Unicode → WinAnsiEncoding bytes (?for characters it can't represent), andliteralto write bytes as a PDF literal string.
The full font subsystem (parsing, shaping, subsetting and embedding) arrives with M2.2/M7.