pub type Cmap4<'a> = TableRef<'a, Cmap4Marker>;
Expand description
cmap Format 4: Segment mapping to delta values
Aliased Type§
pub struct Cmap4<'a> {
pub(crate) shape: Cmap4Marker,
pub(crate) data: FontData<'a>,
}
Fields§
§shape: Cmap4Marker
§data: FontData<'a>
Implementations§
Source§impl<'a> Cmap4<'a>
impl<'a> Cmap4<'a>
Sourcepub fn language(&self) -> u16
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.
Sourcepub fn seg_count_x2(&self) -> u16
pub fn seg_count_x2(&self) -> u16
2 × segCount.
Sourcepub fn search_range(&self) -> u16
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)
Sourcepub fn entry_selector(&self) -> u16
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)))
Sourcepub fn range_shift(&self) -> u16
pub fn range_shift(&self) -> u16
segCount times 2, minus searchRange ((segCount * 2) - searchRange)
Sourcepub fn end_code(&self) -> &'a [BigEndian<u16>]
pub fn end_code(&self) -> &'a [BigEndian<u16>]
End characterCode for each segment, last=0xFFFF.
Sourcepub fn start_code(&self) -> &'a [BigEndian<u16>]
pub fn start_code(&self) -> &'a [BigEndian<u16>]
Start character code for each segment.
Sourcepub fn id_range_offsets(&self) -> &'a [BigEndian<u16>]
pub fn id_range_offsets(&self) -> &'a [BigEndian<u16>]
Offsets into glyphIdArray or 0
Sourcepub fn glyph_id_array(&self) -> &'a [BigEndian<u16>]
pub fn glyph_id_array(&self) -> &'a [BigEndian<u16>]
Glyph index array (arbitrary length)
Source§impl<'a> Cmap4<'a>
impl<'a> Cmap4<'a>
Sourcepub fn map_codepoint(&self, codepoint: impl Into<u32>) -> Option<GlyphId>
pub fn map_codepoint(&self, codepoint: impl Into<u32>) -> Option<GlyphId>
Maps a codepoint to a nominal glyph identifier.
Sourcepub fn iter(&self) -> Cmap4Iter<'a> ⓘ
pub fn iter(&self) -> Cmap4Iter<'a> ⓘ
Returns an iterator over all (codepoint, glyph identifier) pairs in the subtable.