pub struct Font<'a> { /* private fields */ }Expand description
A loaded font file.
Can be loaded as [FileBuf] from ROM with [load_file_buf]
and then cast using [FileBuf::as_font].
Implementations§
Source§impl Font<'_>
impl Font<'_>
Sourcepub fn line_width(&self, t: &str) -> u32
pub fn line_width(&self, t: &str) -> u32
Calculate width (in pixels) of the given text.
This function does not account for newlines.
Sourcepub fn char_width(&self) -> u8
pub fn char_width(&self) -> u8
The width (in pixels) of one character.
Sourcepub fn char_height(&self) -> u8
pub fn char_height(&self) -> u8
The hight (in pixels) of one character (one line).
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Font<'a>
impl<'a> RefUnwindSafe for Font<'a>
impl<'a> Send for Font<'a>
impl<'a> Sync for Font<'a>
impl<'a> Unpin for Font<'a>
impl<'a> UnwindSafe for Font<'a>
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