PdfFont
A resolved PDF font.
The font knows how to:
decode show-text bytes into unicode (text extraction).
layoutBytes walk show-text bytes into a sequence of TextGlyphs — each tagged with its outline (if any), advance, and decoded text.
Simple fonts (Type 1, TrueType, Type1C, Type 3) consume one byte per glyph. Type 0 composite fonts (CIDFontType0/2 under a Type 0 parent) consume one code unit per glyph — typically 2 bytes via the Identity-H CMap, sometimes variable. layoutBytes is the unified iterator everything downstream uses.
Embedded outlines are pulled from whichever of these is present:
/FontFile→ Type 1 (PostScript)/FontFile2→ TrueType/FontFile3→ CFF (Type1C or CIDFontType0C)
Order tried matches what real fonts actually carry; falls back to the host system font (via baseFont) when no outlines are available.
Properties
Functions
True iff the underlying embedded font has its own advance metrics.
Invoke action once per glyph with its advance width (1/1000 em) and word-space flag, WITHOUT resolving any glyph outline or allocating a TextGlyph list. The fast path for advance/measurement (text positioning, width sums) where glyph shapes aren't needed — used by the renderer's advance calc, text extraction, and redaction layout.
Glyph id for a single byte code in a simple font. Returns 0 for composite fonts (their glyph IDs come from CIDs, not byte codes).
Per-byte outline lookup. Kept for backward compat with callers that pre-date the layoutBytes iterator; layoutBytes is the right path for any new code so composite Type 0 fonts work correctly.
Width (1/1000 em) for a single byte code in a simple font. Composite use layoutBytes.