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> Debug for Cpal<'a>

source§

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

Formats the value using the given formatter. Read more
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<'a> SomeTable<'a> for Cpal<'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.
source§

impl TopLevelTable for Cpal<'_>

source§

const TAG: Tag = _

CPAL