Expand description
Shared PDF font-encoding tables (WinAnsi / MacRoman / Standard, from ISO 32000 Appendix D) and a bundled glyph-name-to-Unicode subset, consumed by the pdfboss text-extraction and rendering crates.
Functions§
- glyph_
to_ unicode - Resolves a glyph name (as used in
/Differences) to a Unicode scalar:uniXXXXanduXXXX–uXXXXXXhex forms, single ASCII letters, and a bundled subset of the standard glyph list. - is_
standard_ 14 - Whether
base_font(after subset-prefix stripping and alias normalization) names one of the standard 14 fonts. - mac_
roman - Unicode value of
codeinMacRomanEncoding. - standard
- Unicode value of
codeinStandardEncoding. - standard_
14_ width - The advance width (1000-unit glyph space) of
glyph_namein the standard-14 font whose PDF/BaseFont(or a recognized alias, or a subsetted variant) isbase_font, orNoneifbase_fontisn’t one of the standard 14 (including Symbol/ZapfDingbats, which this module doesn’t tabulate) orglyph_nameis unknown to that font. Courier’s four variants are monospaced (every glyph is 600 units wide per the Adobe Core-14 AFM metrics) and so always returnSome(600.0). Oblique variants share their upright counterpart’s widths (Helvetica and Helvetica-Oblique are metrically identical, likewise the bold pair), so only upright/bold tables are stored. - standard_
encoding_ name - Adobe StandardEncoding glyph name for
code(ISO 32000-1 Annex D.2 “StandardEncoding” column; equivalently Adobe Type 1 Font Format Appendix C).Nonefor exactly the codesstandardleaves unassigned (see the self-verifyingstandard_encoding_name_matches_standard_tabletest below, which ties this table to that one so an authoring mistake here fails a test rather than silently mis-encoding a glyph). - win_
ansi - Unicode value of
codeinWinAnsiEncoding.