Struct opengles_graphics::glyph_cache::GlyphCache
source · pub struct GlyphCache<'a> {
pub font: Font<'a>,
/* private fields */
}
Expand description
A struct used for caching rendered font.
Fields§
§font: Font<'a>
The font.
Implementations§
source§impl<'a> GlyphCache<'a>
impl<'a> GlyphCache<'a>
sourcepub fn from_font(font: Font<'a>, settings: TextureSettings) -> Self
pub fn from_font(font: Font<'a>, settings: TextureSettings) -> Self
Constructs a GlyphCache from a Font.
sourcepub fn new<P>(
font: P,
settings: TextureSettings
) -> Result<GlyphCache<'static>, Error>where
P: AsRef<Path>,
pub fn new<P>(
font: P,
settings: TextureSettings
) -> Result<GlyphCache<'static>, Error>where
P: AsRef<Path>,
Constructor for a GlyphCache.
sourcepub fn from_bytes(
font: &'a [u8],
settings: TextureSettings
) -> Result<GlyphCache<'a>, Error>
pub fn from_bytes(
font: &'a [u8],
settings: TextureSettings
) -> Result<GlyphCache<'a>, Error>
Creates a GlyphCache for a font stored in memory.
sourcepub fn preload_chars<I>(&mut self, size: FontSize, chars: I)where
I: Iterator<Item = char>,
pub fn preload_chars<I>(&mut self, size: FontSize, chars: I)where
I: Iterator<Item = char>,
Load all characters in the chars
iterator for size
sourcepub fn preload_printable_ascii(&mut self, size: FontSize)
pub fn preload_printable_ascii(&mut self, size: FontSize)
Load all the printable ASCII characters for size
. Includes space.