Struct ttf_parser::tables::os2::Table

source ·
pub struct Table<'a> {
    pub version: u8,
    data: &'a [u8],
}
Expand description

Fields§

§version: u8

Table version.

§data: &'a [u8]

Implementations§

source§

impl<'a> Table<'a>

source

pub fn parse(data: &'a [u8]) -> Option<Self>

Parses a table from raw data.

source

pub fn weight(&self) -> Weight

Returns weight class.

source

pub fn width(&self) -> Width

Returns face width.

source

pub fn permissions(&self) -> Option<Permissions>

Returns face permissions.

Returns None in case of a malformed value.

source

pub fn is_subsetting_allowed(&self) -> bool

Checks if the face allows embedding a subset, further restricted by Self::permissions.

source

pub fn is_outline_embedding_allowed(&self) -> bool

Checks if the face allows outline data to be embedded.

If false, only bitmaps may be embedded in accordance with Self::permissions.

If the font contains no bitmaps and this flag is not set, it implies no embedding is allowed.

source

pub fn subscript_metrics(&self) -> ScriptMetrics

Returns subscript metrics.

source

pub fn superscript_metrics(&self) -> ScriptMetrics

Returns superscript metrics.

source

pub fn strikeout_metrics(&self) -> LineMetrics

Returns strikeout metrics.

source

pub fn unicode_ranges(&self) -> UnicodeRanges

Returns Unicode ranges.

source

fn fs_selection(&self) -> u16

source

pub fn style(&self) -> Style

Returns style.

source

pub fn is_bold(&self) -> bool

Checks if face is bold.

Do not confuse with Weight::Bold.

source

pub fn use_typographic_metrics(&self) -> bool

Checks if typographic metrics should be used.

source

pub fn typographic_ascender(&self) -> i16

Returns typographic ascender.

source

pub fn typographic_descender(&self) -> i16

Returns typographic descender.

source

pub fn typographic_line_gap(&self) -> i16

Returns typographic line gap.

source

pub fn windows_ascender(&self) -> i16

Returns Windows ascender.

source

pub fn windows_descender(&self) -> i16

Returns Windows descender.

source

pub fn x_height(&self) -> Option<i16>

Returns x height.

Returns None version is < 2.

source

pub fn capital_height(&self) -> Option<i16>

Returns capital height.

Returns None version is < 2.

Trait Implementations§

source§

impl<'a> Clone for Table<'a>

source§

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

Returns a copy 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 Debug for Table<'_>

source§

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

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

impl<'a> Copy for Table<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for Table<'a>

§

impl<'a> RefUnwindSafe for Table<'a>

§

impl<'a> Send for Table<'a>

§

impl<'a> Sync for Table<'a>

§

impl<'a> Unpin for Table<'a>

§

impl<'a> UnwindSafe for Table<'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> 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,

§

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>,

§

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>,

§

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.