pub type Colr<'a> = TableRef<'a, ColrMarker>;
Expand description
COLR (Color) table
Aliased Type§
struct Colr<'a> { /* private fields */ }
Implementations§
Source§impl Colr<'_>
impl Colr<'_>
pub fn v0_closure_palette_indices( &self, glyph_set: &IntSet<GlyphId>, palette_indices: &mut IntSet<u16>, )
std
only.Sourcepub fn v1_closure(
&self,
glyph_set: &mut IntSet<GlyphId>,
layer_indices: &mut IntSet<u32>,
palette_indices: &mut IntSet<u16>,
variation_indices: &mut IntSet<u32>,
delta_set_indices: &mut IntSet<u32>,
)
Available on crate feature std
only.
pub fn v1_closure( &self, glyph_set: &mut IntSet<GlyphId>, layer_indices: &mut IntSet<u32>, palette_indices: &mut IntSet<u16>, variation_indices: &mut IntSet<u32>, delta_set_indices: &mut IntSet<u32>, )
std
only.Collect the transitive closure of v1 glyphs,layer/paletted indices and variation/delta set indices for COLRv1
Source§impl<'a> Colr<'a>
impl<'a> Colr<'a>
Sourcepub fn num_base_glyph_records(&self) -> u16
pub fn num_base_glyph_records(&self) -> u16
Number of BaseGlyph records; may be 0 in a version 1 table.
Sourcepub fn base_glyph_records_offset(&self) -> Nullable<Offset32>
pub fn base_glyph_records_offset(&self) -> Nullable<Offset32>
Offset to baseGlyphRecords array (may be NULL).
Sourcepub fn base_glyph_records(&self) -> Option<Result<&'a [BaseGlyph], ReadError>>
pub fn base_glyph_records(&self) -> Option<Result<&'a [BaseGlyph], ReadError>>
Attempt to resolve base_glyph_records_offset
.
Sourcepub fn layer_records_offset(&self) -> Nullable<Offset32>
pub fn layer_records_offset(&self) -> Nullable<Offset32>
Offset to layerRecords array (may be NULL).
Sourcepub fn layer_records(&self) -> Option<Result<&'a [Layer], ReadError>>
pub fn layer_records(&self) -> Option<Result<&'a [Layer], ReadError>>
Attempt to resolve layer_records_offset
.
Sourcepub fn num_layer_records(&self) -> u16
pub fn num_layer_records(&self) -> u16
Number of Layer records; may be 0 in a version 1 table.
Sourcepub fn base_glyph_list_offset(&self) -> Option<Nullable<Offset32>>
pub fn base_glyph_list_offset(&self) -> Option<Nullable<Offset32>>
Offset to BaseGlyphList table.
Sourcepub fn base_glyph_list(&self) -> Option<Result<BaseGlyphList<'a>, ReadError>>
pub fn base_glyph_list(&self) -> Option<Result<BaseGlyphList<'a>, ReadError>>
Attempt to resolve base_glyph_list_offset
.
Sourcepub fn layer_list_offset(&self) -> Option<Nullable<Offset32>>
pub fn layer_list_offset(&self) -> Option<Nullable<Offset32>>
Offset to LayerList table (may be NULL).
Sourcepub fn layer_list(&self) -> Option<Result<LayerList<'a>, ReadError>>
pub fn layer_list(&self) -> Option<Result<LayerList<'a>, ReadError>>
Attempt to resolve layer_list_offset
.
Sourcepub fn clip_list_offset(&self) -> Option<Nullable<Offset32>>
pub fn clip_list_offset(&self) -> Option<Nullable<Offset32>>
Offset to ClipList table (may be NULL).
Sourcepub fn clip_list(&self) -> Option<Result<ClipList<'a>, ReadError>>
pub fn clip_list(&self) -> Option<Result<ClipList<'a>, ReadError>>
Attempt to resolve clip_list_offset
.
Sourcepub fn var_index_map_offset(&self) -> Option<Nullable<Offset32>>
pub fn var_index_map_offset(&self) -> Option<Nullable<Offset32>>
Offset to DeltaSetIndexMap table (may be NULL).
Sourcepub fn var_index_map(&self) -> Option<Result<DeltaSetIndexMap<'a>, ReadError>>
pub fn var_index_map(&self) -> Option<Result<DeltaSetIndexMap<'a>, ReadError>>
Attempt to resolve var_index_map_offset
.
Sourcepub fn item_variation_store_offset(&self) -> Option<Nullable<Offset32>>
pub fn item_variation_store_offset(&self) -> Option<Nullable<Offset32>>
Offset to ItemVariationStore (may be NULL).
Sourcepub fn item_variation_store(
&self,
) -> Option<Result<ItemVariationStore<'a>, ReadError>>
pub fn item_variation_store( &self, ) -> Option<Result<ItemVariationStore<'a>, ReadError>>
Attempt to resolve item_variation_store_offset
.
Source§impl<'a> Colr<'a>
impl<'a> Colr<'a>
Sourcepub fn v0_base_glyph(
&self,
glyph_id: GlyphId,
) -> Result<Option<Range<usize>>, ReadError>
pub fn v0_base_glyph( &self, glyph_id: GlyphId, ) -> Result<Option<Range<usize>>, ReadError>
Returns the COLRv0 base glyph for the given glyph identifier.
The return value is a range of layer indices that can be passed to
v0_layer
to retrieve the layer glyph identifiers
and palette color indices.
Sourcepub fn v0_layer(&self, index: usize) -> Result<(GlyphId16, u16), ReadError>
pub fn v0_layer(&self, index: usize) -> Result<(GlyphId16, u16), ReadError>
Returns the COLRv0 layer at the given index.
The layer is represented by a tuple containing the glyph identifier of the associated outline and the palette color index.
Sourcepub fn v1_base_glyph(
&self,
glyph_id: GlyphId,
) -> Result<Option<(Paint<'a>, PaintId)>, ReadError>
pub fn v1_base_glyph( &self, glyph_id: GlyphId, ) -> Result<Option<(Paint<'a>, PaintId)>, ReadError>
Returns the COLRv1 base glyph for the given glyph identifier.
The second value in the tuple is a unique identifier for the paint that may be used to detect recursion in the paint graph.