Type Alias ClassDefFormat1

Source
pub type ClassDefFormat1<'a> = TableRef<'a, ClassDefFormat1Marker>;
Expand description

Aliased Type§

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

Fields§

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

Implementations§

Source§

impl<'a> ClassDefFormat1<'a>

Source

pub fn class_format(&self) -> u16

Format identifier — format = 1

Source

pub fn start_glyph_id(&self) -> GlyphId16

First glyph ID of the classValueArray

Source

pub fn glyph_count(&self) -> u16

Size of the classValueArray

Source

pub fn class_value_array(&self) -> &'a [BigEndian<u16>]

Array of Class Values — one per glyph ID

Source§

impl<'a> ClassDefFormat1<'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 assigned to input class value.

Trait Implementations§

Source§

impl<'a> Debug for ClassDefFormat1<'a>

Source§

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

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

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

Source§

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

Source§

impl<'a> SomeTable<'a> for ClassDefFormat1<'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.