Skip to main content

Module fonts

Module fonts 

Source
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 first one the Renderer can resolve winning.

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§

FontRefs
A list of candidates, ready to travel.

Enums§

FontRef
One candidate.

Constants§

FONT_REF_ASSET
A registered font asset. value is its id.
FONT_REF_GENERIC
A generic family. value is its GenericFamily tag.
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. value and length are where the UTF-8 name sits, counted from the start of the buffer the record is in.
FONT_REF_VALUE_AT
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.