Expand description
The font a piece of text with no role is set in.
Text with a role takes its font from the theme, and nothing on this side can change
that for one node. Text with no role, which is what a page laid out by CSS draws, names
its own: a list of candidates tried in order, the way a CSS font-family list is. The
text is set in the first one the Renderer can resolve, and a letter it has no glyph for
comes from the next candidate that has one.
The list travels as fixed-length records followed by the bytes of the family names they
point at. The same records sit in a Text’s Font property, in a run of a Text’s
spans, and in a measure request, so the Renderer resolves all three with one function
and the text it measures is set in exactly the font it draws.
Structs§
- Font
Refs - A list of candidates, ready to travel.
- Font
Stack - Fonts the application shipped, tried a glyph at a time in the order given.
Enums§
- FontRef
- One candidate.
Constants§
- FONT_
REF_ ASSET - A registered font asset.
valueis its id. - FONT_
REF_ GENERIC - A generic family.
valueis itsGenericFamilytag. - FONT_
REF_ KIND_ AT - Where each word of a candidate starts.
- FONT_
REF_ LEN - Bytes of one candidate: what kind it is, then two words whose meaning the kind gives.
- FONT_
REF_ LENGTH_ AT - FONT_
REF_ SYSTEM - An installed family, by name.
valueandlengthare where the UTF-8 name sits, counted from the start of the buffer the record is in. - FONT_
REF_ VALUE_ AT - FONT_
STACK_ MAGIC - What the bytes of a font stack start with.
- FONT_
STACK_ VERSION - The layout of a stack after the magic. Version 1 is a family count, then for each family
a face count and that many face ids, every number a little endian
u32. - MAX_
FONT_ REFS - The most candidates one list may hold. A CSS list longer than this is a page that names fonts it does not expect to find, and the ninth would never be reached.
- MAX_
FONT_ STACK_ FACES - The most faces one family of a stack may hold: one for each of the nine standard weights, upright and italic.
- MAX_
FONT_ STACK_ FAMILIES - The most families one stack may hold, for the same reason a font list stops at eight.