pub struct Cmap4<'a> {
data: FontData<'a>,
}Expand description
cmap Format 4: Segment mapping to delta values
Fields§
§data: FontData<'a>Implementations§
Source§impl<'a> Cmap4<'a>
impl<'a> Cmap4<'a>
pub const MIN_SIZE: usize
Sourcepub fn resolve_offset<O: Offset, R: FontRead<'a>>(
&self,
offset: O,
) -> Result<R, ReadError>
pub fn resolve_offset<O: Offset, R: FontRead<'a>>( &self, offset: O, ) -> Result<R, ReadError>
Resolve the provided offset from the start of this table.
Sourcepub fn offset_data(&self) -> FontData<'a>
pub fn offset_data(&self) -> FontData<'a>
Return a reference to this table’s raw data.
We use this in the compile crate to resolve offsets.
Sourcepub fn shape(&self) -> &Self
👎Deprecated: just use the base type directly
pub fn shape(&self) -> &Self
Return a reference to the table’s ‘Shape’ struct.
This is a low level implementation detail, but it can be useful in some cases where you want to know things about a table’s layout, such as the byte offsets of specific fields.
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)
pub fn format_byte_range(&self) -> Range<usize> ⓘ
pub fn length_byte_range(&self) -> Range<usize> ⓘ
pub fn language_byte_range(&self) -> Range<usize> ⓘ
pub fn seg_count_x2_byte_range(&self) -> Range<usize> ⓘ
pub fn search_range_byte_range(&self) -> Range<usize> ⓘ
pub fn entry_selector_byte_range(&self) -> Range<usize> ⓘ
pub fn range_shift_byte_range(&self) -> Range<usize> ⓘ
pub fn end_code_byte_range(&self) -> Range<usize> ⓘ
pub fn reserved_pad_byte_range(&self) -> Range<usize> ⓘ
pub fn start_code_byte_range(&self) -> Range<usize> ⓘ
pub fn id_delta_byte_range(&self) -> Range<usize> ⓘ
pub fn id_range_offsets_byte_range(&self) -> Range<usize> ⓘ
pub fn glyph_id_array_byte_range(&self) -> Range<usize> ⓘ
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.