pub struct TrueTypeFont {
pub glyf_table: Vec<GlyfOutline>,
pub cmap_table: CmapTable,
pub post_table: PostTable,
pub name_table: NameTable,
}Expand description
The raw data from a TrueType font
Contains only the subset of the table needed for mapping unicode:
- Codepoints
- Glyph indices
- Glyph names
- Glyph outlines
Fields§
§glyf_table: Vec<GlyfOutline>The glyph outlines in the font, indexed by glyph_id
cmap_table: CmapTableThe CMAP table of the font
post_table: PostTableThe Post table of the font
name_table: NameTableThe Name table of the font
Implementations§
Source§impl TrueTypeFont
impl TrueTypeFont
Sourcepub fn new(font_data: &[u8]) -> Result<TrueTypeFont, ParseError>
pub fn new(font_data: &[u8]) -> Result<TrueTypeFont, ParseError>
Creates a new TrueType font from the given font data
§Errors
Returns an error if the font data is invalid or cannot be parsed
Trait Implementations§
Source§impl Debug for TrueTypeFont
impl Debug for TrueTypeFont
Source§impl From<TrueTypeFont> for Font
impl From<TrueTypeFont> for Font
Source§fn from(value: TrueTypeFont) -> Font
fn from(value: TrueTypeFont) -> Font
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for TrueTypeFont
impl RefUnwindSafe for TrueTypeFont
impl Send for TrueTypeFont
impl Sync for TrueTypeFont
impl Unpin for TrueTypeFont
impl UnwindSafe for TrueTypeFont
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