read_fonts::tables::glyf

Type Alias CompositeGlyph

Source
pub type CompositeGlyph<'a> = TableRef<'a, CompositeGlyphMarker>;
Expand description

Aliased Type§

struct CompositeGlyph<'a> { /* private fields */ }

Implementations§

Source§

impl<'a> CompositeGlyph<'a>

Source

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.

Source

pub fn x_min(&self) -> i16

Minimum x for coordinate data.

Source

pub fn y_min(&self) -> i16

Minimum y for coordinate data.

Source

pub fn x_max(&self) -> i16

Maximum x for coordinate data.

Source

pub fn y_max(&self) -> i16

Maximum y for coordinate data.

Source

pub fn component_data(&self) -> &'a [u8]

component flag glyph index of component

Source§

impl<'a> CompositeGlyph<'a>

Source

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

Returns an iterator over the components of the composite glyph.

Source

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.

Source

pub fn count_and_instructions(&self) -> (usize, Option<&'a [u8]>)

Returns the component count and TrueType interpreter instructions in a single pass.

Source

pub fn instructions(&self) -> Option<&'a [u8]>

Returns the TrueType interpreter instructions.

Source§

impl<'a, T> TableRef<'a, T>

Source

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.

Source

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.

Source

pub fn shape(&self) -> &T

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.

Trait Implementations§

Source§

impl<'a> FontRead<'a> for CompositeGlyph<'a>

Source§

fn read(data: FontData<'a>) -> Result<Self, ReadError>

Read an instance of Self from the provided data, performing validation. Read more
Source§

impl<'a, T: Clone> Clone for TableRef<'a, T>

Source§

fn clone(&self) -> TableRef<'a, T>

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

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

Performs copy-assignment from source. Read more