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.
Sourcefn clip_box_for_extents(&self) -> Option<BoundingBox<f32>>
fn clip_box_for_extents(&self) -> Option<BoundingBox<f32>>
Returns the clip box used by extents, with
variation deltas rounded to whole units as in HarfBuzz.
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.
Sourcefn paint_dyn(&self, sink: &mut dyn PaintSink) -> Result<(), Error>
fn paint_dyn(&self, sink: &mut dyn PaintSink) -> Result<(), Error>
Calls paint through a trait object, so the traversal
is compiled once instead of once per sink type.
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.
Sourcefn extents_with(
&self,
outlines: OutlineGlyphs<'a>,
) -> Result<GlyphExtents<f32>, Error>
fn extents_with( &self, outlines: OutlineGlyphs<'a>, ) -> Result<GlyphExtents<f32>, Error>
extents, measuring clip glyphs in outlines.
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