Struct gfx_graphics::GlyphCache [] [src]

pub struct GlyphCache<R, F> where R: Resources {
    pub face: Face<'static>,
    // some fields omitted
}

A struct used for caching rendered font.

Fields

face: Face<'static>

The font face.

Methods

impl<R, F> GlyphCache<R, F> where R: Resources
[src]

fn new<P>(font: P, factory: F) -> Result<Self, Error> where P: AsRef<Path>

Constructor for a GlyphCache.

Trait Implementations

impl<R, F> CharacterCache for GlyphCache<R, F> where R: Resources, F: Factory<R>
[src]

type Texture = Texture<R>

The textyre type associated with the character cache.

fn character(&mut self, size: FontSize, ch: char) -> &Character<Self::Texture>

Get reference to character.

fn width(&mut self, size: u32, text: &str) -> f64

Return the width for some given text.