Trait lux::font::TextLoad [] [src]

pub trait TextLoad: Sized + HasDisplay + HasFontCache {
    fn cache<F: IntoSprite>(&mut self, name: &str, size: u16, rendered: RenderedFont<F>) -> LuxResult<()> { ... }
    fn clear(&mut self, name: &str, size: u16) { ... }
    fn use_font(&mut self, name: &str, size: u16) -> LuxResult<()> { ... }
}

Any struct that implements TextLoad can have fonts atlases added to an internal cache.

Fonts must be loaded before they can be drawn with TextDraw.

Provided Methods

fn cache<F: IntoSprite>(&mut self, name: &str, size: u16, rendered: RenderedFont<F>) -> LuxResult<()>

Adds a rendered font to the font cache.

fn clear(&mut self, name: &str, size: u16)

Removes a rendered font from the cache.

fn use_font(&mut self, name: &str, size: u16) -> LuxResult<()>

Sets a font as the current font.

Implementors