pub struct Subtable<'a> {
data: FontData<'a>,
}Expand description
A subtable in a kerx table.
Fields§
§data: FontData<'a>Implementations§
Source§impl<'a> Subtable<'a>
impl<'a> Subtable<'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 tuple_count(&self) -> u32
pub fn tuple_count(&self) -> u32
The tuple count. This value is only used with variation fonts and should be 0 for all other fonts. The subtable’s tupleCount will be ignored if the ‘kerx’ table version is less than 4.
pub fn length_byte_range(&self) -> Range<usize> ⓘ
pub fn coverage_byte_range(&self) -> Range<usize> ⓘ
pub fn tuple_count_byte_range(&self) -> Range<usize> ⓘ
pub fn data_byte_range(&self) -> Range<usize> ⓘ
Source§impl<'a> Subtable<'a>
impl<'a> Subtable<'a>
pub const HEADER_LEN: usize
Sourcepub fn is_vertical(&self) -> bool
pub fn is_vertical(&self) -> bool
True if the table has vertical kerning values.
Sourcepub fn is_horizontal(&self) -> bool
pub fn is_horizontal(&self) -> bool
True if the table has horizontal kerning values.
Sourcepub fn is_cross_stream(&self) -> bool
pub fn is_cross_stream(&self) -> bool
True if the table has cross-stream kerning values.
If text is normally written horizontally, adjustments will be vertical. If adjustment values are positive, the text will be moved up. If they are negative, the text will be moved down. If text is normally written vertically, adjustments will be horizontal. If adjustment values are positive, the text will be moved to the right. If they are negative, the text will be moved to the left.
Sourcepub fn is_variable(&self) -> bool
pub fn is_variable(&self) -> bool
True if the table has variation kerning values.
Sourcepub fn process_direction(&self) -> bool
pub fn process_direction(&self) -> bool
Process direction flag. If clear, process the glyphs forwards, that is, from first to last in the glyph stream. If we, process them from last to first. This flag only applies to state-table based ‘kerx’ subtables (types 1 and 4).
Sourcepub fn kind(&self) -> Result<SubtableKind<'a>, ReadError>
pub fn kind(&self) -> Result<SubtableKind<'a>, ReadError>
Returns an enum representing the actual subtable data.