Skip to main content

Module fonts

Module fonts 

Source
Expand description

The font registry: font bytes in, font_ids out.

Both the shaper and every painter resolve glyphs through this one table, which is what makes preview equal export. The registry is the sole owner of font bytes; nothing else in the engine keeps a FontRef lifetime alive.

Structs§

AxisSetting
One axis of a variable face, pinned: the tag and the user-space coordinate this face sits at.
FaceAttributes
The slope and weight a face is matched at: the two axes of CSS font matching the engine supports.
FaceMatch
The face a request for a family, slope and weight resolved to, and what that face actually is.
FeatureSet
What one run asks the face for beyond the default set: the engine’s own smcp, and the features the sheet asked for.
FeatureSetting
One OpenType feature the run asks the face for: the tag and the value, where 0 turns the feature off and 1 turns it on. A feature with alternates takes the number of the alternate.
Features
The OpenType features a run is shaped with, beyond the ones the shaper turns on for every run.
FontMetricsTable
Font metrics in font units.
FontRefEntry
A font’s identity in the engine’s output.
FontRegistry
The registry: assigns font_ids, hands shaper access and metrics to the pipeline, and maps generic families to bundled faces.
FontSource
A font entering the engine: raw bytes and the identity the style tree matched against.
Rule
Where a face puts one rule across its text, in font units.
ShapedGlyph
One shaped glyph: its id, its advance, and the byte offset of its cluster in the shaped string — the bridge between shaping output and text-anchored break opportunities.

Enums§

FontError
What can go wrong loading a font.
GenericFamily
A generic family keyword, as in CSS.

Constants§

BUNDLED_FONT
The bundled upright text face: EB Garamond (SIL OFL 1.1).
BUNDLED_ITALIC
Its italic companion, from the same release: emphasis is a different set of outlines, not a slanted copy of these.

Functions§

bundled_registry
A registry with the bundled family registered — both slopes, and every weight each file names — and all generics mapped to it.