Skip to main content

Os2

Struct Os2 

Source
pub struct Os2<'a> {
    data: FontData<'a>,
}
Expand description

Fields§

§data: FontData<'a>

Implementations§

Source§

impl<'a> Os2<'a>

Source

pub const MIN_SIZE: usize

Source

pub fn resolve_offset<O: Offset, R: FontRead<'a>>( &self, offset: O, ) -> Result<R, ReadError>

Resolve the provided offset from the start of this table.

Source

pub fn offset_data(&self) -> FontData<'a>

Return a reference to this table’s raw data.

We use this in the compile crate to resolve offsets.

Source

pub fn shape(&self) -> &Self

👎Deprecated: just use the base type directly

Return a reference to the table’s ‘Shape’ struct.

This is a low level implementation detail, but it can be useful in some cases where you want to know things about a table’s layout, such as the byte offsets of specific fields.

Source

pub fn version(&self) -> u16

Source

pub fn x_avg_char_width(&self) -> i16

Average weighted escapement.

The Average Character Width parameter specifies the arithmetic average of the escapement (width) of all non-zero width glyphs in the font.

Source

pub fn us_weight_class(&self) -> u16

Weight class.

Indicates the visual weight (degree of blackness or thickness of strokes) of the characters in the font. Values from 1 to 1000 are valid.

Source

pub fn us_width_class(&self) -> u16

Width class.

Indicates a relative change from the normal aspect ratio (width to height ratio) as specified by a font designer for the glyphs in a font.

Source

pub fn fs_type(&self) -> u16

Type flags.

Indicates font embedding licensing rights for the font.

Source

pub fn y_subscript_x_size(&self) -> i16

The recommended horizontal size in font design units for subscripts for this font.

Source

pub fn y_subscript_y_size(&self) -> i16

The recommended vertical size in font design units for subscripts for this font.

Source

pub fn y_subscript_x_offset(&self) -> i16

The recommended horizontal offset in font design units for subscripts for this font.

Source

pub fn y_subscript_y_offset(&self) -> i16

The recommended vertical offset in font design units for subscripts for this font.

Source

pub fn y_superscript_x_size(&self) -> i16

The recommended horizontal size in font design units for superscripts for this font.

Source

pub fn y_superscript_y_size(&self) -> i16

The recommended vertical size in font design units for superscripts for this font.

Source

pub fn y_superscript_x_offset(&self) -> i16

The recommended horizontal offset in font design units for superscripts for this font.

Source

pub fn y_superscript_y_offset(&self) -> i16

The recommended vertical offset in font design units for superscripts for this font.

Source

pub fn y_strikeout_size(&self) -> i16

Thickness of the strikeout stroke in font design units.

Source

pub fn y_strikeout_position(&self) -> i16

The position of the top of the strikeout stroke relative to the baseline in font design units.

Source

pub fn s_family_class(&self) -> i16

Font-family class and subclass. This parameter is a classification of font-family design.

Source

pub fn panose_10(&self) -> &'a [u8]

PANOSE classification number.

Additional specifications are required for PANOSE to classify non-Latin character sets.

Source

pub fn ul_unicode_range_1(&self) -> u32

Unicode Character Range.

Unicode Character Range (bits 0-31).

Source

pub fn ul_unicode_range_2(&self) -> u32

Unicode Character Range (bits 32-63).

Source

pub fn ul_unicode_range_3(&self) -> u32

Unicode Character Range (bits 64-95).

Source

pub fn ul_unicode_range_4(&self) -> u32

Unicode Character Range (bits 96-127).

Source

pub fn ach_vend_id(&self) -> Tag

Font Vendor Identification.

The four-character identifier for the vendor of the given type face.

Source

pub fn fs_selection(&self) -> SelectionFlags

Font selection flags.

Contains information concerning the nature of the font patterns.

Source

pub fn us_first_char_index(&self) -> u16

The minimum Unicode index (character code) in this font.

Source

pub fn us_last_char_index(&self) -> u16

The maximum Unicode index (character code) in this font.

Source

pub fn s_typo_ascender(&self) -> i16

The typographic ascender for this font.

Source

pub fn s_typo_descender(&self) -> i16

The typographic descender for this font.

Source

pub fn s_typo_line_gap(&self) -> i16

The typographic line gap for this font.

Source

pub fn us_win_ascent(&self) -> u16

The “Windows ascender” metric.

This should be used to specify the height above the baseline for a clipping region.

Source

pub fn us_win_descent(&self) -> u16

The “Windows descender” metric.

This should be used to specify the vertical extent below the baseline for a clipping region.

Source

pub fn ul_code_page_range_1(&self) -> Option<u32>

Code page character range bits 0-31.

Source

pub fn ul_code_page_range_2(&self) -> Option<u32>

Code page character range bits 32-63.

Source

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

This metric specifies the distance between the baseline and the approximate height of non-ascending lowercase letters measured in FUnits.

Source

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

This metric specifies the distance between the baseline and the approximate height of uppercase letters measured in FUnits.

Source

pub fn us_default_char(&self) -> Option<u16>

