[−]Trait piston_window::character::CharacterCache
Stores characters in a buffer and loads them by demand.
Associated Types
type Texture: ImageSize
The texture type associated with the character cache.
type Error
The error type associated with the character cache.
Required methods
fn character(
&'a mut self,
font_size: u32,
ch: char
) -> Result<Character<'a, Self::Texture>, Self::Error>
&'a mut self,
font_size: u32,
ch: char
) -> Result<Character<'a, Self::Texture>, Self::Error>
Get reference to character.
Provided methods
fn width(&mut self, size: u32, text: &str) -> Result<f64, Self::Error>
Return the width for some given text.
Implementors
impl<'b, F, T> CharacterCache for GlyphCache<'b, F, T> where
T: ImageSize + CreateTexture<F> + UpdateTexture<F>,
T: ImageSize + CreateTexture<F> + UpdateTexture<F>,
type Texture = T
type Error = <T as TextureOp<F>>::Error
fn character(
&'a mut self,
size: u32,
ch: char
) -> Result<Character<'a, T>, <GlyphCache<'b, F, T> as CharacterCache>::Error>
&'a mut self,
size: u32,
ch: char
) -> Result<Character<'a, T>, <GlyphCache<'b, F, T> as CharacterCache>::Error>