pub struct FontFace { /* private fields */ }Expand description
A parsed font prepared for glyph generation.
Implementations§
Source§impl FontFace
impl FontFace
Sourcepub fn parse(bytes: &[u8]) -> Result<FontFace, Error>
pub fn parse(bytes: &[u8]) -> Result<FontFace, Error>
Parses the first face in a TTF, OTF, or font collection.
§Errors
Returns Error::InvalidFont when bytes cannot be parsed as a font,
or Error::UnsupportedFont when the face uses an unsupported feature
or lacks a required family or style name.
Sourcepub fn family_name(&self) -> &str
pub fn family_name(&self) -> &str
Returns name ID 16 (typographic family), falling back to name ID 1.
Sourcepub fn style_name(&self) -> &str
pub fn style_name(&self) -> &str
Returns name ID 17 (typographic subfamily), falling back to name ID 2.
Sourcepub fn fontstack_name(&self) -> &str
pub fn fontstack_name(&self) -> &str
Returns the MapLibre font stack name in "{family} {style}" form.
Sourcepub fn covered_ranges(&self) -> Vec<u32>
pub fn covered_ranges(&self) -> Vec<u32>
Returns sorted starts of 256-codepoint ranges containing at least one glyph.
Sourcepub fn glyph_count(&self) -> usize
pub fn glyph_count(&self) -> usize
Returns the number of codepoints mapped to nonzero glyphs by the Unicode cmap.
Auto Trait Implementations§
impl Freeze for FontFace
impl RefUnwindSafe for FontFace
impl Send for FontFace
impl Sync for FontFace
impl Unpin for FontFace
impl UnsafeUnpin for FontFace
impl UnwindSafe for FontFace
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