Struct piston_window::glyph_cache::rusttype::GlyphCache
source · pub struct GlyphCache<'a, F, T> {
pub font: Font<'a>,
pub factory: F,
/* private fields */
}
Expand description
A struct used for caching rendered font.
Fields§
§font: Font<'a>
The font.
factory: F
The factory used to create textures.
Implementations§
source§impl<'a, F, T> GlyphCache<'a, F, T>
impl<'a, F, T> GlyphCache<'a, F, T>
sourcepub fn from_font(
font: Font<'a>,
factory: F,
settings: TextureSettings
) -> GlyphCache<'a, F, T>
pub fn from_font( font: Font<'a>, factory: F, settings: TextureSettings ) -> GlyphCache<'a, F, T>
Constructs a GlyphCache from a Font.
sourcepub fn new<P>(
font: P,
factory: F,
settings: TextureSettings
) -> Result<GlyphCache<'static, F, T>, Error>
pub fn new<P>( font: P, factory: F, settings: TextureSettings ) -> Result<GlyphCache<'static, F, T>, Error>
Constructor for a GlyphCache.
sourcepub fn from_bytes(
font: &'a [u8],
factory: F,
settings: TextureSettings
) -> Result<GlyphCache<'a, F, T>, ()>
pub fn from_bytes( font: &'a [u8], factory: F, settings: TextureSettings ) -> Result<GlyphCache<'a, F, T>, ()>
Creates a GlyphCache for a font stored in memory.
sourcepub fn preload_chars<I>(
&mut self,
size: u32,
chars: I
) -> Result<(), <T as TextureOp<F>>::Error>
pub fn preload_chars<I>( &mut self, size: u32, chars: I ) -> Result<(), <T as TextureOp<F>>::Error>
Load all characters in the chars
iterator for size
Trait Implementations§
source§impl<'b, F, T> CharacterCache for GlyphCache<'b, F, T>
impl<'b, F, T> CharacterCache for GlyphCache<'b, F, T>
source§fn character(
&mut self,
size: u32,
ch: char
) -> Result<Character<'_, T>, <GlyphCache<'b, F, T> as CharacterCache>::Error>
fn character( &mut self, size: u32, ch: char ) -> Result<Character<'_, T>, <GlyphCache<'b, F, T> as CharacterCache>::Error>
Get reference to character.
Auto Trait Implementations§
impl<'a, F, T> Freeze for GlyphCache<'a, F, T>where
F: Freeze,
impl<'a, F, T> RefUnwindSafe for GlyphCache<'a, F, T>where
F: RefUnwindSafe,
T: RefUnwindSafe,
impl<'a, F, T> Send for GlyphCache<'a, F, T>
impl<'a, F, T> Sync for GlyphCache<'a, F, T>
impl<'a, F, T> Unpin for GlyphCache<'a, F, T>
impl<'a, F, T> UnwindSafe for GlyphCache<'a, F, T>where
F: UnwindSafe,
T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more