Expand description
Runtime font registry: families → (weight, style) → fontdue::Font.
The registry is the live, loaded-in-memory counterpart of the theme’s
fonts block (super::FontFamilyDef). It is built once at theme load
time by calling FontRegistry::from_families, then handed to the
render backends as an Arc<FontRegistry> so they can resolve specific
sources on demand without re-reading TTFs from disk.
§Resolution order
FontRegistry::resolve looks up a family / weight / style triple with
the following precedence:
- Exact
(family, weight, style)match. - Same family and style, weight closest to the request (absolute diff).
- Same family, any style, weight closest to the request.
- Walk the family’s
fallbackschain, recursing into each fallback family with the original weight/style.
When nothing matches, FontRegistry::resolve returns None; callers
fall back to the canvas’ system font.
Structs§
- Composite key identifying a single font source within a family.
- A loaded font registry: the theme’s declared families materialised into live
fontdue::Fonthandles, indexed by family id / weight / style.
Enums§
- Error raised when loading a font source fails.