GlyphLoader

Trait GlyphLoader 

Source
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§

Source

fn contains_glyph(&mut self, codepoint: char) -> bool

Return true if this font loader contains this character.

Source

fn load_glyph(&mut self, arg: GlyphLoaderArg<'_>)

Try to load a glyph.

Refer to GlyphLoaderArg for details.

Provided Methods§

Source

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.

Source

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.

Implementors§