read_fonts::tables::cmap

Type Alias Cmap

Source
pub type Cmap<'a> = TableRef<'a, CmapMarker>;
Expand description

Aliased Type§

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

Implementations§

Source§

impl<'a> Cmap<'a>

Source

pub fn version(&self) -> u16

Table version number (0).

Source

pub fn num_tables(&self) -> u16

Number of encoding tables that follow.

Source

pub fn encoding_records(&self) -> &'a [EncodingRecord]

Source§

impl<'a> Cmap<'a>

Source

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

Map a codepoint to a nominal glyph identifier

This uses the first available subtable that provides a valid mapping.

§Note:

Mapping logic is currently only implemented for the most common subtable formats.

Source

pub fn closure_glyphs( &self, unicodes: &IntSet<u32>, glyph_set: &mut IntSet<GlyphId>, )

Available on crate feature std only.

Trait Implementations§

Source§

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

Source§

const TAG: Tag = _

cmap