Trait graphics::character::CharacterCache[][src]

pub trait CharacterCache {
    type Texture: ImageSize;
    type Error;
    fn character<'a>(
        &'a mut self,
        font_size: FontSize,
        ch: char
    ) -> Result<Character<'a, Self::Texture>, Self::Error>; fn width(
        &mut self,
        size: FontSize,
        text: &str
    ) -> Result<Scalar, Self::Error> { ... } }

Stores characters in a buffer and loads them by demand.

Associated Types

type Texture: ImageSize[src]

The texture type associated with the character cache.

type Error[src]

The error type associated with the character cache.

Loading content...

Required methods

fn character<'a>(
    &'a mut self,
    font_size: FontSize,
    ch: char
) -> Result<Character<'a, Self::Texture>, Self::Error>
[src]

Get reference to character.

Loading content...

Provided methods

fn width(&mut self, size: FontSize, text: &str) -> Result<Scalar, Self::Error>[src]

Return the width for some given text.

Loading content...

Implementors

impl<'b, F, T: ImageSize> CharacterCache for GlyphCache<'b, F, T> where
    T: CreateTexture<F> + UpdateTexture<F>, 
[src]

type Texture = T

type Error = T::Error

Loading content...