Commit graph

1 commit

Author SHA1 Message Date
jedarden
77304153fc feat(pdftract-5sh): CIDToGIDMap resolver for CIDFontType2
Implements CIDToGIDMap resolver with Identity and stream forms:
- Identity: zero-allocation short-circuit (GID == CID)
- Stream: parses 2-byte big-endian GID values into Box<[u16]>
- Emits CIDTOGIDMAP_TRUNCATED diagnostic on odd-byte-count input
- Out-of-range CID returns GID 0 (notdef glyph) without panic

Acceptance criteria:
- Identity form: lookup of any CID returns same value as u16
- Stream form: synthetic 3-CID array decodes correctly [0, 5, 10]
- Out-of-range CID returns GID 0 with no panic
- Diagnostic CIDTOGIDMAP_TRUNCATED emitted on odd-byte-count input

Refs: pdftract-5sh, Phase 2.1 line 1315
2026-05-23 15:23:27 -04:00