CharacterToGlyphMap
struct · ferroui-base · v0.5.0
struct CharacterToGlyphMap
Maps Unicode code points to glyph indices using the font's cmap table.
A cheap handle: cloning shares the underlying subtable. The default value maps nothing. Lookups never allocate.
Members
format
fn format(self: &Self) -> CmapFormat
The format of the subtable the map reads.
get_glyph
fn get_glyph(self: &Self, code_point: i32) -> u16
The glyph for the code point, 0 when it is not mapped (the reference's
indexer and GetGlyph).
contains_glyph
fn contains_glyph(self: &Self, code_point: i32) -> bool
get_glyphs
fn get_glyphs(self: &Self, code_points: &[i32], glyph_ids: &mut [u16])
Maps every code point to its glyph (0 when unmapped).
Panics when glyph_ids is shorter than code_points.
try_get_glyph
fn try_get_glyph(self: &Self, code_point: i32) -> Option<u16>
The glyph for the code point; None when it is not mapped or maps to
glyph 0.
get_mapped_ranges
fn get_mapped_ranges(self: &Self) -> CodepointRangeEnumerator
Enumerates the code point ranges the map covers.
as_read_only_dictionary
fn as_read_only_dictionary(self: &Self) -> CharacterToGlyphMapDictionary
A dictionary view (code point to glyph) of the map.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeClassDefaultsBorrow<T>BorrowMut<T>CloneToUninitInto<U>From<T>TryInto<U>TryFrom<U>AnyToOwnedErasedDestructorIntoEitherCloneDefault
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.