pdfcraft/crates
Tanish Manku d0d1ad8192 F1: exact standard-14 metrics
pdfcraft_fonts::helvetica_width was a fifteen-line guess by character class,
and seven crates generated appearance streams through it: annot, edit, forms,
ocr, redact, sign and xfa. Times was Helvetica x 0.9, bold was x 1.05, Courier
a flat 0.6. Against the published metrics a Times capital A is 722, so that
estimate said 600 -- a 17% error on a letter, compounding across a line.

Std14 carries the real advance widths for all fourteen faces, indexed by
character code: WinAnsiEncoding for the twelve text fonts, which is what we
write into the appearance streams we generate, and their own built-in
encodings for Symbol and ZapfDingbats. The tables are generated by joining the
published encodings with the per-glyph widths.

helvetica_width now delegates, so every call site gained exact Helvetica with
no change. The three places that faked another face by scaling it -- Family
in edit::added, the paragraph measure in edit::text, and the redaction overlay
fonts -- now select the right face instead. So does Metrics::width in
fonts::pdf, which measures existing document text when a font carries no
/Widths; that path feeds redaction's glyph removal, where a wrong width means
cutting the wrong glyphs.

Tests spot-check the table against values typed in from the specification by
hand, so it is verified against the spec rather than against whatever produced
it; plus Courier being fixed pitch everywhere, full printable-ASCII and Latin-1
coverage, Symbol and ZapfDingbats not being WinAnsi, /BaseFont aliases and
subset prefixes resolving, and hostile text staying finite.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-10-12 13:57:43 -07:00
..
a11y Keep manual review visible in accessibility summaries (#1224) 2026-10-12 02:52:35 -04:00
annot M14: text the fonts can't draw is kept and reported, never written as ? silently (#1112) 2026-10-11 17:53:55 -04:00
audit fix(audit): an identity cm between re and fill no longer hides a cover (#1333) (#1410) 2026-10-12 07:54:52 -04:00
automation feat(preflight): verify image resolution and bleed without rewriting the file (#1408) 2026-10-12 08:52:06 -04:00
compare Rename PrintCraft to PdfCraft (#174) 2026-10-07 16:03:57 -04:00
content fix(content): count an unreadable inline image with no EI as skipped (#1318) (#1418) 2026-10-12 08:38:01 -04:00
cos M1: write a valid xref when an incremental save has no objects (#1339) (#1424) 2026-10-12 08:57:37 -04:00
create M14: text the fonts can't draw is kept and reported, never written as ? silently (#1112) 2026-10-11 17:53:55 -04:00
crypt Issue #1185: Protect refuses passwords that encryption would make empty or equal (#1186) 2026-10-11 18:30:00 -04:00
edit F1: exact standard-14 metrics 2026-10-12 13:57:43 -07:00
engine M14: add Lithuanian interface and date localization (#1401) 2026-10-12 08:54:15 -04:00
export M10: Presentation (.pptx) export (#1137) (#1162) 2026-10-11 21:55:25 -04:00
filters Rename PrintCraft to PdfCraft (#174) 2026-10-07 16:03:57 -04:00
fonts F1: exact standard-14 metrics 2026-10-12 13:57:43 -07:00
forms M12: preview text structure proposals for auto-tagging (#1383) 2026-10-12 08:20:13 -04:00
geom M10: Enhance camera image finds the document's edges; rotate, crop or organize after Enhance page (part 3 of #1008) (#1027) 2026-10-11 12:31:23 -04:00
js XFA: one script thread per event, and the live form kept up to date in place (#1355) 2026-10-12 05:39:49 -04:00
measure Issue #432: global Units preference (mm, cm, in, pt), defaulting to the system region (#463) 2026-10-11 15:33:54 -04:00
model M2: pages with /UserUnit are shown at their size in points, as in Acrobat (#722) 2026-10-10 06:19:31 -04:00
ocr M10: edit OCR text on scanned pages so the change shows (#1397) 2026-10-12 08:16:42 -04:00
optimize M11: strip redundant ASCII stream wrappers during optimization (#989) 2026-10-11 13:21:20 -04:00
organize M4: rename colliding form field names when combining (organize.field-name-conflicts) (#1155) 2026-10-11 21:18:21 -04:00
platform fix(theme): complete Linux System appearance tracking (#1017) 2026-10-11 15:23:49 -04:00
preflight fix(preflight): find colour operators after any PDF whitespace (#1334) (#1373) 2026-10-12 06:25:42 -04:00
print fix(print): refuse huge posters at the sheet limit instead of overflowing (#1335) (#1376) 2026-10-12 06:27:50 -04:00
redact F1: exact standard-14 metrics 2026-10-12 13:57:43 -07:00
render fix(render): draw Turkish Ğ İ Ş ğ ş in non-embedded fonts (vendored hayro-interpret patch 26) (#1409) 2026-10-12 07:57:03 -04:00
sign fix(sign): refuse to sign a field whose /V is not a signature (#1328) (#1402) 2026-10-12 07:52:34 -04:00
ui-egui M14: add Lithuanian interface and date localization (#1401) 2026-10-12 08:54:15 -04:00
xfa XFA: one script thread per event, and the live form kept up to date in place (#1355) 2026-10-12 05:39:49 -04:00
xfdf fix(xfdf): text data from a one-field form keeps its commas (#1321) (#1371) 2026-10-12 06:24:27 -04:00