pub struct ParsedFont {Show 14 fields
pub font_metrics: FontMetrics,
pub num_glyphs: u16,
pub hhea_table: Option<HheaTable>,
pub hmtx_data: Vec<u8>,
pub vmtx_data: Vec<u8>,
pub maxp_table: Option<MaxpTable>,
pub gsub_cache: Option<Rc<LayoutCacheData<GSUB>>>,
pub gpos_cache: Option<Rc<LayoutCacheData<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>,
pub original_bytes: Vec<u8>,
pub original_index: usize,
}
Fields§
§font_metrics: FontMetrics
§num_glyphs: u16
§hhea_table: Option<HheaTable>
§hmtx_data: Vec<u8>
§vmtx_data: Vec<u8>
§maxp_table: Option<MaxpTable>
§gsub_cache: Option<Rc<LayoutCacheData<GSUB>>>
§gpos_cache: Option<Rc<LayoutCacheData<GPOS>>>
§opt_gdef_table: Option<Rc<GDEFTable>>
§glyph_records_decoded: BTreeMap<u16, OwnedGlyph>
§space_width: Option<usize>
§cmap_subtable: Option<CmapSubtable>
§original_bytes: Vec<u8>
§original_index: usize
Implementations§
Source§impl ParsedFont
impl ParsedFont
pub fn subset_simple( &self, chars: &BTreeSet<char>, ) -> Result<SubsetFont, String>
Source§impl ParsedFont
impl ParsedFont
pub fn from_bytes( font_bytes: &[u8], font_index: usize, warnings: &mut Vec<PdfWarnMsg>, ) -> Option<ParsedFont>
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 (unscaled units)
Sourcepub fn get_horizontal_advance(&self, glyph_index: u16) -> u16
pub fn get_horizontal_advance(&self, glyph_index: u16) -> u16
Get the horizontal advance of a glyph index (unscaled units)
pub fn get_glyph_size(&self, glyph_index: u16) -> Option<(i32, i32)>
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 duplicate 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 moreSource§impl Debug for ParsedFont
impl Debug for ParsedFont
Source§impl Default for ParsedFont
impl Default for ParsedFont
Source§fn default() -> ParsedFont
fn default() -> ParsedFont
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ParsedFont
impl<'de> Deserialize<'de> for ParsedFont
Source§fn deserialize<D>(
deserializer: D,
) -> Result<ParsedFont, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<ParsedFont, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ParsedFont
impl PartialEq for ParsedFont
Source§impl Serialize for ParsedFont
impl Serialize for ParsedFont
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto 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