read_fonts::tables::aat

Type Alias Lookup4

Source
pub type Lookup4<'a> = TableRef<'a, Lookup4Marker>;
Expand description

Segment array format. A segment mapping is performed (as with Format 2), but instead of a single lookup value for all the glyphs in the segment, each glyph in the segment gets its own separate lookup value.

Aliased Type§

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

Implementations§

Source§

impl<'a> Lookup4<'a>

Source

pub fn format(&self) -> u16

Format number is set to 4.

Source

pub fn unit_size(&self) -> u16

Size of a lookup unit for this search in bytes.

Source

pub fn n_units(&self) -> u16

Number of units of the preceding size to be searched.

Source

pub fn search_range(&self) -> u16

The value of unitSize times the largest power of 2 that is less than or equal to the value of nUnits.

Source

pub fn entry_selector(&self) -> u16

The log base 2 of the largest power of 2 less than or equal to the value of nUnits.

Source

pub fn range_shift(&self) -> u16

The value of unitSize times the difference of the value of nUnits minus the largest power of 2 less than or equal to the value of nUnits.

Source

pub fn segments(&self) -> &'a [LookupSegment4]

Segments.

Source§

impl Lookup4<'_>

Source

pub fn value<T: LookupValue>(&self, index: u16) -> Result<T, ReadError>

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 Lookup4<'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