pub struct Font<Data> { /* private fields */ }Expand description
A well-formed PSF2 font
Implementations§
Source§impl<Data: AsRef<[u8]>> Font<Data>
impl<Data: AsRef<[u8]>> Font<Data>
Sourcepub fn new(data: Data) -> Result<Self, ParseError>
pub fn new(data: Data) -> Result<Self, ParseError>
Try to parse data as a PSF2 font
Sourcepub fn get_ascii(&self, c: u8) -> Option<Glyph<'_>>
pub fn get_ascii(&self, c: u8) -> Option<Glyph<'_>>
Get an iterator over the rows of the glyph bitmap for ASCII char c, if present
Sourcepub fn get_unicode(&self, c: char) -> Option<Glyph<'_>>
pub fn get_unicode(&self, c: char) -> Option<Glyph<'_>>
Like get_ascii, but for a unicode scalar value
Sourcepub fn get_unicode_composed(&self, seq: &str) -> Option<Glyph<'_>>
pub fn get_unicode_composed(&self, seq: &str) -> Option<Glyph<'_>>
Like get_unicode, but for one or more Unicode codepoints corresponding to a single glyph
Trait Implementations§
Auto Trait Implementations§
impl<Data> Freeze for Font<Data>where
Data: Freeze,
impl<Data> RefUnwindSafe for Font<Data>where
Data: RefUnwindSafe,
impl<Data> Send for Font<Data>where
Data: Send,
impl<Data> Sync for Font<Data>where
Data: Sync,
impl<Data> Unpin for Font<Data>where
Data: Unpin,
impl<Data> UnwindSafe for Font<Data>where
Data: 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