pub struct ColorGlyph<'a> {
glyphs: ColorGlyphs<'a>,
glyph: GlyphId,
root: Root<'a>,
}Expand description
A color glyph, ready to paint through a PaintSink.
Fields§
§glyphs: ColorGlyphs<'a>§glyph: GlyphId§root: Root<'a>Implementations§
Source§impl<'a> ColorGlyph<'a>
impl<'a> ColorGlyph<'a>
Sourcepub fn version(&self) -> ColorGlyphVersion
pub fn version(&self) -> ColorGlyphVersion
Returns the COLR version used to paint this glyph.
Sourcepub fn clip_box(&self) -> Option<BoundingBox<f32>>
pub fn clip_box(&self) -> Option<BoundingBox<f32>>
Returns the clip box for the glyph, in font units at the font’s location, if the table defines one.
Only version 1 tables define clip boxes.
Sourcepub fn paint(&self, sink: &mut impl PaintSink) -> Result<(), Error>
pub fn paint(&self, sink: &mut impl PaintSink) -> Result<(), Error>
Paints the glyph into sink, in font units at the font’s location.
A version 1 glyph is clipped to its clip box, if it has one, and its paint graph is traversed from the root. A version 0 glyph fills each of its layers in order.
Sourcepub fn extents(&self) -> Result<GlyphExtents<f32>, Error>
pub fn extents(&self) -> Result<GlyphExtents<f32>, Error>
Returns the ink bounds of the glyph in font units.
Uses the clip box if the table defines one. Otherwise the glyph is painted and the bounds of its fills are returned. A fill clipped to an outline is measured by the control box of that outline. A glyph that paints nothing has zero extents.
Trait Implementations§
Source§impl<'a> Clone for ColorGlyph<'a>
impl<'a> Clone for ColorGlyph<'a>
Source§fn clone(&self) -> ColorGlyph<'a>
fn clone(&self) -> ColorGlyph<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more