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.
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, and language to a face that draws that language's own glyph forms. 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.
One glyph of a run that OpenTypeGsub.substitute reshapes.
The four written forms of Han characters, plus kana and Hangul, that a CJK substitute face is picked by. Unicode unifies one Han character across them (Unicode 17, 18.1), so the face, not the character, decides which form a reader sees.
Broad typeface family a non-embedded font substitutes into.
The substitution half of OpenType shaping: the GSUB table (OpenType 1.9, "GSUB: Glyph Substitution Table").
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).
Where one glyph of vertical text sits on the pen, and how far it moves the pen, in thousandths of an em (ISO 32000-1, 9.7.4.3). PdfFont.verticalMetrics gives it.
Glyph widths for the 14 standard fonts, in 1/1000 em.
One glyph laid out from a Tj / TJ show-text byte string.
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).
Functions
glyphs, a run of host-font text in spec, each with its outline from the bundled face that stands in for spec's generic family (standardFaceOutline), for a canvas whose host has no face of that family, as a browser has none (#593). The outlines are in units of 1000 to the em, and the advances stay the document's. Null when a glyph that draws something has no outline there, so that the run keeps the host's own text.