TrueTypeFont
Pure-Kotlin TrueType / OpenType font parser.
Reads the subset of SFNT tables needed to render glyphs: head, maxp, hhea, hmtx, cmap, loca, glyf. Composite glyphs are supported with argument transforms; emoji-style colour tables (COLR/CPAL/sbix/CBDT) are not yet handled — those are extras layered on top of plain outline data, so without them you still get monochrome shapes.
The font keeps the original byte buffer alive; lookups are lazy and cached via Cache. That keeps memory flat — most PDFs reference 50–200 glyphs from a font containing thousands.
Properties
Functions
Glyph advance width in font design units.
Convert a unicode codepoint to a glyph index, or 0 (.notdef) if unmapped.
Get the outline for glyphId, or null if the glyph slot is empty (zero-length).
Outline as a PdfPath, cached — the GlyphOutline → PdfPath conversion is built once per glyph, not on every draw.