pub(crate) enum Coverage<'a> {
None,
Glyphs(&'a [BigEndian<GlyphId16>]),
Ranges(&'a [RangeRecord]),
Glyphs24(&'a [BigEndian<GlyphId24>]),
Ranges24(&'a [RangeRecord2]),
}Expand description
A coverage table: the glyphs it covers, each with a coverage index.
Variants§
None
A null or unreadable table, which covers nothing.
Glyphs(&'a [BigEndian<GlyphId16>])
Sorted glyphs, each covered at its position.
Ranges(&'a [RangeRecord])
Sorted glyph ranges, each with the index of its first glyph.
Glyphs24(&'a [BigEndian<GlyphId24>])
Sorted 24-bit glyphs.
Ranges24(&'a [RangeRecord2])
Sorted 24-bit glyph ranges.
Implementations§
Source§impl<'a> Coverage<'a>
impl<'a> Coverage<'a>
pub fn new(table: Result<CoverageTable<'a>, ReadError>) -> Self
Sourcepub fn required(table: Result<CoverageTable<'a>, ReadError>) -> Option<Self>
pub fn required(table: Result<CoverageTable<'a>, ReadError>) -> Option<Self>
A coverage that must be present, or None if it can’t be read.
pub fn is_none(&self) -> bool
Sourcepub fn get(&self, gid: impl Into<GlyphId>) -> Option<u32>
pub fn get(&self, gid: impl Into<GlyphId>) -> Option<u32>
The coverage index of gid, if it is covered.
fn get_wide(&self, gid: GlyphId) -> Option<u32>
Sourcepub fn cost(&self) -> u32
pub fn cost(&self) -> u32
The cost of looking up a glyph: the number of bits in the length of the array searched.
pub fn covers(&self, gid: impl Into<GlyphId>) -> bool
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Coverage<'a>
impl<'a> RefUnwindSafe for Coverage<'a>
impl<'a> Send for Coverage<'a>
impl<'a> Sync for Coverage<'a>
impl<'a> Unpin for Coverage<'a>
impl<'a> UnsafeUnpin for Coverage<'a>
impl<'a> UnwindSafe for Coverage<'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