Repository navigation
Conversation
A PDF writer that writes content streams before the final subset is known needs CIDs that don't depend on the subset. TrueType fonts get that with a CIDToGIDMap; a CFF font's CIDs come from its charset, which was always written in subset order. CidMapping::OriginalGlyphId writes the charset so each glyph's CID is its glyph id in the original font, as one format 2 range per run of consecutive ids. subset_with_options takes it along with the variation coordinates. The default and the existing functions are unchanged. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013STfqkxxaHR6czBMgfbyrk
|
This would also let tools subset CFF fonts that a PDF already embeds without rewriting its content. A 🤖 Generated with Claude Code |
I have a use case where I'm generating different parts of a PDF in parallel, then merging together. Obviously I don't want to embed multiple subsets of the same font, I want to merge the subsets at the end, but that needs deterministic glyph mappings. Claude created this PR to add an option for specifying the
CidMapping; by default it preserves existing behavior, but allows callers to specify they want the original glyph ID to be used as the CID.