Type Alias ClassDefFormat2

Source
pub type ClassDefFormat2<'a> = TableRef<'a, ClassDefFormat2Marker>;
Expand description

Aliased Type§

pub struct ClassDefFormat2<'a> {
    pub(crate) shape: ClassDefFormat2Marker,
    pub(crate) data: FontData<'a>,
}

Fields§

§shape: ClassDefFormat2Marker§data: FontData<'a>

Implementations§

Source§

impl<'a> ClassDefFormat2<'a>

Source

pub fn class_format(&self) -> u16

Format identifier — format = 2

Source

pub fn class_range_count(&self) -> u16

Number of ClassRangeRecords

Source

pub fn class_range_records(&self) -> &'a [ClassRangeRecord]

Array of ClassRangeRecords — ordered by startGlyphID

Source§

impl<'a> ClassDefFormat2<'a>

Source

pub fn get(&self, gid: impl Into<GlyphId>) -> u16

Get the class for this glyph id

Source

pub fn iter(&self) -> impl Iterator<Item = (GlyphId16, u16)> + 'a

Iterate over each glyph and its class.

Source

pub fn population(&self) -> usize

Return the number of glyphs explicitly assigned to a class in this table

Source

pub fn cost(&self) -> u32

Return the cost of looking up a glyph in this table

Source

fn intersect_classes(&self, glyphs: &IntSet<GlyphId>) -> IntSet<u16>

Returns class values for the intersected glyphs of this table and input ‘glyphs’ set.

Source

fn intersected_class_glyphs( &self, glyphs: &IntSet<GlyphId>, class: u16, ) -> IntSet<GlyphId>

Returns intersected glyphs of this table and input ‘glyphs’ set that are assgiend to input class value.

Trait Implementations§

Source§

impl<'a> Debug for ClassDefFormat2<'a>

Source§

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

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

impl<'a> FontRead<'a> for ClassDefFormat2<'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 Intersect for ClassDefFormat2<'_>

Source§

fn intersects(&self, glyph_set: &IntSet<GlyphId>) -> Result<bool, ReadError>

Source§

impl<'a> SomeTable<'a> for ClassDefFormat2<'a>

Source§

fn type_name(&self) -> &str

The name of this table
Source§

fn get_field(&self, idx: usize) -> Option<Field<'a>>

Access this table’s fields, in declaration order.