Skip to content

fix(pdf): preserve Identity font character widths - #1174

Merged
andiwand merged 2 commits into
mainfrom
review/156-pdf-identity-code-width
Oct 6, 2026
Merged

andiwand merged 2 commits into
mainfrom
review/156-pdf-identity-code-width

Conversation

@andiwand

@andiwand andiwand commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

🤖 Generated with Claude Code

A multilingual PDF declares Identity-H but has a conflicting ToUnicode codespace. Complete codespace matching introduced in #1123 split its two-byte glyph IDs into bytes, corrupting text and spacing. Identity-H/V now retain their mandated two-byte width for both glyph iteration and text extraction (ISO 32000-1 9.7.5.2). Simple-font zero-padding and mixed-width CMaps keep their existing behavior.

One inline regression covers both identity encodings and trailing partial codes; it fails on the parent. All 463 targeted PDF tests, including the 50-document corpus, pass. The affected document's combined view and corrupted pages match the reference again: 19 of 21 outputs match, with the remaining two differing only in pre-existing 0.01-point path rounding. Full local clang-tidy, WebAssembly tests, and all four Android ABI rebuilds pass.

@andiwand
andiwand force-pushed the review/155-annotation-state-ownership branch from a68684c to 36f101f Compare October 6, 2026 19:35
Base automatically changed from review/155-annotation-state-ownership to main October 6, 2026 19:35
@andiwand
andiwand force-pushed the review/156-pdf-identity-code-width branch from 86ea6f2 to e3a5800 Compare October 6, 2026 19:40
@andiwand
andiwand merged commit de71db4 into main Oct 6, 2026
16 of 23 checks passed
@andiwand
andiwand deleted the review/156-pdf-identity-code-width branch October 6, 2026 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant