mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-11-09 12:32:52 +00:00
A CMap that writes its CID mappings as `bfchar` was looked up without the code's byte length, so the first byte of a two-byte code matched a two-byte entry of the same value and drew as its own glyph: `<fe96>` drew as "þ–" (PDFBOX-1282, Characters_Arial.pdf page 3). The bfchar fallback of `lookup_cid_code` now applies only when the codespace ranges give the code the length being tried (ISO 32000-2 §9.7.6.2), byte by byte; a CMap without codespace ranges keeps the old fallback. An unmapped code still advances one byte. Vendored hayro-cmap patch 4. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Pq7HyCHD1R3rywQBPCHXZA