Colr

Struct Colr 

Source
pub struct Colr<'a> { /* private fields */ }
Expand description

Implementations§

Source§

impl<'a> Colr<'a>

Source

pub fn new(data: &'a [u8]) -> Self

Creates a new color table from a byte slice containing the table data.

Source

pub fn version(&self) -> u16

Returns the version of the table.

Source

pub fn num_glyphs(&self) -> u16

Returns the number of glyphs in the table.

Source

pub fn glyph(&self, index: u16) -> Option<Glyph<'a>>

Returns the glyph at the specified index.

Source

pub fn find_glyph(&self, gid: GlyphId) -> Option<Glyph<'a>>

Returns the glyph for the specified identifier.

Source

pub fn glyphs(&self) -> impl Iterator<Item = Glyph<'a>> + 'a + Clone

Returns an iterator over the glyphs in the table.

Source

pub fn num_base_paints(&self) -> u32

Returns the number of base paints.

Source

pub fn base_paint(&self, index: u32) -> Option<(GlyphId, Paint<'a>)>

Returns the glyph identifier and base paint at the specified index.

Source

pub fn find_base_paint(&self, gid: GlyphId) -> Option<Paint<'a>>

Returns the base paint for the specified glyph identifier.

Source

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.

Source

pub fn num_paint_layers(&self) -> u32

Returns the number of paint layers in the table.

Source

pub fn paint_layer(&self, index: u32) -> Option<Paint<'a>>

Returns the paint layer at the specified index.

Source

pub fn paint_layers(&self) -> impl Iterator<Item = Paint<'a>> + 'a + Clone

Returns an iterator over the paint layers in the table.

Source

pub fn num_clip_boxes(&self) -> u32

Returns the number of clip boxes in the table.

Source

pub fn clip_box(&self, index: u32) -> Option<(Range<GlyphId>, ClipBox)>

Returns the glyph identifier range and clip box for the specified index.

Source

pub fn find_clip_box(&self, gid: GlyphId) -> Option<ClipBox>

Returns the clip box for the specified glyph identifier.

Source

pub fn clip_boxes( &self, ) -> impl Iterator<Item = (Range<GlyphId>, ClipBox)> + 'a + Clone

Returns an iterator over the clip boxes in the table.

Source

pub fn var_mapping(&self) -> Option<DeltaSetIndexMap<'a>>

Returns the mapping for variation indices.

Source

pub fn ivs(&self) -> Option<ItemVariationStore<'a>>

Returns the item variation store.

Trait Implementations§

Source§

impl<'a> Clone for Colr<'a>

Source§

fn clone(&self) -> Colr<'a>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Copy for Colr<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for Colr<'a>

§

impl<'a> RefUnwindSafe for Colr<'a>

§

impl<'a> Send for Colr<'a>

§

impl<'a> Sync for Colr<'a>

§

impl<'a> Unpin for Colr<'a>

§

impl<'a> UnwindSafe for Colr<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.