Struct owned_ttf_parser::colr::Table
source · pub struct Table<'a> {Show 13 fields
pub(crate) palettes: Table<'a>,
data: &'a [u8],
version: u8,
base_glyphs: LazyArray16<'a, BaseGlyphRecord>,
layers: LazyArray16<'a, LayerRecord>,
base_glyph_paints_offset: Offset32,
base_glyph_paints: LazyArray32<'a, BaseGlyphPaintRecord>,
layer_paint_offsets_offset: Offset32,
layer_paint_offsets: LazyArray32<'a, Offset32>,
clip_list_offsets_offset: Offset32,
clip_list: ClipList<'a>,
var_index_map: Option<DeltaSetIndexMap<'a>>,
item_variation_store: Option<ItemVariationStore<'a>>,
}
Expand description
A Color Table.
Currently, only version 0 is supported.
Fields§
§palettes: Table<'a>
§data: &'a [u8]
§version: u8
§base_glyphs: LazyArray16<'a, BaseGlyphRecord>
§layers: LazyArray16<'a, LayerRecord>
§base_glyph_paints_offset: Offset32
§base_glyph_paints: LazyArray32<'a, BaseGlyphPaintRecord>
§layer_paint_offsets_offset: Offset32
§layer_paint_offsets: LazyArray32<'a, Offset32>
§clip_list_offsets_offset: Offset32
§clip_list: ClipList<'a>
§var_index_map: Option<DeltaSetIndexMap<'a>>
§item_variation_store: Option<ItemVariationStore<'a>>
Implementations§
source§impl<'a> Table<'a>
impl<'a> Table<'a>
sourcepub fn parse(palettes: Table<'a>, data: &'a [u8]) -> Option<Table<'a>>
pub fn parse(palettes: Table<'a>, data: &'a [u8]) -> Option<Table<'a>>
Parses a table from raw data.
sourcepub fn is_simple(&self) -> bool
pub fn is_simple(&self) -> bool
Returns true
if the current table has version 0.
A simple table can only emit outline_glyph
and paint
Painter
methods.
sourcepub fn contains(&self, glyph_id: GlyphId) -> bool
pub fn contains(&self, glyph_id: GlyphId) -> bool
Whether the table contains a definition for the given glyph.
Trait Implementations§
impl<'a> Copy for Table<'a>
Auto Trait Implementations§
impl<'a> Freeze for Table<'a>
impl<'a> RefUnwindSafe for Table<'a>
impl<'a> Send for Table<'a>
impl<'a> Sync for Table<'a>
impl<'a> Unpin for Table<'a>
impl<'a> UnwindSafe for Table<'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