Trait piston_window::character::CharacterCache[][src]

pub trait CharacterCache {
    type Texture: ImageSize;
    type Error;
    pub fn character(
        &'a mut self,
        font_size: u32,
        ch: char
    ) -> Result<Character<'a, Self::Texture>, Self::Error>; pub fn width(&mut self, size: u32, text: &str) -> Result<f64, 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

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

Get reference to character.

Loading content...

Provided methods

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

Return the width for some given text.

Loading content...

Implementors

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

type Texture = T

type Error = <T as TextureOp<F>>::Error

Loading content...