This is the Unicode codepoint, in UTF-16 encoding, of a character that can be used for a default glyph.

Source

pub fn us_break_char(&self) -> Option<u16>

This is the Unicode codepoint, in UTF-16 encoding, of a character that can be used as a default break character.

Source

pub fn us_max_context(&self) -> Option<u16>

This field is used for fonts with multiple optical styles.

Source

pub fn us_lower_optical_point_size(&self) -> Option<u16>

This field is used for fonts with multiple optical styles.

Source

pub fn us_upper_optical_point_size(&self) -> Option<u16>

This field is used for fonts with multiple optical styles.

Source

pub fn version_byte_range(&self) -> Range<usize>

Source

pub fn x_avg_char_width_byte_range(&self) -> Range<usize>

Source

pub fn us_weight_class_byte_range(&self) -> Range<usize>

Source

pub fn us_width_class_byte_range(&self) -> Range<usize>

Source

pub fn fs_type_byte_range(&self) -> Range<usize>

Source

pub fn y_subscript_x_size_byte_range(&self) -> Range<usize>

Source

pub fn y_subscript_y_size_byte_range(&self) -> Range<usize>

Source

pub fn y_subscript_x_offset_byte_range(&self) -> Range<usize>

Source

pub fn y_subscript_y_offset_byte_range(&self) -> Range<usize>

Source

pub fn y_superscript_x_size_byte_range(&self) -> Range<usize>

Source

pub fn y_superscript_y_size_byte_range(&self) -> Range<usize>

Source

pub fn y_superscript_x_offset_byte_range(&self) -> Range<usize>

Source

pub fn y_superscript_y_offset_byte_range(&self) -> Range<usize>

Source

pub fn y_strikeout_size_byte_range(&self) -> Range<usize>

Source

pub fn y_strikeout_position_byte_range(&self) -> Range<usize>

Source

pub fn s_family_class_byte_range(&self) -> Range<usize>

Source

pub fn panose_10_byte_range(&self) -> Range<usize>

Source

pub fn ul_unicode_range_1_byte_range(&self) -> Range<usize>

Source

pub fn ul_unicode_range_2_byte_range(&self) -> Range<usize>

Source

pub fn ul_unicode_range_3_byte_range(&self) -> Range<usize>

Source

pub fn ul_unicode_range_4_byte_range(&self) -> Range<usize>

Source

pub fn ach_vend_id_byte_range(&self) -> Range<usize>

Source

pub fn fs_selection_byte_range(&self) -> Range<usize>

Source

pub fn us_first_char_index_byte_range(&self) -> Range<usize>

Source

pub fn us_last_char_index_byte_range(&self) -> Range<usize>

Source

pub fn s_typo_ascender_byte_range(&self) -> Range<usize>

Source

pub fn s_typo_descender_byte_range(&self) -> Range<usize>

Source

pub fn s_typo_line_gap_byte_range(&self) -> Range<usize>

Source

pub fn us_win_ascent_byte_range(&self) -> Range<usize>

Source

pub fn us_win_descent_byte_range(&self) -> Range<usize>

Source

pub fn ul_code_page_range_1_byte_range(&self) -> Range<usize>

Source

pub fn ul_code_page_range_2_byte_range(&self) -> Range<usize>

Source

pub fn sx_height_byte_range(&self) -> Range<usize>

Source

pub fn s_cap_height_byte_range(&self) -> Range<usize>

Source

pub fn us_default_char_byte_range(&self) -> Range<usize>

Source

pub fn us_break_char_byte_range(&self) -> Range<usize>

Source

pub fn us_max_context_byte_range(&self) -> Range<usize>

Source

pub fn us_lower_optical_point_size_byte_range(&self) -> Range<usize>

Source

pub fn us_upper_optical_point_size_byte_range(&self) -> Range<usize>

Trait Implementations§

Source§

impl<'a> Clone for Os2<'a>

Source§

fn clone(&self) -> Os2<'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> FontRead<'a> for Os2<'a>

Source§

fn read(data: FontData<'a>) -> Result<Self, ReadError>

Read an instance of Self from the provided data, performing validation. Read more
Source§

impl<'a> MinByteRange<'a> for Os2<'a>

Source§

impl TopLevelTable for Os2<'_>

Source§

const TAG: Tag

OS/2

Auto Trait Implementations§

§

impl<'a> Freeze for Os2<'a>

§

impl<'a> RefUnwindSafe for Os2<'a>

§

impl<'a> Send for Os2<'a>

§

impl<'a> Sync for Os2<'a>

§

impl<'a> Unpin for Os2<'a>

§

impl<'a> UnsafeUnpin for Os2<'a>

§

impl<'a> UnwindSafe for Os2<'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<'a, T> FontReadWithArgs<'a> for T
where T: FontRead<'a>,

Source§

fn read_with_args( data: FontData<'a>, _: &<T as ReadArgs>::Args, ) -> Result<T, ReadError>

read an item, using the provided args. 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<'a, T> ReadArgs for T
where T: FontRead<'a>,

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.