mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-11-10 13:01:29 +00:00
The previous commit read a glyph name that only numbers its glyph (`C70`, `MT72`, `G4E`) as its code's Latin-1 character whenever the number, in decimal or hexadecimal, was that code. In fonts whose names number something else (`/Differences [1 /C70 /C105 ...]`, a subset's order), a name can match its code by coincidence: `/MT40` at 0x40 read `@` where the page draws `(` (PDFBOX-1078), `/C39` at 0x39 read `9` (PDFBOX-1783). The rule now applies only in a Type 1 font where every numbered name in its encoding names its own code (`numbered_names_name_their_codes`, worked out once per font). `/C1` at 233 beside `/C70` at 70, the review counterexample on #3239, turns the whole font back to nothing, and #3239's test font (`c251` at 97, `C1` at 233 beside `C39` at 39) reads exactly as #3239 expected again. Codes 128-255 read as Latin-1 (`C174` = `®`), as pdftotext, PDFium, MuPDF and Acrobat read them. Vendor ledger: hayro-interpret patch 99. Test: text::tests::numbered_glyph_names_read_as_their_own_code (fails with the guard switched off, and with the fallback switched off). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Pq7HyCHD1R3rywQBPCHXZA