pub struct Metadata<'a> {
name: Option<&'a str>,
full_name: Option<&'a str>,
family_name: Option<&'a str>,
weight: Option<&'a str>,
bbox: BoundingBox<Fixed>,
italic_angle: Fixed,
is_fixed_pitch: bool,
underline_position: Fixed,
underline_thickness: Fixed,
}Expand description
Extra metadata for a CFF font.
This is accessed separately because this information is redundant when a CFF blob is used in an OpenType font.
Fields§
§name: Option<&'a str>§full_name: Option<&'a str>§family_name: Option<&'a str>§weight: Option<&'a str>§bbox: BoundingBox<Fixed>§italic_angle: Fixed§is_fixed_pitch: bool§underline_position: Fixed§underline_thickness: FixedImplementations§
Source§impl<'a> Metadata<'a>
impl<'a> Metadata<'a>
fn new(data: &'a [u8], top_dict_index: u16) -> Option<Self>
Sourcepub fn family_name(&self) -> Option<&'a str>
pub fn family_name(&self) -> Option<&'a str>
Returns the font family name.
Sourcepub fn italic_angle(&self) -> Fixed
pub fn italic_angle(&self) -> Fixed
Returns the italic angle.
Sourcepub fn is_fixed_pitch(&self) -> bool
pub fn is_fixed_pitch(&self) -> bool
Returns true if the glyphs in this font have the same width.
Sourcepub fn underline_position(&self) -> Fixed
pub fn underline_position(&self) -> Fixed
Returns the position of the top of an underline decoration.
Sourcepub fn underline_thickness(&self) -> Fixed
pub fn underline_thickness(&self) -> Fixed
Returns the suggested size for an underline decoration.
Sourcepub fn bbox(&self) -> BoundingBox<Fixed>
pub fn bbox(&self) -> BoundingBox<Fixed>
Returns the font bounding box.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Metadata<'a>
impl<'a> RefUnwindSafe for Metadata<'a>
impl<'a> Send for Metadata<'a>
impl<'a> Sync for Metadata<'a>
impl<'a> Unpin for Metadata<'a>
impl<'a> UnsafeUnpin for Metadata<'a>
impl<'a> UnwindSafe for Metadata<'a>
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