pub trait GlyphLoader {
// Required methods
fn contains_glyph(&mut self, codepoint: char) -> bool;
fn load_glyph(&mut self, arg: GlyphLoaderArg<'_>);
// Provided methods
fn font_baked_init(&mut self, _baked: &mut FontBaked) { ... }
fn font_baked_destroy(&mut self, _baked: &mut FontBaked) { ... }
}Expand description
Trait that implements a custom font loader.
Required Methods§
Sourcefn contains_glyph(&mut self, codepoint: char) -> bool
fn contains_glyph(&mut self, codepoint: char) -> bool
Return true if this font loader contains this character.
Sourcefn load_glyph(&mut self, arg: GlyphLoaderArg<'_>)
fn load_glyph(&mut self, arg: GlyphLoaderArg<'_>)
Try to load a glyph.
Refer to GlyphLoaderArg for details.
Provided Methods§
Sourcefn font_baked_init(&mut self, _baked: &mut FontBaked)
fn font_baked_init(&mut self, _baked: &mut FontBaked)
Initialize the parameters of the corresponding FontBaked.
Not needed if this custom loader is part of a font collection and is not the first one.
Sourcefn font_baked_destroy(&mut self, _baked: &mut FontBaked)
fn font_baked_destroy(&mut self, _baked: &mut FontBaked)
The font baked is about to be destroyed.
Rarely useful, maybe if you had some raw resource stored in the baked.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".