Skip to main content

FontReadAt

Trait FontReadAt 

Source
pub trait FontReadAt<'a>: Sized + ReadArgs {
    // Required method
    fn read_at(
        data: FontData<'a>,
        offset: usize,
        args: Self::Args,
    ) -> Result<Self, ReadError>;
}
Expand description

A trait for types that are read at a position within enclosing data.

FontRead receives data already sliced to the start of the item, which discards everything before it. That is the wrong shape for an item holding offsets that resolve relative to the enclosing table rather than to the item itself: a GPOS value record’s device offsets are measured from the start of the table containing the record. Such a type is given the enclosing data and its own position within it, and keeps both.

You should not generally need to call this directly; it is intended to be used from generated code.

Required Methods§

Source

fn read_at( data: FontData<'a>, offset: usize, args: Self::Args, ) -> Result<Self, ReadError>

Read an item positioned at offset bytes into data.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<'a> FontReadAt<'a> for BaseRecord2<'a>

Source§

impl<'a> FontReadAt<'a> for BaseRecord<'a>

Source§

impl<'a> FontReadAt<'a> for Class1Record<'a>

Source§

impl<'a> FontReadAt<'a> for Class2Record<'a>

Source§

impl<'a> FontReadAt<'a> for ComponentRecord2<'a>

Source§

impl<'a> FontReadAt<'a> for ComponentRecord<'a>

Source§

impl<'a> FontReadAt<'a> for DeviceRecord<'a>

Source§

impl<'a> FontReadAt<'a> for InstanceRecord<'a>

Source§

impl<'a> FontReadAt<'a> for Mark2Record2<'a>

Source§

impl<'a> FontReadAt<'a> for Mark2Record<'a>

Source§

impl<'a> FontReadAt<'a> for PairValueRecord2<'a>

Source§

impl<'a> FontReadAt<'a> for PairValueRecord<'a>

Source§

impl<'a> FontReadAt<'a> for Tuple<'a>

Source§

impl<'a> FontReadAt<'a> for U16Or32

Source§

impl<'a> FontReadAt<'a> for ValueRecord<'a>

Source§

impl<'a> FontReadAt<'a> for VariationRegion<'a>