pub struct TextSystem { /* private fields */ }Expand description
Font, atlas and glyph cache.
Implementations§
Source§impl TextSystem
impl TextSystem
Sourcepub fn new(font_bytes: &[u8]) -> Result<Self, RenderError>
pub fn new(font_bytes: &[u8]) -> Result<Self, RenderError>
Load a TrueType/OpenType font.
§Errors
RenderError::Font when the font cannot be parsed or lacks metrics.
Sourcepub fn with_default_font() -> Result<Self, RenderError>
pub fn with_default_font() -> Result<Self, RenderError>
Sourcepub fn cached_glyphs(&self) -> usize
pub fn cached_glyphs(&self) -> usize
Number of glyphs in the atlas.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TextSystem
impl RefUnwindSafe for TextSystem
impl Send for TextSystem
impl Sync for TextSystem
impl Unpin for TextSystem
impl UnsafeUnpin for TextSystem
impl UnwindSafe for TextSystem
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