Type Alias read_fonts::tables::cmap::Cmap4

source ·
pub type Cmap4<'a> = TableRef<'a, Cmap4Marker>;
Expand description

cmap Format 4: Segment mapping to delta values

Aliased Type§

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

Implementations§

source§

impl<'a> Cmap4<'a>

source

pub fn format(&self) -> u16

Format number is set to 4.

source

pub fn length(&self) -> u16

This is the length in bytes of the subtable.

source

pub fn language(&self) -> u16

For requirements on use of the language field, see “Use of the language field in ‘cmap’ subtables” in this document.

source

pub fn seg_count_x2(&self) -> u16

2 × segCount.

source

pub fn search_range(&self) -> u16

Maximum power of 2 less than or equal to segCount, times 2 ((2floor(log2(segCount))) * 2, where “” is an exponentiation operator)

source

pub fn entry_selector(&self) -> u16

Log2 of the maximum power of 2 less than or equal to numTables (log2(searchRange/2), which is equal to floor(log2(segCount)))

source

pub fn range_shift(&self) -> u16

segCount times 2, minus searchRange ((segCount * 2) - searchRange)

source

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

End characterCode for each segment, last=0xFFFF.

source

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

Start character code for each segment.

source

pub fn id_delta(&self) -> &'a [BigEndian<i16>]

Delta for all character codes in segment.

source

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

Offsets into glyphIdArray or 0

source

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

Glyph index array (arbitrary length)

source§

impl<'a> Cmap4<'a>

source

pub fn map_codepoint(&self, codepoint: impl Into<u32>) -> Option<GlyphId>

Maps a codepoint to a nominal glyph identifier.

source

pub fn iter(&self) -> Cmap4Iter<'a>

Returns an iterator over all (codepoint, glyph identifier) pairs in the subtable.

Trait Implementations§

source§

impl<'a> Debug for Cmap4<'a>

source§

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

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

impl<'a> FontRead<'a> for Cmap4<'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 Cmap4<'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.