read_fonts::tables::cpal

Type Alias Cpal

Source
pub type Cpal<'a> = TableRef<'a, CpalMarker>;
Expand description

Aliased Type§

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

Implementations§

Source§

impl<'a> Cpal<'a>

Source

pub fn version(&self) -> u16

Table version number (=0).

Source

pub fn num_palette_entries(&self) -> u16

Number of palette entries in each palette.

Source

pub fn num_palettes(&self) -> u16

Number of palettes in the table.

Source

pub fn num_color_records(&self) -> u16

Total number of color records, combined for all palettes.

Source

pub fn color_records_array_offset(&self) -> Nullable<Offset32>

Offset from the beginning of CPAL table to the first ColorRecord.

Source

pub fn color_records_array( &self, ) -> Option<Result<&'a [ColorRecord], ReadError>>

Attempt to resolve color_records_array_offset.

Source

pub fn color_record_indices(&self) -> &'a [BigEndian<u16>]

Index of each palette’s first color record in the combined color record array.

Source

pub fn palette_types_array_offset(&self) -> Option<Nullable<Offset32>>

Offset from the beginning of CPAL table to the Palette Types Array.

This is an array of 32-bit flag fields that describe properties of each palette.

Source

pub fn palette_types_array( &self, ) -> Option<Result<&'a [BigEndian<PaletteType>], ReadError>>

Attempt to resolve palette_types_array_offset.

Source

pub fn palette_labels_array_offset(&self) -> Option<Nullable<Offset32>>

Offset from the beginning of CPAL table to the Palette Labels Array.

This is an array of ‘name’ table IDs (typically in the font-specific name ID range) that specify user interface strings associated with each palette. Use 0xFFFF if no name ID is provided for a palette.

Source

pub fn palette_labels_array( &self, ) -> Option<Result<&'a [BigEndian<u16>], ReadError>>

Attempt to resolve palette_labels_array_offset.

Source

pub fn palette_entry_labels_array_offset(&self) -> Option<Nullable<Offset32>>

Offset from the beginning of CPAL table to the Palette Entry Labels Array.

This is an array of ‘name’ table IDs (typically in the font-specific name ID range) that specify user interface strings associated with each palette entry, e.g. “Outline”, “Fill”. This set of palette entry labels applies to all palettes in the font. Use 0xFFFF if no name ID is provided for a palette entry.

Source

pub fn palette_entry_labels_array( &self, ) -> Option<Result<&'a [BigEndian<NameId>], ReadError>>

Trait Implementations§

Source§

impl<'a> FontRead<'a> for Cpal<'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 TopLevelTable for Cpal<'_>

Source§

const TAG: Tag = _

CPAL