Skip to main content

Module faces

Module faces 

Source
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 FaceId order. 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.
GlyphMetrics
Per-glyph metrics in ems of the face’s design size.

Constants§

FACE_BOLD
FaceId of CM Bold.
FACE_BOLD_ITALIC
FaceId of CM Bold Italic.
FACE_ITALIC
FaceId of CM Italic (math letters, lowercase Greek).
FACE_REGULAR
FaceId of CM Regular (upright letters, digits, most symbols).
FACE_SANS
FaceId of the sans face (IBM Plex Sans).
FACE_SYMBOLS
FaceId of the math-symbol coverage face (Noto Sans Math subset).
FACE_TYPEWRITER
FaceId of 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.