pub struct CompositeGlyph<'a> {
data: FontData<'a>,
}Expand description
Fields§
§data: FontData<'a>Implementations§
Source§impl<'a> CompositeGlyph<'a>
impl<'a> CompositeGlyph<'a>
pub const MIN_SIZE: usize
Sourcepub fn resolve_offset<O: Offset, R: FontRead<'a>>(
&self,
offset: O,
) -> Result<R, ReadError>
pub fn resolve_offset<O: Offset, R: FontRead<'a>>( &self, offset: O, ) -> Result<R, ReadError>
Resolve the provided offset from the start of this table.
Sourcepub fn offset_data(&self) -> FontData<'a>
pub fn offset_data(&self) -> FontData<'a>
Return a reference to this table’s raw data.
We use this in the compile crate to resolve offsets.
Sourcepub fn shape(&self) -> &Self
👎Deprecated: just use the base type directly
pub fn shape(&self) -> &Self
Return a reference to the table’s ‘Shape’ struct.
This is a low level implementation detail, but it can be useful in some cases where you want to know things about a table’s layout, such as the byte offsets of specific fields.
Sourcepub fn number_of_contours(&self) -> i16
pub fn number_of_contours(&self) -> i16
If the number of contours is greater than or equal to zero, this is a simple glyph. If negative, this is a composite glyph — the value -1 should be used for composite glyphs.
Sourcepub fn component_data(&self) -> &'a [u8] ⓘ
pub fn component_data(&self) -> &'a [u8] ⓘ
component flag glyph index of component
pub fn number_of_contours_byte_range(&self) -> Range<usize> ⓘ
pub fn x_min_byte_range(&self) -> Range<usize> ⓘ
pub fn y_min_byte_range(&self) -> Range<usize> ⓘ
pub fn x_max_byte_range(&self) -> Range<usize> ⓘ
pub fn y_max_byte_range(&self) -> Range<usize> ⓘ
pub fn component_data_byte_range(&self) -> Range<usize> ⓘ
Source§impl<'a> CompositeGlyph<'a>
impl<'a> CompositeGlyph<'a>
Sourcepub fn components(&self) -> impl Iterator<Item = Component> + 'a + Clone
pub fn components(&self) -> impl Iterator<Item = Component> + 'a + Clone
Returns an iterator over the components of the composite glyph.
Sourcepub fn component_glyphs_and_flags(
&self,
) -> impl Iterator<Item = (GlyphId16, CompositeGlyphFlags)> + 'a + Clone
pub fn component_glyphs_and_flags( &self, ) -> impl Iterator<Item = (GlyphId16, CompositeGlyphFlags)> + 'a + Clone
Returns an iterator that yields the glyph identifier and flags of each component in the composite glyph.
Sourcepub fn count_and_instructions(&self) -> (usize, Option<&'a [u8]>)
pub fn count_and_instructions(&self) -> (usize, Option<&'a [u8]>)
Returns the component count and TrueType interpreter instructions in a single pass.
Sourcepub fn instructions(&self) -> Option<&'a [u8]>
pub fn instructions(&self) -> Option<&'a [u8]>
Returns the TrueType interpreter instructions.
Trait Implementations§
Source§impl<'a> Clone for CompositeGlyph<'a>
impl<'a> Clone for CompositeGlyph<'a>
Source§fn clone(&self) -> CompositeGlyph<'a>
fn clone(&self) -> CompositeGlyph<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more