Package-level declarations
Types
Subsets a CFF font program (the outlines inside an OpenType .otf) down to the glyphs a document uses, and re-emits it as a CID-keyed CFF.
One contour = sequence of points around a closed loop.
Broad typeface family a non-embedded font substitutes into.
Platform-neutral descriptor for picking a substitute system font when a document font ships no embedded outlines (e.g. the PDF Standard-14, or a CSS font with no @font-face file). Render backends map family + bold + italic to a host typeface. No PDF (or other format) types cross the canvas seam, so every document handler (PDF, EPUB, ...) feeds the same FontSpec.
Parsed glyph outline. TrueType outlines are sequences of contours, where each contour is points with on/off-curve flags. Off-curve points are quadratic Bézier control points; consecutive off-curve points imply an implied on-curve point at their midpoint.
A single glyph point in font design units.
The substitution half of OpenType shaping (GSUB), scoped to the two lookup types that carry the highest-value features for reflowable text:
Horizontal kerning for an SFNT font, from either the legacy kern table (format 0) or OpenType GPOS pair adjustment (lookup type 2, the kern feature). Returns the x-advance adjustment between two glyphs in font design units. Callers normalise to 1/1000 em like every other advance.
GPOS mark-to-base attachment (lookup type 4): the positioning offset that places a combining mark's anchor onto its base glyph's anchor (Arabic harakat, Hebrew points, Latin/Vietnamese diacritics). The offset is returned in font design units (base anchor − mark anchor); the caller applies it to the mark glyph's origin without touching the pen advance (marks are zero-advance).
Standard 14 base font widths, ported from the URW++ AFM files MuPDF ships. Metric-compatible with Adobe Helvetica / Times / Courier / Symbol / ZapfDingbats.
Pure-Kotlin TrueType / OpenType font parser.
Produces a subset TrueType font containing only the glyphs a document uses (plus their composite-glyph dependencies and .notdef).