pub enum ClassDef<'a> {
Format1(ClassDefFormat1<'a>),
Format2(ClassDefFormat2<'a>),
Format3(ClassDefFormat3<'a>),
Format4(ClassDefFormat4<'a>),
}Expand description
Variants§
Format1(ClassDefFormat1<'a>)
Format2(ClassDefFormat2<'a>)
Format3(ClassDefFormat3<'a>)
Format4(ClassDefFormat4<'a>)
Implementations§
Source§impl<'a> ClassDef<'a>
impl<'a> ClassDef<'a>
Sourcepub fn offset_data(&self) -> FontData<'a>
pub fn offset_data(&self) -> FontData<'a>
Return the FontData used to resolve offsets for this table.
Sourcepub fn class_format(&self) -> u16
pub fn class_format(&self) -> u16
Format identifier — format = 1
Source§impl ClassDef<'_>
impl ClassDef<'_>
Sourcepub fn get(&self, gid: impl Into<GlyphId>) -> u32
pub fn get(&self, gid: impl Into<GlyphId>) -> u32
Gets the class without narrowing 24-bit class values.
fn get_wide(&self, gid: GlyphId) -> u32
Sourcepub fn iter(&self) -> impl Iterator<Item = (GlyphId, u32)> + '_
pub fn iter(&self) -> impl Iterator<Item = (GlyphId, u32)> + '_
Iterates over explicitly assigned glyphs and classes.
Sourcepub fn population(&self) -> usize
pub fn population(&self) -> usize
Return the number of glyphs explicitly assigned to a class in this table
Sourcepub fn intersect_classes(&self, glyphs: &IntSet<GlyphId>) -> IntSet<u32>
pub fn intersect_classes(&self, glyphs: &IntSet<GlyphId>) -> IntSet<u32>
Returns class values for the intersected glyphs of this table and input ‘glyphs’ set.
Sourcepub fn intersected_class_glyphs(
&self,
glyphs: &IntSet<GlyphId>,
class: u32,
) -> IntSet<GlyphId>
pub fn intersected_class_glyphs( &self, glyphs: &IntSet<GlyphId>, class: u32, ) -> IntSet<GlyphId>
Returns intersected glyphs of this table and input ‘glyphs’ set that are assigned to input class value.
Sourcepub fn intersects_class_glyphs(
&self,
glyphs: &IntSet<GlyphId>,
class: u32,
) -> bool
pub fn intersects_class_glyphs( &self, glyphs: &IntSet<GlyphId>, class: u32, ) -> bool
Checks whether any glyph in the given glyphs set intersects with this table and is assigned to the specified class value.
fn wide_class_ranges( &self, ) -> impl Iterator<Item = (RangeInclusive<GlyphId>, u32)> + '_
Trait Implementations§
Source§impl<'a> FontRead<'a> for ClassDef<'a>
impl<'a> FontRead<'a> for ClassDef<'a>
Source§impl<'a> MinByteRange<'a> for ClassDef<'a>
impl<'a> MinByteRange<'a> for ClassDef<'a>
Auto Trait Implementations§
impl<'a> Freeze for ClassDef<'a>
impl<'a> RefUnwindSafe for ClassDef<'a>
impl<'a> Send for ClassDef<'a>
impl<'a> Sync for ClassDef<'a>
impl<'a> Unpin for ClassDef<'a>
impl<'a> UnsafeUnpin for ClassDef<'a>
impl<'a> UnwindSafe for ClassDef<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more