pub struct ParsedFont {
pub font_metrics: FontMetrics,
pub num_glyphs: u16,
pub hhea_table: HheaTable,
pub hmtx_data: Vec<u8>,
pub maxp_table: MaxpTable,
pub gsub_cache: Option<LayoutCache<GSUB>>,
pub gpos_cache: Option<LayoutCache<GPOS>>,
pub opt_gdef_table: Option<Rc<GDEFTable>>,
pub glyph_records_decoded: BTreeMap<u16, OwnedGlyph>,
pub space_width: Option<usize>,
pub cmap_subtable: Option<CmapSubtable>,
}
Fields§
§font_metrics: FontMetrics
§num_glyphs: u16
§hhea_table: HheaTable
§hmtx_data: Vec<u8>
§maxp_table: MaxpTable
§gsub_cache: Option<LayoutCache<GSUB>>
§gpos_cache: Option<LayoutCache<GPOS>>
§opt_gdef_table: Option<Rc<GDEFTable>>
§glyph_records_decoded: BTreeMap<u16, OwnedGlyph>
§space_width: Option<usize>
§cmap_subtable: Option<CmapSubtable>
Implementations§
Source§impl ParsedFont
impl ParsedFont
pub fn from_bytes( font_bytes: &[u8], font_index: usize, parse_glyph_outlines: bool, ) -> Option<Self>
Sourcepub const fn get_space_width(&self) -> Option<usize>
pub const fn get_space_width(&self) -> Option<usize>
Returns the width of the space “ “ character
pub fn get_horizontal_advance(&self, glyph_index: u16) -> u16
pub fn get_glyph_size(&self, glyph_index: u16) -> Option<(i32, i32)>
pub fn shape( &self, text: &[u32], script: u32, lang: Option<u32>, ) -> ShapedTextBufferUnsized
pub fn lookup_glyph_index(&self, c: u32) -> Option<u16>
Trait Implementations§
Source§impl Clone for ParsedFont
impl Clone for ParsedFont
Source§fn clone(&self) -> ParsedFont
fn clone(&self) -> ParsedFont
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for ParsedFont
impl !RefUnwindSafe for ParsedFont
impl !Send for ParsedFont
impl !Sync for ParsedFont
impl Unpin for ParsedFont
impl !UnwindSafe for ParsedFont
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more