Skip to main content

FontFile

Struct FontFile 

Source
pub struct FontFile { /* private fields */ }

Implementations§

Source§

impl FontFile

Source

pub fn parse_font_file<P: AsRef<Path>>(path: P) -> Result<Self, Error>

Source

pub fn get_table(&self, tag: &[u8; 4]) -> Result<&[u8], Error>

Source

pub fn parse_head(&self) -> Result<HeadTable, Error>

Source

pub fn parse_maxp(&self) -> Result<MaxpTable, Error>

Source

pub fn parse_cmap(&self) -> Result<CmapTable, Error>

Source

pub fn parse_loca( &self, num_glyphs: u16, index_to_loc_format: i16, ) -> Result<Vec<u32>, Error>

Source

pub fn parse_glyf( &self, loca_offsets: Vec<u32>, ) -> Result<Vec<Option<Glyph>>, Error>

Source

pub fn parse_hhea(&self) -> Result<HheaTable, Error>

Source

pub fn parse_hmtx( &self, num_glyphs: u16, number_of_h_metrics: u16, ) -> Result<HmtxTable, Error>

Source

pub fn parse_name(&self) -> Result<NameTable, Error>

Source

pub fn parse_os2(&self) -> Result<OS2Table, Error>

Source

pub fn parse_post(&self) -> Result<PostTable, Error>

Source

pub fn parse_vhea(&self) -> Result<VheaTable, Error>

Source

pub fn parse_vmtx( &self, num_glyphs: u16, number_of_v_metrics: u16, ) -> Result<VmtxTable, Error>

Source

pub fn parse_kern(&self) -> Result<KernTable, Error>

Source

pub fn parse_gasp(&self) -> Result<GaspTable, Error>

Source

pub fn parse_cvt(&self) -> Result<Vec<i16>, Error>

Source

pub fn parse_fpgm(&self) -> Result<Vec<u8>, Error>

Source

pub fn parse_prep(&self) -> Result<Vec<u8>, Error>

Source

pub fn parse_gpos(&self) -> Result<GposTable<GposSubtable>, Error>

Source

pub fn parse_gsub(&self) -> Result<GsubTable<GsubSubtable>, Error>

Source§

impl FontFile

Source

pub fn file_type(&self) -> FontFileType

Source

pub fn bytes(&self) -> &[u8]

Source

pub fn table_records(&self) -> &[TableRecord]

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.