pub struct FontSet { /* private fields */ }Expand description
The faces a frame draws with: every font loaded at init, keyed by handle, plus the face a label naming no font of its own falls back to.
Nothing compiles a font for text that names none, whichever way the world was assembled, so the renderer registers the engine’s built-in face as the fallback whenever some text needs it. A world whose text all names a Font leaves the fallback unset and pays nothing for it.
Implementations§
Source§impl FontSet
impl FontSet
Sourcepub fn insert(&mut self, handle: FontHandle, font: LoadedFont)
pub fn insert(&mut self, handle: FontHandle, font: LoadedFont)
Register font under handle, replacing any face already there.
Sourcepub fn set_fallback(&mut self, handle: FontHandle)
pub fn set_fallback(&mut self, handle: FontHandle)
Draw labels naming no font with the face under handle.
Sourcepub fn get(&self, handle: FontHandle) -> Option<&LoadedFont>
pub fn get(&self, handle: FontHandle) -> Option<&LoadedFont>
The face registered under handle.
Sourcepub fn resolve(&self, font: Option<FontHandle>) -> Option<&LoadedFont>
pub fn resolve(&self, font: Option<FontHandle>) -> Option<&LoadedFont>
The face a label draws with: the one it names, or the fallback when it names none (or names one that never loaded).
Sourcepub fn any_atlas_slot(&self) -> Option<usize>
pub fn any_atlas_slot(&self) -> Option<usize>
Atlas slot of an arbitrary loaded face, which the sprite shaper uses as the texture slot for its untextured (sentinel-UV) quads.