Type Alias Index2

Source
pub type Index2<'a> = TableRef<'a, Index2Marker>;
Expand description

An array of variable-sized objects in a CFF2 table.

Aliased Type§

pub struct Index2<'a> {
    pub(crate) shape: Index2Marker,
    pub(crate) data: FontData<'a>,
}

Fields§

§shape: Index2Marker§data: FontData<'a>

Implementations§

Source§

impl<'a> Index2<'a>

Source

pub fn size_in_bytes(&self) -> Result<usize, ReadError>

Returns the total size in bytes of the index table.

Source

pub fn get_offset(&self, index: usize) -> Result<usize, Error>

Returns the offset of the object at the given index.

Source

pub fn get(&self, index: usize) -> Result<&'a [u8], Error>

Returns the data for the object at the given index.

Source§

impl<'a> Index2<'a>

Source

pub fn count(&self) -> u32

Number of objects stored in INDEX.

Source

pub fn off_size(&self) -> u8

Object array element size.

Source

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

Bytes containing count + 1 offsets each of off_size.

Source

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

Array containing the object data.

Trait Implementations§

Source§

impl<'a> Debug for Index2<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> FontRead<'a> for Index2<'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> SomeTable<'a> for Index2<'a>

Source§

fn type_name(&self) -> &str

The name of this table
Source§

fn get_field(&self, idx: usize) -> Option<Field<'a>>

Access this table’s fields, in declaration order.