Skip to main content

Metadata

Struct Metadata 

Source
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: Fixed

Implementations§

Source§

impl<'a> Metadata<'a>

Source

fn new(data: &'a [u8], top_dict_index: u16) -> Option<Self>

Source

pub fn name(&self) -> Option<&'a str>

Returns the PostScript name.

Source

pub fn full_name(&self) -> Option<&'a str>

Returns the full font name.

Source

pub fn family_name(&self) -> Option<&'a str>

Returns the font family name.

Source

pub fn weight(&self) -> Option<&'a str>

Returns the weight or style name.

Source

pub fn italic_angle(&self) -> Fixed

Returns the italic angle.

Source

pub fn is_fixed_pitch(&self) -> bool

Returns true if the glyphs in this font have the same width.

Source

pub fn underline_position(&self) -> Fixed

Returns the position of the top of an underline decoration.

Source

pub fn underline_thickness(&self) -> Fixed

Returns the suggested size for an underline decoration.

Source

pub fn bbox(&self) -> BoundingBox<Fixed>

Returns the font bounding box.

Trait Implementations§

Source§

impl<'a> Clone for Metadata<'a>

Source§

fn clone(&self) -> Metadata<'a>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for Metadata<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Metadata<'_>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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> 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.