Expand description
The bridge from [font-parse]’s borrowed views to this owned model.
Everything else in the crate takes owned data; from_sfnt is the one
function that takes foreign bytes. It runs the L0 parser (which is total —
malformed input yields a typed [ParseError]) and resolves what it finds
into the model: outlines become [Command] streams, hmtx pairs become
per-glyph Metrics, cmap becomes owned subtables, name becomes owned
strings.
What the bridge does not do:
- CFF outlines.
font-parseexposes theCFFtable raw and does not decode charstrings; an'OTTO'font loads with empty outlines and aCFFopaque table attached. - Layout tables.
GSUB/GPOS/GDEFare carried through opaquely so a read-modify-write round trip stays lossless.font-shapereorders runs by codepoint class rather than interpretingGSUB. - Variation.
gvardeltas are not applied; the default instance’s outlines are what load. - Instructions. Hinting bytecode is not interpreted; outlines load unhinted.
Functions§
- from_
font_ ref - Resolve an already-parsed
FontRefinto the owned model. - from_
sfnt - Resolve a parsed font into the owned model.
- hmtx_
rows - Per-glyph metrics, extracted from a glyph store — what a writer serialises
into
hmtx. - to_
outline - Convert a parser contour list into a resolved
Outline.