pub struct Colr<'a> { /* private fields */ }Expand description
Implementations§
Source§impl<'a> Colr<'a>
impl<'a> Colr<'a>
Sourcepub fn new(data: &'a [u8]) -> Self
pub fn new(data: &'a [u8]) -> Self
Creates a new color table from a byte slice containing the table data.
Sourcepub fn num_glyphs(&self) -> u16
pub fn num_glyphs(&self) -> u16
Returns the number of glyphs in the table.
Sourcepub fn find_glyph(&self, gid: GlyphId) -> Option<Glyph<'a>>
pub fn find_glyph(&self, gid: GlyphId) -> Option<Glyph<'a>>
Returns the glyph for the specified identifier.
Sourcepub fn glyphs(&self) -> impl Iterator<Item = Glyph<'a>> + 'a + Clone
pub fn glyphs(&self) -> impl Iterator<Item = Glyph<'a>> + 'a + Clone
Returns an iterator over the glyphs in the table.
Sourcepub fn num_base_paints(&self) -> u32
pub fn num_base_paints(&self) -> u32
Returns the number of base paints.
Sourcepub fn base_paint(&self, index: u32) -> Option<(GlyphId, Paint<'a>)>
pub fn base_paint(&self, index: u32) -> Option<(GlyphId, Paint<'a>)>
Returns the glyph identifier and base paint at the specified index.
Sourcepub fn find_base_paint(&self, gid: GlyphId) -> Option<Paint<'a>>
pub fn find_base_paint(&self, gid: GlyphId) -> Option<Paint<'a>>
Returns the base paint for the specified glyph identifier.
Sourcepub fn base_paints(
&self,
) -> impl Iterator<Item = (GlyphId, Paint<'a>)> + 'a + Clone
pub fn base_paints( &self, ) -> impl Iterator<Item = (GlyphId, Paint<'a>)> + 'a + Clone
Returns an iterator over the collection of base paints in the table.
Sourcepub fn num_paint_layers(&self) -> u32
pub fn num_paint_layers(&self) -> u32
Returns the number of paint layers in the table.
Sourcepub fn paint_layer(&self, index: u32) -> Option<Paint<'a>>
pub fn paint_layer(&self, index: u32) -> Option<Paint<'a>>
Returns the paint layer at the specified index.
Sourcepub fn paint_layers(&self) -> impl Iterator<Item = Paint<'a>> + 'a + Clone
pub fn paint_layers(&self) -> impl Iterator<Item = Paint<'a>> + 'a + Clone
Returns an iterator over the paint layers in the table.
Sourcepub fn num_clip_boxes(&self) -> u32
pub fn num_clip_boxes(&self) -> u32
Returns the number of clip boxes in the table.
Sourcepub fn clip_box(&self, index: u32) -> Option<(Range<GlyphId>, ClipBox)>
pub fn clip_box(&self, index: u32) -> Option<(Range<GlyphId>, ClipBox)>
Returns the glyph identifier range and clip box for the specified index.
Sourcepub fn find_clip_box(&self, gid: GlyphId) -> Option<ClipBox>
pub fn find_clip_box(&self, gid: GlyphId) -> Option<ClipBox>
Returns the clip box for the specified glyph identifier.
Sourcepub fn clip_boxes(
&self,
) -> impl Iterator<Item = (Range<GlyphId>, ClipBox)> + 'a + Clone
pub fn clip_boxes( &self, ) -> impl Iterator<Item = (Range<GlyphId>, ClipBox)> + 'a + Clone
Returns an iterator over the clip boxes in the table.
Sourcepub fn var_mapping(&self) -> Option<DeltaSetIndexMap<'a>>
pub fn var_mapping(&self) -> Option<DeltaSetIndexMap<'a>>
Returns the mapping for variation indices.
Sourcepub fn ivs(&self) -> Option<ItemVariationStore<'a>>
pub fn ivs(&self) -> Option<ItemVariationStore<'a>>
Returns the item variation store.