pub struct Subfont {
subrs_offset: u32,
default_width: Option<Fixed>,
nominal_width: Fixed,
matrix: Option<ScaledFontMatrix>,
vs_index: u16,
}Expand description
Metadata for a CFF subfont.
A subfont is the collection of data read from both the Font DICT and Private Dict structures. These determine the set of subroutines, metrics and hinting parameters for some group of glyphs.
Use CffFontRef::subfont_index to determine the subfont index for a particular glyph and then CffFontRef::subfont (or CffFontRef::subfont_hinted) to retrieve the associated subfont.
Fields§
§subrs_offset: u32§default_width: Option<Fixed>§nominal_width: Fixed§matrix: Option<ScaledFontMatrix>§vs_index: u16Implementations§
Source§impl Subfont
impl Subfont
fn new( data: &[u8], range: Range<usize>, blend: Option<BlendState<'_>>, matrix: Option<ScaledFontMatrix>, ) -> Result<Self, Error>
fn new_hinted( data: &[u8], range: Range<usize>, blend: Option<BlendState<'_>>, matrix: Option<ScaledFontMatrix>, ) -> Result<(Self, HintingParams), Error>
Sourcepub fn subrs_offset(&self) -> u32
pub fn subrs_offset(&self) -> u32
Returns the offset to the local subroutine index from the start of the CFF blob.
Sourcepub fn default_width(&self) -> Option<Fixed>
pub fn default_width(&self) -> Option<Fixed>
Returns the default advance width.
The advance value for charstrings that do not contain a width.
Sourcepub fn nominal_width(&self) -> Fixed
pub fn nominal_width(&self) -> Fixed
Returns the nominal advance width.
The base advance value for charstrings that do contain a width. This should be added to the width in the charstring.
Sourcepub fn matrix(&self) -> Option<&ScaledFontMatrix>
pub fn matrix(&self) -> Option<&ScaledFontMatrix>
Returns the font matrix.
Trait Implementations§
impl Copy for Subfont
Auto Trait Implementations§
impl Freeze for Subfont
impl RefUnwindSafe for Subfont
impl Send for Subfont
impl Sync for Subfont
impl Unpin for Subfont
impl UnsafeUnpin for Subfont
impl UnwindSafe for Subfont
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