pub struct Subtable<'a> {
    pub platform_id: PlatformId,
    pub encoding_id: u16,
    pub format: Format<'a>,
}
Expand description

A character encoding subtable.

Fields§

§platform_id: PlatformId

Subtable platform.

§encoding_id: u16

Subtable encoding.

§format: Format<'a>

A subtable format.

Implementations§

source§

impl<'a> Subtable<'a>

source

pub fn is_unicode(&self) -> bool

Checks that the current encoding is Unicode compatible.

source

pub fn glyph_index(&self, code_point: u32) -> Option<GlyphId>

Maps a character to a glyph ID.

This is a low-level method and unlike Face::glyph_index it doesn’t check that the current encoding is Unicode. It simply maps a u32 codepoint number to a glyph ID.

Returns None:

  • when glyph ID is 0.
  • when format is MixedCoverage, since it’s not supported.
  • when format is UnicodeVariationSequences. Use glyph_variation_index instead.
source

pub fn glyph_variation_index( &self, code_point: u32, variation: u32 ) -> Option<GlyphVariationResult>

Resolves a variation of a glyph ID from two code points.

Returns None:

  • when glyph ID is 0.
  • when format is not UnicodeVariationSequences.
source

pub fn codepoints<F>(&self, f: F)
where F: FnMut(u32),

Calls f for all codepoints contained in this subtable.

This is a low-level method and it doesn’t check that the current encoding is Unicode. It simply calls the function f for all u32 codepoints that are present in this subtable.

Note that this may list codepoints for which glyph_index still returns None because this method finds all codepoints which were defined in this subtable. The subtable may still map them to glyph ID 0.

Returns without doing anything:

  • when format is MixedCoverage, since it’s not supported.
  • when format is UnicodeVariationSequences, since it’s not supported.

Trait Implementations§

source§

impl<'a> Clone for Subtable<'a>

source§

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

source§

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

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

impl<'a> Copy for Subtable<'a>

Auto Trait Implementations§

§

impl<'a> RefUnwindSafe for Subtable<'a>

§

impl<'a> Send for Subtable<'a>

§

impl<'a> Sync for Subtable<'a>

§

impl<'a> Unpin for Subtable<'a>

§

impl<'a> UnwindSafe for Subtable<'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.