pub struct ColorGlyphs<'a> {
font: &'a Font,
tables: Option<&'a ColrTables<'a>>,
}Expand description
Provides access to the color glyphs in a font.
Glyphs are painted at the location of the font. This type is cheap to create and copy because it borrows tables that the font has already parsed.
Fields§
§font: &'a Font§tables: Option<&'a ColrTables<'a>>Implementations§
Source§impl<'a> ColorGlyphs<'a>
impl<'a> ColorGlyphs<'a>
Sourcepub fn version(&self) -> Option<u16>
pub fn version(&self) -> Option<u16>
Returns the version of the COLR table, or None if the font has no
COLR table.
Sourcepub fn get_with_version(
&self,
glyph: GlyphId,
version: ColorGlyphVersion,
) -> Option<ColorGlyph<'a>>
pub fn get_with_version( &self, glyph: GlyphId, version: ColorGlyphVersion, ) -> Option<ColorGlyph<'a>>
Returns the color glyph for glyph painted with the given version
of COLR, if the table has one.
Sourcepub fn get(&self, glyph: GlyphId) -> Option<ColorGlyph<'a>>
pub fn get(&self, glyph: GlyphId) -> Option<ColorGlyph<'a>>
Returns the color glyph for glyph.
Uses version 1 of the table if it has the glyph, and version 0 otherwise.
Trait Implementations§
Source§impl<'a> Clone for ColorGlyphs<'a>
impl<'a> Clone for ColorGlyphs<'a>
Source§fn clone(&self) -> ColorGlyphs<'a>
fn clone(&self) -> ColorGlyphs<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<'a> Copy for ColorGlyphs<'a>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for ColorGlyphs<'a>
impl<'a> !UnwindSafe for ColorGlyphs<'a>
impl<'a> Freeze for ColorGlyphs<'a>
impl<'a> Send for ColorGlyphs<'a>
impl<'a> Sync for ColorGlyphs<'a>
impl<'a> Unpin for ColorGlyphs<'a>
impl<'a> UnsafeUnpin for ColorGlyphs<'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