pub type Cmap<'a> = TableRef<'a, CmapMarker>;
Expand description
Aliased Type§
pub struct Cmap<'a> {
pub(crate) shape: CmapMarker,
pub(crate) data: FontData<'a>,
}
Fields§
§shape: CmapMarker
§data: FontData<'a>
Implementations§
Source§impl<'a> Cmap<'a>
impl<'a> Cmap<'a>
Sourcepub fn num_tables(&self) -> u16
pub fn num_tables(&self) -> u16
Number of encoding tables that follow.
pub fn encoding_records(&self) -> &'a [EncodingRecord]
Source§impl<'a> Cmap<'a>
impl<'a> Cmap<'a>
Sourcepub fn map_codepoint(&self, codepoint: impl Into<u32>) -> Option<GlyphId>
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.
Sourcepub fn best_subtable(&self) -> Option<(u16, EncodingRecord, CmapSubtable<'a>)>
pub fn best_subtable(&self) -> Option<(u16, EncodingRecord, CmapSubtable<'a>)>
Returns the index, encoding record and subtable for the most comprehensive mapping available.
Comprehensive means that tables capable of mapping the Unicode full repertoire are chosen over those that only support the basic multilingual plane. The exception is that symbol mappings are preferred above all others (see https://github.com/harfbuzz/harfbuzz/issues/1918).
Sourcepub fn uvs_subtable(&self) -> Option<(u16, Cmap14<'a>)>
pub fn uvs_subtable(&self) -> Option<(u16, Cmap14<'a>)>
Returns the index and subtable for the first mapping capable of handling Unicode variation sequences.
This is always a format 14 subtable.
Sourcepub fn subtable(&self, index: u16) -> Result<CmapSubtable<'a>, ReadError>
pub fn subtable(&self, index: u16) -> Result<CmapSubtable<'a>, ReadError>
Returns the subtable at the given index.