Expand description
Face management: the engine’s face roster, character→glyph resolution with the TeX math-italic convention and the math-alphabet mappings, and glyph-metric queries in em units.
Multi-face layout is structural (G0-3 Verdict 3): ∑ ∫ ∏ do not exist
in CM Unicode and resolve through the math-symbol fallback face, so
every positioned glyph names its face and resolution is data, not a
rendering afterthought. Resolution walks a per-request preference chain
and falls back across the roster; a character no face maps is a precise
MathError::UnmappedChar.
Italic correction, synthesized. TFM italic corrections do not exist
in the sfnt world; per the ratified measure-and-validate seam they are
synthesized from decoded geometry as the ink’s right overhang past the
advance (max(0, bbox_xmax − advance)), which reproduces their role in
script placement (slanted ∫ and italic letters push superscripts
right).
Structs§
- FaceSet
- The engine’s face roster, in
FaceIdorder. The set mirrors the bundled sovereign default (§11.1): CM regular/italic/bold/bold-italic, CM Typewriter, a sans face, and the math-symbol coverage face. - Glyph
Metrics - Per-glyph metrics in ems of the face’s design size.
Constants§
- FACE_
BOLD FaceIdof CM Bold.- FACE_
BOLD_ ITALIC FaceIdof CM Bold Italic.- FACE_
ITALIC FaceIdof CM Italic (math letters, lowercase Greek).- FACE_
REGULAR FaceIdof CM Regular (upright letters, digits, most symbols).- FACE_
SANS FaceIdof the sans face (IBM Plex Sans).- FACE_
SYMBOLS FaceIdof the math-symbol coverage face (Noto Sans Math subset).- FACE_
TYPEWRITER FaceIdof CM Typewriter.
Functions§
- accent_
spacing_ fallback - Spacing fallbacks for combining accent marks: when a face maps neither the combining character nor anything in the chain, the spacing equivalent often exists (CM Unicode carries the spacing accents).
- alphabet_
map - Map a character under a math alphabet, returning the (possibly remapped) character and its face-preference chain. Blackboard and calligraphic go through the Unicode math-alphanumeric planes (with the Letterlike exceptions), which the symbol face covers; the styled text faces handle the rest.
- blackboard_
char - The double-struck (blackboard) codepoint of a character: the Letterlike exceptions first, then U+1D538-block letters and U+1D7D8-block digits; unmapped characters pass through (and then fail resolution precisely).
- calligraphic_
char - The script (calligraphic) codepoint of a character, with the Letterlike exceptions.
- char_
alternate - Documented glyph alternates, applied only when the exact character is unmapped across the whole roster: variant forms whose conventional glyph the bundled faces do carry. The substitution stops firing the moment a face gains the exact codepoint (miss-only), and every pair is a same-letter variant — different-but-fine territory, not a semantic change.
- default_
math_ chain - The TeX math-italic convention for a direct character with no alphabet override: Latin letters and lowercase Greek render from the italic face; everything else (digits, uppercase Greek, operators, symbols) from the regular face — with the roster as fallback either way.
- glyph_
metrics - Measure a glyph in em units.
- kern_em
- Kerning between two glyphs of one face, in ems.