Skip to main content

Module metrics

Module metrics 

Source

Functions§

advance_units_to_pt
Convert a font-unit advance to PDF user-space points at size_pt, given the face’s units-per-em. Values are carried as i32 because shapers use signed advances, but current embedded output normalizes to PDF-emittable hmtx advances in 0..=65535. Preserve sign here anyway so future positioned shaping cannot turn a negative adjustment into a huge positive width.
ascent
Ascender height for font at size points.
base14_glyph_units 🔒
Width of a single character in a Base14 face, in 1/1000 em. WinAnsi natives go through the baked O(1) table; extended glyphs (Latin Extended-A, math operators, ligatures) go through the baked sorted name index. Anything else (Cyrillic, CJK, emoji) silently returns the width of ?; the PDF emit path renders those characters as ? too, so widths and content stream stay in sync. Embedded families exist precisely so callers wanting real coverage can opt out of this ?-everywhere behaviour.
descent
Descender depth for font at size points, as a positive number (the AFM/TTF storage convention is negative; both backends normalise on the way out).
glyph_width
Width of a single glyph in font at size points. For Base14 faces this is one AFM lookup; for embedded faces it shapes the single character. Used by the paragraph engine for character-wise hyphenation of oversized words.
text_width
Advance width of text rendered in font at size points.