read_fonts

Struct TableRef

Source
pub struct TableRef<'a, T> { /* private fields */ }
Expand description

Typed access to raw table data.

Implementations§

Source§

impl<'a, T> TableRef<'a, T>

Source

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.

Source

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.

Source

pub fn shape(&self) -> &T

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.

Source§

impl<'a> TableRef<'a, Lookup0Marker>

Source

pub fn format(&self) -> u16

Format number is set to 0.

Source

pub fn values_data(&self) -> &'a [u8]

Values, indexed by glyph index.

Source§

impl<'a> TableRef<'a, Lookup2Marker>

Source

pub fn format(&self) -> u16

Format number is set to 2.

Source

pub fn unit_size(&self) -> u16

Size of a lookup unit for this search in bytes.

Source

pub fn n_units(&self) -> u16

Number of units of the preceding size to be searched.

Source

pub fn search_range(&self) -> u16

The value of unitSize times the largest power of 2 that is less than or equal to the value of nUnits.

Source

pub fn entry_selector(&self) -> u16

The log base 2 of the largest power of 2 less than or equal to the value of nUnits.

Source

pub fn range_shift(&self) -> u16

The value of unitSize times the difference of the value of nUnits minus the largest power of 2 less than or equal to the value of nUnits.

Source

pub fn segments_data(&self) -> &'a [u8]

Segments.

Source§

impl<'a> TableRef<'a, Lookup4Marker>

Source

pub fn format(&self) -> u16

Format number is set to 4.

Source

pub fn unit_size(&self) -> u16

Size of a lookup unit for this search in bytes.

Source

pub fn n_units(&self) -> u16

Number of units of the preceding size to be searched.

Source

pub fn search_range(&self) -> u16

The value of unitSize times the largest power of 2 that is less than or equal to the value of nUnits.

Source

pub fn entry_selector(&self) -> u16

The log base 2 of the largest power of 2 less than or equal to the value of nUnits.

Source

pub fn range_shift(&self) -> u16

The value of unitSize times the difference of the value of nUnits minus the largest power of 2 less than or equal to the value of nUnits.

Source

pub fn segments(&self) -> &'a [LookupSegment4]

Segments.

Source§

impl<'a> TableRef<'a, Lookup6Marker>

Source

pub fn format(&self) -> u16

Format number is set to 6.

Source

pub fn unit_size(&self) -> u16

Size of a lookup unit for this search in bytes.

Source

pub fn n_units(&self) -> u16

Number of units of the preceding size to be searched.

Source

pub fn search_range(&self) -> u16

The value of unitSize times the largest power of 2 that is less than or equal to the value of nUnits.

Source

pub fn entry_selector(&self) -> u16

The log base 2 of the largest power of 2 less than or equal to the value of nUnits.

Source

pub fn range_shift(&self) -> u16

The value of unitSize times the difference of the value of nUnits minus the largest power of 2 less than or equal to the value of nUnits.

Source

pub fn entries_data(&self) -> &'a [u8]

Values, indexed by glyph index.

Source§

impl<'a> TableRef<'a, Lookup8Marker>

Source

pub fn format(&self) -> u16

Format number is set to 8.

Source

pub fn first_glyph(&self) -> u16

First glyph index included in the trimmed array.

Source

pub fn glyph_count(&self) -> u16

Total number of glyphs (equivalent to the last glyph minus the value of firstGlyph plus 1).

Source

pub fn value_array(&self) -> &'a [BigEndian<u16>]

The lookup values (indexed by the glyph index minus the value of firstGlyph). Entries in the value array must be two bytes.

Source§

impl<'a> TableRef<'a, Lookup10Marker>

Source

pub fn format(&self) -> u16

Format number is set to 10.

Source

pub fn unit_size(&self) -> u16

Size of a lookup unit for this lookup table in bytes. Allowed values are 1, 2, 4, and 8.

Source

pub fn first_glyph(&self) -> u16

First glyph index included in the trimmed array.

Source

pub fn glyph_count(&self) -> u16

Total number of glyphs (equivalent to the last glyph minus the value of firstGlyph plus 1).

Source

pub fn values_data(&self) -> &'a [u8]

The lookup values (indexed by the glyph index minus the value of firstGlyph).

Source§

impl<'a> TableRef<'a, StateHeaderMarker>

Source

pub fn state_size(&self) -> u16

Size of a state, in bytes. The size is limited to 8 bits, although the field is 16 bits for alignment.

Source

pub fn class_table_offset(&self) -> Offset16

Byte offset from the beginning of the state table to the class subtable.

Source

pub fn class_table(&self) -> Result<ClassSubtable<'a>, ReadError>

Attempt to resolve class_table_offset.

Source

pub fn state_array_offset(&self) -> Offset16

Byte offset from the beginning of the state table to the state array.

Source

pub fn state_array(&self) -> Result<RawBytes<'a>, ReadError>

Attempt to resolve state_array_offset.

Source

pub fn entry_table_offset(&self) -> Offset16

Byte offset from the beginning of the state table to the entry subtable.

Source

pub fn entry_table(&self) -> Result<RawBytes<'a>, ReadError>

Attempt to resolve entry_table_offset.

Source§

impl<'a> TableRef<'a, ClassSubtableMarker>

Source

pub fn first_glyph(&self) -> u16

Glyph index of the first glyph in the class table.

Source

pub fn n_glyphs(&self) -> u16

Number of glyphs in class table.

Source

pub fn class_array(&self) -> &'a [u8]

The class codes (indexed by glyph index minus firstGlyph). Class codes range from 0 to the value of stateSize minus 1.

Source§

impl<'a> TableRef<'a, RawBytesMarker>

Source

pub fn data(&self) -> &'a [u8]

Source§

impl<'a> TableRef<'a, StxHeaderMarker>

Source

pub fn n_classes(&self) -> u32

Number of classes, which is the number of 16-bit entry indices in a single line in the state array.

Source

pub fn class_table_offset(&self) -> Offset32

Byte offset from the beginning of the state table to the class subtable.

Source

pub fn class_table(&self) -> Result<LookupU16<'a>, ReadError>

Attempt to resolve class_table_offset.

Source

pub fn state_array_offset(&self) -> Offset32

Byte offset from the beginning of the state table to the state array.

Source

pub fn state_array(&self) -> Result<RawWords<'a>, ReadError>

Attempt to resolve state_array_offset.

Source

pub fn entry_table_offset(&self) -> Offset32

Byte offset from the beginning of the state table to the entry subtable.

Source

pub fn entry_table(&self) -> Result<RawBytes<'a>, ReadError>

Attempt to resolve entry_table_offset.

Source§

impl<'a> TableRef<'a, RawWordsMarker>

Source

pub fn data(&self) -> &'a [BigEndian<u16>]

Source§

impl TableRef<'_, Lookup0Marker>

Source

pub fn value<T: LookupValue>(&self, index: u16) -> Result<T, ReadError>

Source§

impl TableRef<'_, Lookup2Marker>

Source

pub fn value<T: LookupValue>(&self, index: u16) -> Result<T, ReadError>

Source§

impl TableRef<'_, Lookup4Marker>

Source

pub fn value<T: LookupValue>(&self, index: u16) -> Result<T, ReadError>

Source§

impl TableRef<'_, Lookup6Marker>

Source

pub fn value<T: LookupValue>(&self, index: u16) -> Result<T, ReadError>

Source§

impl TableRef<'_, Lookup8Marker>

Source

pub fn value<T: LookupValue>(&self, index: u16) -> Result<T, ReadError>

Source§

impl TableRef<'_, Lookup10Marker>

Source

pub fn value<T: LookupValue>(&self, index: u16) -> Result<T, ReadError>

Source§

impl<'a> TableRef<'a, AnkrMarker>

Source

pub fn version(&self) -> u16

Version number (set to zero).

Source

pub fn flags(&self) -> u16

Flags (currently unused; set to zero).

Source

pub fn lookup_table_offset(&self) -> Offset32

Offset to the table’s lookup table; currently this is always 0x0000000C.

Lookup values are two byte offsets into the glyph data table.

Source

pub fn lookup_table(&self) -> Result<LookupU16<'a>, ReadError>

Attempt to resolve lookup_table_offset.

Source

pub fn glyph_data_table_offset(&self) -> u32

Offset to the glyph data table.

Source§

impl<'a> TableRef<'a, GlyphDataEntryMarker>

Source

pub fn num_points(&self) -> u32

Number of anchor points for this glyph.

Source

pub fn anchor_points(&self) -> &'a [AnchorPoint]

Individual anchor points.

Source§

impl<'a> TableRef<'a, AnkrMarker>

Source

pub fn anchor_points( &self, glyph_id: GlyphId, ) -> Result<&'a [AnchorPoint], ReadError>

Returns the set of anchor points for the given glyph.

Source§

impl<'a> TableRef<'a, AvarMarker>

Source

pub fn version(&self) -> MajorMinor

Major version number of the axis variations table — set to 1 or 2. Minor version number of the axis variations table — set to 0.

Source

pub fn axis_count(&self) -> u16

The number of variation axes for this font. This must be the same number as axisCount in the ‘fvar’ table.

Source

pub fn axis_segment_maps(&self) -> VarLenArray<'a, SegmentMaps<'a>>

The segment maps array — one segment map for each axis, in the order of axes specified in the ‘fvar’ table.

Source

pub fn axis_index_map_offset(&self) -> Option<Nullable<Offset32>>

Offset to DeltaSetIndexMap table (may be NULL).

Source

pub fn axis_index_map(&self) -> Option<Result<DeltaSetIndexMap<'a>, ReadError>>

Attempt to resolve axis_index_map_offset.

Source

pub fn var_store_offset(&self) -> Option<Nullable<Offset32>>

Offset to ItemVariationStore (may be NULL).

Source

pub fn var_store(&self) -> Option<Result<ItemVariationStore<'a>, ReadError>>

Attempt to resolve var_store_offset.

Source§

impl<'a> TableRef<'a, BaseMarker>

Source

pub fn version(&self) -> MajorMinor

(major, minor) Version for the BASE table (1,0) or (1,1)

Source

pub fn horiz_axis_offset(&self) -> Nullable<Offset16>

Offset to horizontal Axis table, from beginning of BASE table (may be NULL)

Source

pub fn horiz_axis(&self) -> Option<Result<Axis<'a>, ReadError>>

Attempt to resolve horiz_axis_offset.

Source

pub fn vert_axis_offset(&self) -> Nullable<Offset16>

Offset to vertical Axis table, from beginning of BASE table (may be NULL)

Source

pub fn vert_axis(&self) -> Option<Result<Axis<'a>, ReadError>>

Attempt to resolve vert_axis_offset.

Source

pub fn item_var_store_offset(&self) -> Option<Nullable<Offset32>>

Offset to Item Variation Store table, from beginning of BASE table (may be null)

Source

pub fn item_var_store( &self, ) -> Option<Result<ItemVariationStore<'a>, ReadError>>

Attempt to resolve item_var_store_offset.

Source§

impl<'a> TableRef<'a, AxisMarker>

Source

pub fn base_tag_list_offset(&self) -> Nullable<Offset16>

Offset to BaseTagList table, from beginning of Axis table (may be NULL)

Source

pub fn base_tag_list(&self) -> Option<Result<BaseTagList<'a>, ReadError>>

Attempt to resolve base_tag_list_offset.

Source

pub fn base_script_list_offset(&self) -> Offset16

Offset to BaseScriptList table, from beginning of Axis table

Source

pub fn base_script_list(&self) -> Result<BaseScriptList<'a>, ReadError>

Attempt to resolve base_script_list_offset.

Source§

impl<'a> TableRef<'a, BaseTagListMarker>

Source

pub fn base_tag_count(&self) -> u16

Number of baseline identification tags in this text direction — may be zero (0)

Source

pub fn baseline_tags(&self) -> &'a [BigEndian<Tag>]

Array of 4-byte baseline identification tags — must be in alphabetical order

Source§

impl<'a> TableRef<'a, BaseScriptListMarker>

Source

pub fn base_script_count(&self) -> u16

Number of BaseScriptRecords defined

Source

pub fn base_script_records(&self) -> &'a [BaseScriptRecord]

Array of BaseScriptRecords, in alphabetical order by baseScriptTag

Source§

impl<'a> TableRef<'a, BaseScriptMarker>

Source

pub fn base_values_offset(&self) -> Nullable<Offset16>

Offset to BaseValues table, from beginning of BaseScript table (may be NULL)

Source

pub fn base_values(&self) -> Option<Result<BaseValues<'a>, ReadError>>

Attempt to resolve base_values_offset.

Source

pub fn default_min_max_offset(&self) -> Nullable<Offset16>

Offset to MinMax table, from beginning of BaseScript table (may be NULL)

Source

pub fn default_min_max(&self) -> Option<Result<MinMax<'a>, ReadError>>

Attempt to resolve default_min_max_offset.

Source

pub fn base_lang_sys_count(&self) -> u16

Number of BaseLangSysRecords defined — may be zero (0)

Source

pub fn base_lang_sys_records(&self) -> &'a [BaseLangSysRecord]

Array of BaseLangSysRecords, in alphabetical order by BaseLangSysTag

Source§

impl<'a> TableRef<'a, BaseValuesMarker>

Source

pub fn default_baseline_index(&self) -> u16

Index number of default baseline for this script — equals index position of baseline tag in baselineTags array of the BaseTagList

Source

pub fn base_coord_count(&self) -> u16

Number of BaseCoord tables defined — should equal baseTagCount in the BaseTagList

Source

pub fn base_coord_offsets(&self) -> &'a [BigEndian<Offset16>]

Array of offsets to BaseCoord tables, from beginning of BaseValues table — order matches baselineTags array in the BaseTagList

Source

pub fn base_coords(&self) -> ArrayOfOffsets<'a, BaseCoord<'a>, Offset16>

A dynamically resolving wrapper for base_coord_offsets.

Source§

impl<'a> TableRef<'a, MinMaxMarker>

Source

pub fn min_coord_offset(&self) -> Nullable<Offset16>

Offset to BaseCoord table that defines the minimum extent value, from the beginning of MinMax table (may be NULL)

Source

pub fn min_coord(&self) -> Option<Result<BaseCoord<'a>, ReadError>>

Attempt to resolve min_coord_offset.

Source

pub fn max_coord_offset(&self) -> Nullable<Offset16>

Offset to BaseCoord table that defines maximum extent value, from the beginning of MinMax table (may be NULL)

Source

pub fn max_coord(&self) -> Option<Result<BaseCoord<'a>, ReadError>>

Attempt to resolve max_coord_offset.

Source

pub fn feat_min_max_count(&self) -> u16

Number of FeatMinMaxRecords — may be zero (0)

Source

pub fn feat_min_max_records(&self) -> &'a [FeatMinMaxRecord]

Array of FeatMinMaxRecords, in alphabetical order by featureTableTag

Source§

impl<'a> TableRef<'a, BaseCoordFormat1Marker>

Source

pub fn base_coord_format(&self) -> u16

Format identifier — format = 1

Source

pub fn coordinate(&self) -> i16

X or Y value, in design units

Source§

impl<'a> TableRef<'a, BaseCoordFormat2Marker>

Source

pub fn base_coord_format(&self) -> u16

Format identifier — format = 2

Source

pub fn coordinate(&self) -> i16

X or Y value, in design units

Source

pub fn reference_glyph(&self) -> u16

Glyph ID of control glyph

Source

pub fn base_coord_point(&self) -> u16

Index of contour point on the reference glyph

Source§

impl<'a> TableRef<'a, BaseCoordFormat3Marker>

Source

pub fn base_coord_format(&self) -> u16

Format identifier — format = 3

Source

pub fn coordinate(&self) -> i16

X or Y value, in design units

Source

pub fn device_offset(&self) -> Nullable<Offset16>

Offset to Device table (non-variable font) / Variation Index table (variable font) for X or Y value, from beginning of BaseCoord table (may be NULL).

Source

pub fn device(&self) -> Option<Result<DeviceOrVariationIndex<'a>, ReadError>>

Attempt to resolve device_offset.

Source§

impl<'a> TableRef<'a, IndexSubtableArrayMarker>

Source

pub fn first_glyph_index(&self) -> GlyphId16

First glyph ID of this range.

Source

pub fn last_glyph_index(&self) -> GlyphId16

Last glyph ID of this range (inclusive).

Source

pub fn additional_offset_to_index_subtable(&self) -> u32

Add to indexSubTableArrayOffset to get offset from beginning of EBLC.

Source§

impl<'a> TableRef<'a, IndexSubtable1Marker>

Source

pub fn index_format(&self) -> u16

Format of this IndexSubTable.

Source

pub fn image_format(&self) -> u16

Format of EBDT image data.

Source

pub fn image_data_offset(&self) -> u32

Offset to image data in EBDT table.

Source

pub fn sbit_offsets(&self) -> &'a [BigEndian<u32>]

Source§

impl<'a> TableRef<'a, IndexSubtable2Marker>

Source

pub fn index_format(&self) -> u16

Format of this IndexSubTable.

Source

pub fn image_format(&self) -> u16

Format of EBDT image data.

Source

pub fn image_data_offset(&self) -> u32

Offset to image data in EBDT table.

Source

pub fn image_size(&self) -> u32

All the glyphs are of the same size.

Source

pub fn big_metrics(&self) -> &'a [BigGlyphMetrics]

All glyphs have the same metrics; glyph data may be compressed, byte-aligned, or bit-aligned.

Source§

impl<'a> TableRef<'a, IndexSubtable3Marker>

Source

pub fn index_format(&self) -> u16

Format of this IndexSubTable.

Source

pub fn image_format(&self) -> u16

Format of EBDT image data.

Source

pub fn image_data_offset(&self) -> u32

Offset to image data in EBDT table.

Source

pub fn sbit_offsets(&self) -> &'a [BigEndian<u16>]

Source§

impl<'a> TableRef<'a, IndexSubtable4Marker>

Source

pub fn index_format(&self) -> u16

Format of this IndexSubTable.

Source

pub fn image_format(&self) -> u16

Format of EBDT image data.

Source

pub fn image_data_offset(&self) -> u32

Offset to image data in EBDT table.

Source

pub fn num_glyphs(&self) -> u32

Array length.

Source

pub fn glyph_array(&self) -> &'a [GlyphIdOffsetPair]

One per glyph.

Source§

impl<'a> TableRef<'a, IndexSubtable5Marker>

Source

pub fn index_format(&self) -> u16

Format of this IndexSubTable.

Source

pub fn image_format(&self) -> u16

Format of EBDT image data.

Source

pub fn image_data_offset(&self) -> u32

Offset to image data in EBDT table.

Source

pub fn image_size(&self) -> u32

All glyphs have the same data size.

Source

pub fn big_metrics(&self) -> &'a [BigGlyphMetrics]

All glyphs have the same metrics.

Source

pub fn num_glyphs(&self) -> u32

Array length.

Source

pub fn glyph_array(&self) -> &'a [BigEndian<GlyphId16>]

One per glyph, sorted by glyhph ID.

Source§

impl<'a> TableRef<'a, CbdtMarker>

Source

pub fn major_version(&self) -> u16

Major version of the CBDT table, = 3.

Source

pub fn minor_version(&self) -> u16

Minor version of CBDT table, = 0.

Source§

impl<'a> TableRef<'a, CbdtMarker>

Source

pub fn data( &self, location: &BitmapLocation, ) -> Result<BitmapData<'a>, ReadError>

Source§

impl<'a> TableRef<'a, CblcMarker>

Source

pub fn major_version(&self) -> u16

Major version of the CBLC table, = 3.

Source

pub fn minor_version(&self) -> u16

Minor version of CBLC table, = 0.

Source

pub fn num_sizes(&self) -> u32

Number of BitmapSize records.

Source

pub fn bitmap_sizes(&self) -> &'a [BitmapSize]

BitmapSize records array.

Source§

impl<'a> TableRef<'a, CffHeaderMarker>

Source

pub fn major(&self) -> u8

Format major version (starting at 1).

Source

pub fn minor(&self) -> u8

Format minor version (starting at 0).

Source

pub fn hdr_size(&self) -> u8

Header size (bytes).

Source

pub fn off_size(&self) -> u8

Absolute offset size.

Source

pub fn _padding(&self) -> &'a [u8]

Padding bytes before the start of the Name INDEX.

Source

pub fn trailing_data(&self) -> &'a [u8]

Remaining table data.

Source§

impl<'a> TableRef<'a, Cff2HeaderMarker>

Source

pub fn major_version(&self) -> u8

Format major version (set to 2).

Source

pub fn minor_version(&self) -> u8

Format minor version (set to 0).

Source

pub fn header_size(&self) -> u8

Header size (bytes).

Source

pub fn top_dict_length(&self) -> u16

Length of Top DICT structure in bytes.

Source

pub fn _padding(&self) -> &'a [u8]

Padding bytes before the start of the Top DICT.

Source

pub fn top_dict_data(&self) -> &'a [u8]

Data containing the Top DICT.

Source

pub fn trailing_data(&self) -> &'a [u8]

Remaining table data.

Source§

impl<'a> TableRef<'a, CmapMarker>

Source

pub fn version(&self) -> u16

Table version number (0).

Source

pub fn num_tables(&self) -> u16

Number of encoding tables that follow.

Source

pub fn encoding_records(&self) -> &'a [EncodingRecord]

Source§

impl<'a> TableRef<'a, Cmap0Marker>

Source

pub fn format(&self) -> u16

Format number is set to 0.

Source

pub fn length(&self) -> u16

This is the length in bytes of the subtable.

Source

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.

Source

pub fn glyph_id_array(&self) -> &'a [u8]

An array that maps character codes to glyph index values.

Source§

impl<'a> TableRef<'a, Cmap2Marker>

Source

pub fn format(&self) -> u16

Format number is set to 2.

Source

pub fn length(&self) -> u16

This is the length in bytes of the subtable.

Source

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.

Source

pub fn sub_header_keys(&self) -> &'a [BigEndian<u16>]

Array that maps high bytes to subHeaders: value is subHeader index × 8.

Source§

impl<'a> TableRef<'a, Cmap4Marker>

Source

pub fn format(&self) -> u16

Format number is set to 4.

Source

pub fn length(&self) -> u16

This is the length in bytes of the subtable.

Source

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.

Source

pub fn seg_count_x2(&self) -> u16

2 × segCount.

Source

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)

Source

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)))

Source

pub fn range_shift(&self) -> u16

segCount times 2, minus searchRange ((segCount * 2) - searchRange)

Source

pub fn end_code(&self) -> &'a [BigEndian<u16>]

End characterCode for each segment, last=0xFFFF.

Source

pub fn start_code(&self) -> &'a [BigEndian<u16>]

Start character code for each segment.

Source

pub fn id_delta(&self) -> &'a [BigEndian<i16>]

Delta for all character codes in segment.

Source

pub fn id_range_offsets(&self) -> &'a [BigEndian<u16>]

Offsets into glyphIdArray or 0

Source

pub fn glyph_id_array(&self) -> &'a [BigEndian<u16>]

Glyph index array (arbitrary length)

Source§

impl<'a> TableRef<'a, Cmap6Marker>

Source

pub fn format(&self) -> u16

Format number is set to 6.

Source

pub fn length(&self) -> u16

This is the length in bytes of the subtable.

Source

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.

Source

pub fn first_code(&self) -> u16

First character code of subrange.

Source

pub fn entry_count(&self) -> u16

Number of character codes in subrange.

Source

pub fn glyph_id_array(&self) -> &'a [BigEndian<u16>]

Array of glyph index values for character codes in the range.

Source§

impl<'a> TableRef<'a, Cmap8Marker>

Source

pub fn format(&self) -> u16

Subtable format; set to 8.

Source

pub fn length(&self) -> u32

Byte length of this subtable (including the header)

Source

pub fn language(&self) -> u32

For requirements on use of the language field, see “Use of the language field in ‘cmap’ subtables” in this document.

Source

pub fn is32(&self) -> &'a [u8]

Tightly packed array of bits (8K bytes total) indicating whether the particular 16-bit (index) value is the start of a 32-bit character code

Source

pub fn num_groups(&self) -> u32

Number of groupings which follow

Source

pub fn groups(&self) -> &'a [SequentialMapGroup]

Array of SequentialMapGroup records.

Source§

impl<'a> TableRef<'a, Cmap10Marker>

Source

pub fn format(&self) -> u16

Subtable format; set to 10.

Source

pub fn length(&self) -> u32

Byte length of this subtable (including the header)

Source

pub fn language(&self) -> u32

For requirements on use of the language field, see “Use of the language field in ‘cmap’ subtables” in this document.

Source

pub fn start_char_code(&self) -> u32

First character code covered

Source

pub fn num_chars(&self) -> u32

Number of character codes covered

Source

pub fn glyph_id_array(&self) -> &'a [BigEndian<u16>]

Array of glyph indices for the character codes covered

Source§

impl<'a> TableRef<'a, Cmap12Marker>

Source

pub fn format(&self) -> u16

Subtable format; set to 12.

Source

pub fn length(&self) -> u32

Byte length of this subtable (including the header)

Source

pub fn language(&self) -> u32

For requirements on use of the language field, see “Use of the language field in ‘cmap’ subtables” in this document.

Source

pub fn num_groups(&self) -> u32

Number of groupings which follow

Source

pub fn groups(&self) -> &'a [SequentialMapGroup]

Array of SequentialMapGroup records.

Source§

impl<'a> TableRef<'a, Cmap13Marker>

Source

pub fn format(&self) -> u16

Subtable format; set to 13.

Source

pub fn length(&self) -> u32

Byte length of this subtable (including the header)

Source

pub fn language(&self) -> u32

For requirements on use of the language field, see “Use of the language field in ‘cmap’ subtables” in this document.

Source

pub fn num_groups(&self) -> u32

Number of groupings which follow

Source

pub fn groups(&self) -> &'a [ConstantMapGroup]

Array of ConstantMapGroup records.

Source§

impl<'a> TableRef<'a, Cmap14Marker>

Source

pub fn format(&self) -> u16

Subtable format. Set to 14.

Source

pub fn length(&self) -> u32

Byte length of this subtable (including this header)

Source

pub fn num_var_selector_records(&self) -> u32

Number of variation Selector Records

Source

pub fn var_selector(&self) -> &'a [VariationSelector]

Array of VariationSelector records.

Source§

impl<'a> TableRef<'a, DefaultUvsMarker>

Source

pub fn num_unicode_value_ranges(&self) -> u32

Number of Unicode character ranges.

Source

pub fn ranges(&self) -> &'a [UnicodeRange]

Array of UnicodeRange records.

Source§

impl<'a> TableRef<'a, NonDefaultUvsMarker>

Source

pub fn num_uvs_mappings(&self) -> u32

Source

pub fn uvs_mapping(&self) -> &'a [UvsMapping]

Source§

impl TableRef<'_, CmapMarker>

Source

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.

Source

pub fn closure_glyphs( &self, unicodes: &IntSet<u32>, glyph_set: &mut IntSet<GlyphId>, )

Available on crate feature std only.
Source§

impl<'a> TableRef<'a, Cmap4Marker>

Source

pub fn map_codepoint(&self, codepoint: impl Into<u32>) -> Option<GlyphId>

Maps a codepoint to a nominal glyph identifier.

Source

pub fn iter(&self) -> Cmap4Iter<'a>

Returns an iterator over all (codepoint, glyph identifier) pairs in the subtable.

Source§

impl<'a> TableRef<'a, Cmap12Marker>

Source

pub fn map_codepoint(&self, codepoint: impl Into<u32>) -> Option<GlyphId>

Maps a codepoint to a nominal glyph identifier.

Source

pub fn iter(&self) -> Cmap12Iter<'a>

Returns an iterator over all (codepoint, glyph identifier) pairs in the subtable.

Source§

impl<'a> TableRef<'a, Cmap14Marker>

Source

pub fn map_variant( &self, codepoint: impl Into<u32>, selector: impl Into<u32>, ) -> Option<MapVariant>

Maps a codepoint and variation selector to a nominal glyph identifier.

Source

pub fn iter(&self) -> Cmap14Iter<'a>

Returns an iterator over all (codepoint, selector, mapping variant) triples in the subtable.

Source

pub fn closure_glyphs( &self, unicodes: &IntSet<u32>, glyph_set: &mut IntSet<GlyphId>, )

Available on crate feature std only.
Source§

impl TableRef<'_, ColrMarker>

Source

pub fn v0_closure_palette_indices( &self, glyph_set: &IntSet<GlyphId>, palette_indices: &mut IntSet<u16>, )

Available on crate feature std only.
Source

pub fn v1_closure( &self, glyph_set: &mut IntSet<GlyphId>, layer_indices: &mut IntSet<u32>, palette_indices: &mut IntSet<u16>, variation_indices: &mut IntSet<u32>, delta_set_indices: &mut IntSet<u32>, )

Available on crate feature std only.

Collect the transitive closure of v1 glyphs,layer/paletted indices and variation/delta set indices for COLRv1

Source

pub fn v0_closure_glyphs( &self, glyph_set: &IntSet<GlyphId>, glyphset_colrv0: &mut IntSet<GlyphId>, )

Available on crate feature std only.

Collect the transitive closure of V0 glyphs needed for all of the input glyphs set

Source§

impl<'a> TableRef<'a, ColrMarker>

Source

pub fn version(&self) -> u16

Table version number - set to 0 or 1.

Source

pub fn num_base_glyph_records(&self) -> u16

Number of BaseGlyph records; may be 0 in a version 1 table.

Source

pub fn base_glyph_records_offset(&self) -> Nullable<Offset32>

Offset to baseGlyphRecords array (may be NULL).

Source

pub fn base_glyph_records(&self) -> Option<Result<&'a [BaseGlyph], ReadError>>

Attempt to resolve base_glyph_records_offset.

Source

pub fn layer_records_offset(&self) -> Nullable<Offset32>

Offset to layerRecords array (may be NULL).

Source

pub fn layer_records(&self) -> Option<Result<&'a [Layer], ReadError>>

Attempt to resolve layer_records_offset.

Source

pub fn num_layer_records(&self) -> u16

Number of Layer records; may be 0 in a version 1 table.

Source

pub fn base_glyph_list_offset(&self) -> Option<Nullable<Offset32>>

Offset to BaseGlyphList table.

Source

pub fn base_glyph_list(&self) -> Option<Result<BaseGlyphList<'a>, ReadError>>

Attempt to resolve base_glyph_list_offset.

Source

pub fn layer_list_offset(&self) -> Option<Nullable<Offset32>>

Offset to LayerList table (may be NULL).

Source

pub fn layer_list(&self) -> Option<Result<LayerList<'a>, ReadError>>

Attempt to resolve layer_list_offset.

Source

pub fn clip_list_offset(&self) -> Option<Nullable<Offset32>>

Offset to ClipList table (may be NULL).

Source

pub fn clip_list(&self) -> Option<Result<ClipList<'a>, ReadError>>

Attempt to resolve clip_list_offset.

Source

pub fn var_index_map_offset(&self) -> Option<Nullable<Offset32>>

Offset to DeltaSetIndexMap table (may be NULL).

Source

pub fn var_index_map(&self) -> Option<Result<DeltaSetIndexMap<'a>, ReadError>>

Attempt to resolve var_index_map_offset.

Source

pub fn item_variation_store_offset(&self) -> Option<Nullable<Offset32>>

Offset to ItemVariationStore (may be NULL).

Source

pub fn item_variation_store( &self, ) -> Option<Result<ItemVariationStore<'a>, ReadError>>

Attempt to resolve item_variation_store_offset.

Source§

impl<'a> TableRef<'a, BaseGlyphListMarker>

Source§

impl<'a> TableRef<'a, LayerListMarker>

Source

pub fn num_layers(&self) -> u32

Source

pub fn paint_offsets(&self) -> &'a [BigEndian<Offset32>]

Offsets to Paint tables.

Source

pub fn paints(&self) -> ArrayOfOffsets<'a, Paint<'a>, Offset32>

A dynamically resolving wrapper for paint_offsets.

Source§

impl<'a> TableRef<'a, ClipListMarker>

Source

pub fn format(&self) -> u8

Set to 1.

Source

pub fn num_clips(&self) -> u32

Number of Clip records.

Source

pub fn clips(&self) -> &'a [Clip]

Clip records. Sorted by startGlyphID.

Source§

impl<'a> TableRef<'a, ClipBoxFormat1Marker>

Source

pub fn format(&self) -> u8

Set to 1.

Source

pub fn x_min(&self) -> FWord

Minimum x of clip box.

Source

pub fn y_min(&self) -> FWord

Minimum y of clip box.

Source

pub fn x_max(&self) -> FWord

Maximum x of clip box.

Source

pub fn y_max(&self) -> FWord

Maximum y of clip box.

Source§

impl<'a> TableRef<'a, ClipBoxFormat2Marker>

Source

pub fn format(&self) -> u8

Set to 2.

Source

pub fn x_min(&self) -> FWord

Minimum x of clip box. For variation, use varIndexBase + 0.

Source

pub fn y_min(&self) -> FWord

Minimum y of clip box. For variation, use varIndexBase + 1.

Source

pub fn x_max(&self) -> FWord

Maximum x of clip box. For variation, use varIndexBase + 2.

Source

pub fn y_max(&self) -> FWord

Maximum y of clip box. For variation, use varIndexBase + 3.

Source

pub fn var_index_base(&self) -> u32

Base index into DeltaSetIndexMap.

Source§

impl<'a> TableRef<'a, ColorLineMarker>

Source

pub fn extend(&self) -> Extend

An Extend enum value.

Source

pub fn num_stops(&self) -> u16

Number of ColorStop records.

Source

pub fn color_stops(&self) -> &'a [ColorStop]

Source§

impl<'a> TableRef<'a, VarColorLineMarker>

Source

pub fn extend(&self) -> Extend

An Extend enum value.

Source

pub fn num_stops(&self) -> u16

Number of ColorStop records.

Source

pub fn color_stops(&self) -> &'a [VarColorStop]

Allows for variations.

Source§

impl<'a> TableRef<'a, PaintColrLayersMarker>

Source

pub fn format(&self) -> u8

Set to 1.

Source

pub fn num_layers(&self) -> u8

Number of offsets to paint tables to read from LayerList.

Source

pub fn first_layer_index(&self) -> u32

Index (base 0) into the LayerList.

Source§

impl<'a> TableRef<'a, PaintSolidMarker>

Source

pub fn format(&self) -> u8

Set to 2.

Source

pub fn palette_index(&self) -> u16

Index for a CPAL palette entry.

Source

pub fn alpha(&self) -> F2Dot14

Alpha value.

Source§

impl<'a> TableRef<'a, PaintVarSolidMarker>

Source

pub fn format(&self) -> u8

Set to 3.

Source

pub fn palette_index(&self) -> u16

Index for a CPAL palette entry.

Source

pub fn alpha(&self) -> F2Dot14

Alpha value. For variation, use varIndexBase + 0.

Source

pub fn var_index_base(&self) -> u32

Base index into DeltaSetIndexMap.

Source§

impl<'a> TableRef<'a, PaintLinearGradientMarker>

Source

pub fn format(&self) -> u8

Set to 4.

Source

pub fn color_line_offset(&self) -> Offset24

Offset to ColorLine table.

Source

pub fn color_line(&self) -> Result<ColorLine<'a>, ReadError>

Attempt to resolve color_line_offset.

Source

pub fn x0(&self) -> FWord

Start point (p₀) x coordinate.

Source

pub fn y0(&self) -> FWord

Start point (p₀) y coordinate.

Source

pub fn x1(&self) -> FWord

End point (p₁) x coordinate.

Source

pub fn y1(&self) -> FWord

End point (p₁) y coordinate.

Source

pub fn x2(&self) -> FWord

Rotation point (p₂) x coordinate.

Source

pub fn y2(&self) -> FWord

Rotation point (p₂) y coordinate.

Source§

impl<'a> TableRef<'a, PaintVarLinearGradientMarker>

Source

pub fn format(&self) -> u8

Set to 5.

Source

pub fn color_line_offset(&self) -> Offset24

Offset to VarColorLine table.

Source

pub fn color_line(&self) -> Result<VarColorLine<'a>, ReadError>

Attempt to resolve color_line_offset.

Source

pub fn x0(&self) -> FWord

Start point (p₀) x coordinate. For variation, use varIndexBase + 0.

Source

pub fn y0(&self) -> FWord

Start point (p₀) y coordinate. For variation, use varIndexBase + 1.

Source

pub fn x1(&self) -> FWord

End point (p₁) x coordinate. For variation, use varIndexBase

Source

pub fn y1(&self) -> FWord

End point (p₁) y coordinate. For variation, use varIndexBase

Source

pub fn x2(&self) -> FWord

Rotation point (p₂) x coordinate. For variation, use varIndexBase + 4.

Source

pub fn y2(&self) -> FWord

Rotation point (p₂) y coordinate. For variation, use varIndexBase + 5.

Source

pub fn var_index_base(&self) -> u32

Base index into DeltaSetIndexMap.

Source§

impl<'a> TableRef<'a, PaintRadialGradientMarker>

Source

pub fn format(&self) -> u8

Set to 6.

Source

pub fn color_line_offset(&self) -> Offset24

Offset to ColorLine table.

Source

pub fn color_line(&self) -> Result<ColorLine<'a>, ReadError>

Attempt to resolve color_line_offset.

Source

pub fn x0(&self) -> FWord

Start circle center x coordinate.

Source

pub fn y0(&self) -> FWord

Start circle center y coordinate.

Source

pub fn radius0(&self) -> UfWord

Start circle radius.

Source

pub fn x1(&self) -> FWord

End circle center x coordinate.

Source

pub fn y1(&self) -> FWord

End circle center y coordinate.

Source

pub fn radius1(&self) -> UfWord

End circle radius.

Source§

impl<'a> TableRef<'a, PaintVarRadialGradientMarker>

Source

pub fn format(&self) -> u8

Set to 7.

Source

pub fn color_line_offset(&self) -> Offset24

Offset to VarColorLine table.

Source

pub fn color_line(&self) -> Result<VarColorLine<'a>, ReadError>

Attempt to resolve color_line_offset.

Source

pub fn x0(&self) -> FWord

Start circle center x coordinate. For variation, use varIndexBase + 0.

Source

pub fn y0(&self) -> FWord

Start circle center y coordinate. For variation, use varIndexBase + 1.

Source

pub fn radius0(&self) -> UfWord

Start circle radius. For variation, use varIndexBase + 2.

Source

pub fn x1(&self) -> FWord

End circle center x coordinate. For variation, use varIndexBase

Source

pub fn y1(&self) -> FWord

End circle center y coordinate. For variation, use varIndexBase

Source

pub fn radius1(&self) -> UfWord

End circle radius. For variation, use varIndexBase + 5.

Source

pub fn var_index_base(&self) -> u32

Base index into DeltaSetIndexMap.

Source§

impl<'a> TableRef<'a, PaintSweepGradientMarker>

Source

pub fn format(&self) -> u8

Set to 8.

Source

pub fn color_line_offset(&self) -> Offset24

Offset to ColorLine table.

Source

pub fn color_line(&self) -> Result<ColorLine<'a>, ReadError>

Attempt to resolve color_line_offset.

Source

pub fn center_x(&self) -> FWord

Center x coordinate.

Source

pub fn center_y(&self) -> FWord

Center y coordinate.

Source

pub fn start_angle(&self) -> F2Dot14

Start of the angular range of the gradient, 180° in counter-clockwise degrees per 1.0 of value.

Source

pub fn end_angle(&self) -> F2Dot14

End of the angular range of the gradient, 180° in counter-clockwise degrees per 1.0 of value.

Source§

impl<'a> TableRef<'a, PaintVarSweepGradientMarker>

Source

pub fn format(&self) -> u8

Set to 9.

Source

pub fn color_line_offset(&self) -> Offset24

Offset to VarColorLine table.

Source

pub fn color_line(&self) -> Result<VarColorLine<'a>, ReadError>

Attempt to resolve color_line_offset.

Source

pub fn center_x(&self) -> FWord

Center x coordinate. For variation, use varIndexBase + 0.

Source

pub fn center_y(&self) -> FWord

Center y coordinate. For variation, use varIndexBase + 1.

Source

pub fn start_angle(&self) -> F2Dot14

Start of the angular range of the gradient, 180° in counter-clockwise degrees per 1.0 of value. For variation, use varIndexBase + 2.

Source

pub fn end_angle(&self) -> F2Dot14

End of the angular range of the gradient, 180° in counter-clockwise degrees per 1.0 of value. For variation, use varIndexBase + 3.

Source

pub fn var_index_base(&self) -> u32

Base index into DeltaSetIndexMap.

Source§

impl<'a> TableRef<'a, PaintGlyphMarker>

Source

pub fn format(&self) -> u8

Set to 10.

Source

pub fn paint_offset(&self) -> Offset24

Offset to a Paint table.

Source

pub fn paint(&self) -> Result<Paint<'a>, ReadError>

Attempt to resolve paint_offset.

Source

pub fn glyph_id(&self) -> GlyphId16

Glyph ID for the source outline.

Source§

impl<'a> TableRef<'a, PaintColrGlyphMarker>

Source

pub fn format(&self) -> u8

Set to 11.

Source

pub fn glyph_id(&self) -> GlyphId16

Glyph ID for a BaseGlyphList base glyph.

Source§

impl<'a> TableRef<'a, PaintTransformMarker>

Source

pub fn format(&self) -> u8

Set to 12.

Source

pub fn paint_offset(&self) -> Offset24

Offset to a Paint subtable.

Source

pub fn paint(&self) -> Result<Paint<'a>, ReadError>

Attempt to resolve paint_offset.

Source

pub fn transform_offset(&self) -> Offset24

Offset to an Affine2x3 table.

Source

pub fn transform(&self) -> Result<Affine2x3<'a>, ReadError>

Attempt to resolve transform_offset.

Source§

impl<'a> TableRef<'a, PaintVarTransformMarker>

Source

pub fn format(&self) -> u8

Set to 13.

Source

pub fn paint_offset(&self) -> Offset24

Offset to a Paint subtable.

Source

pub fn paint(&self) -> Result<Paint<'a>, ReadError>

Attempt to resolve paint_offset.

Source

pub fn transform_offset(&self) -> Offset24

Offset to a VarAffine2x3 table.

Source

pub fn transform(&self) -> Result<VarAffine2x3<'a>, ReadError>

Attempt to resolve transform_offset.

Source§

impl<'a> TableRef<'a, Affine2x3Marker>

Source

pub fn xx(&self) -> Fixed

x-component of transformed x-basis vector.

Source

pub fn yx(&self) -> Fixed

y-component of transformed x-basis vector.

Source

pub fn xy(&self) -> Fixed

x-component of transformed y-basis vector.

Source

pub fn yy(&self) -> Fixed

y-component of transformed y-basis vector.

Source

pub fn dx(&self) -> Fixed

Translation in x direction.

Source

pub fn dy(&self) -> Fixed

Translation in y direction.

Source§

impl<'a> TableRef<'a, VarAffine2x3Marker>

Source

pub fn xx(&self) -> Fixed

x-component of transformed x-basis vector. For variation, use varIndexBase + 0.

Source

pub fn yx(&self) -> Fixed

y-component of transformed x-basis vector. For variation, use varIndexBase + 1.

Source

pub fn xy(&self) -> Fixed

x-component of transformed y-basis vector. For variation, use varIndexBase + 2.

Source

pub fn yy(&self) -> Fixed

y-component of transformed y-basis vector. For variation, use varIndexBase + 3.

Source

pub fn dx(&self) -> Fixed

Translation in x direction. For variation, use varIndexBase + 4.

Source

pub fn dy(&self) -> Fixed

Translation in y direction. For variation, use varIndexBase + 5.

Source

pub fn var_index_base(&self) -> u32

Base index into DeltaSetIndexMap.

Source§

impl<'a> TableRef<'a, PaintTranslateMarker>

Source

pub fn format(&self) -> u8

Set to 14.

Source

pub fn paint_offset(&self) -> Offset24

Offset to a Paint subtable.

Source

pub fn paint(&self) -> Result<Paint<'a>, ReadError>

Attempt to resolve paint_offset.

Source

pub fn dx(&self) -> FWord

Translation in x direction.

Source

pub fn dy(&self) -> FWord

Translation in y direction.

Source§

impl<'a> TableRef<'a, PaintVarTranslateMarker>

Source

pub fn format(&self) -> u8

Set to 15.

Source

pub fn paint_offset(&self) -> Offset24

Offset to a Paint subtable.

Source

pub fn paint(&self) -> Result<Paint<'a>, ReadError>

Attempt to resolve paint_offset.

Source

pub fn dx(&self) -> FWord

Translation in x direction. For variation, use varIndexBase + 0.

Source

pub fn dy(&self) -> FWord

Translation in y direction. For variation, use varIndexBase + 1.

Source

pub fn var_index_base(&self) -> u32

Base index into DeltaSetIndexMap.

Source§

impl<'a> TableRef<'a, PaintScaleMarker>

Source

pub fn format(&self) -> u8

Set to 16.

Source

pub fn paint_offset(&self) -> Offset24

Offset to a Paint subtable.

Source

pub fn paint(&self) -> Result<Paint<'a>, ReadError>

Attempt to resolve paint_offset.

Source

pub fn scale_x(&self) -> F2Dot14

Scale factor in x direction.

Source

pub fn scale_y(&self) -> F2Dot14

Scale factor in y direction.

Source§

impl<'a> TableRef<'a, PaintVarScaleMarker>

Source

pub fn format(&self) -> u8

Set to 17.

Source

pub fn paint_offset(&self) -> Offset24

Offset to a Paint subtable.

Source

pub fn paint(&self) -> Result<Paint<'a>, ReadError>

Attempt to resolve paint_offset.

Source

pub fn scale_x(&self) -> F2Dot14

Scale factor in x direction. For variation, use varIndexBase + 0.

Source

pub fn scale_y(&self) -> F2Dot14

Scale factor in y direction. For variation, use varIndexBase + 1.

Source

pub fn var_index_base(&self) -> u32

Base index into DeltaSetIndexMap.

Source§

impl<'a> TableRef<'a, PaintScaleAroundCenterMarker>

Source

pub fn format(&self) -> u8

Set to 18.

Source

pub fn paint_offset(&self) -> Offset24

Offset to a Paint subtable.

Source

pub fn paint(&self) -> Result<Paint<'a>, ReadError>

Attempt to resolve paint_offset.

Source

pub fn scale_x(&self) -> F2Dot14

Scale factor in x direction.

Source

pub fn scale_y(&self) -> F2Dot14

Scale factor in y direction.

Source

pub fn center_x(&self) -> FWord

x coordinate for the center of scaling.

Source

pub fn center_y(&self) -> FWord

y coordinate for the center of scaling.

Source§

impl<'a> TableRef<'a, PaintVarScaleAroundCenterMarker>

Source

pub fn format(&self) -> u8

Set to 19.

Source

pub fn paint_offset(&self) -> Offset24

Offset to a Paint subtable.

Source

pub fn paint(&self) -> Result<Paint<'a>, ReadError>

Attempt to resolve paint_offset.

Source

pub fn scale_x(&self) -> F2Dot14

Scale factor in x direction. For variation, use varIndexBase + 0.

Source

pub fn scale_y(&self) -> F2Dot14

Scale factor in y direction. For variation, use varIndexBase + 1.

Source

pub fn center_x(&self) -> FWord

x coordinate for the center of scaling. For variation, use varIndexBase + 2.

Source

pub fn center_y(&self) -> FWord

y coordinate for the center of scaling. For variation, use varIndexBase + 3.

Source

pub fn var_index_base(&self) -> u32

Base index into DeltaSetIndexMap.

Source§

impl<'a> TableRef<'a, PaintScaleUniformMarker>

Source

pub fn format(&self) -> u8

Set to 20.

Source

pub fn paint_offset(&self) -> Offset24

Offset to a Paint subtable.

Source

pub fn paint(&self) -> Result<Paint<'a>, ReadError>

Attempt to resolve paint_offset.

Source

pub fn scale(&self) -> F2Dot14

Scale factor in x and y directions.

Source§

impl<'a> TableRef<'a, PaintVarScaleUniformMarker>

Source

pub fn format(&self) -> u8

Set to 21.

Source

pub fn paint_offset(&self) -> Offset24

Offset to a Paint subtable.

Source

pub fn paint(&self) -> Result<Paint<'a>, ReadError>

Attempt to resolve paint_offset.

Source

pub fn scale(&self) -> F2Dot14

Scale factor in x and y directions. For variation, use varIndexBase + 0.

Source

pub fn var_index_base(&self) -> u32

Base index into DeltaSetIndexMap.

Source§

impl<'a> TableRef<'a, PaintScaleUniformAroundCenterMarker>

Source

pub fn format(&self) -> u8

Set to 22.

Source

pub fn paint_offset(&self) -> Offset24

Offset to a Paint subtable.

Source

pub fn paint(&self) -> Result<Paint<'a>, ReadError>

Attempt to resolve paint_offset.

Source

pub fn scale(&self) -> F2Dot14

Scale factor in x and y directions.

Source

pub fn center_x(&self) -> FWord

x coordinate for the center of scaling.

Source

pub fn center_y(&self) -> FWord

y coordinate for the center of scaling.

Source§

impl<'a> TableRef<'a, PaintVarScaleUniformAroundCenterMarker>

Source

pub fn format(&self) -> u8

Set to 23.

Source

pub fn paint_offset(&self) -> Offset24

Offset to a Paint subtable.

Source

pub fn paint(&self) -> Result<Paint<'a>, ReadError>

Attempt to resolve paint_offset.

Source

pub fn scale(&self) -> F2Dot14

Scale factor in x and y directions. For variation, use varIndexBase + 0.

Source

pub fn center_x(&self) -> FWord

x coordinate for the center of scaling. For variation, use varIndexBase + 1.

Source

pub fn center_y(&self) -> FWord

y coordinate for the center of scaling. For variation, use varIndexBase + 2.

Source

pub fn var_index_base(&self) -> u32

Base index into DeltaSetIndexMap.

Source§

impl<'a> TableRef<'a, PaintRotateMarker>

Source

pub fn format(&self) -> u8

Set to 24.

Source

pub fn paint_offset(&self) -> Offset24

Offset to a Paint subtable.

Source

pub fn paint(&self) -> Result<Paint<'a>, ReadError>

Attempt to resolve paint_offset.

Source

pub fn angle(&self) -> F2Dot14

Rotation angle, 180° in counter-clockwise degrees per 1.0 of value.

Source§

impl<'a> TableRef<'a, PaintVarRotateMarker>

Source

pub fn format(&self) -> u8

Set to 25.

Source

pub fn paint_offset(&self) -> Offset24

Offset to a Paint subtable.

Source

pub fn paint(&self) -> Result<Paint<'a>, ReadError>

Attempt to resolve paint_offset.

Source

pub fn angle(&self) -> F2Dot14

Rotation angle, 180° in counter-clockwise degrees per 1.0 of value. For variation, use varIndexBase + 0.

Source

pub fn var_index_base(&self) -> u32

Base index into DeltaSetIndexMap.

Source§

impl<'a> TableRef<'a, PaintRotateAroundCenterMarker>

Source

pub fn format(&self) -> u8

Set to 26.

Source

pub fn paint_offset(&self) -> Offset24

Offset to a Paint subtable.

Source

pub fn paint(&self) -> Result<Paint<'a>, ReadError>

Attempt to resolve paint_offset.

Source

pub fn angle(&self) -> F2Dot14

Rotation angle, 180° in counter-clockwise degrees per 1.0 of value.

Source

pub fn center_x(&self) -> FWord

x coordinate for the center of rotation.

Source

pub fn center_y(&self) -> FWord

y coordinate for the center of rotation.

Source§

impl<'a> TableRef<'a, PaintVarRotateAroundCenterMarker>

Source

pub fn format(&self) -> u8

Set to 27.

Source

pub fn paint_offset(&self) -> Offset24

Offset to a Paint subtable.

Source

pub fn paint(&self) -> Result<Paint<'a>, ReadError>

Attempt to resolve paint_offset.

Source

pub fn angle(&self) -> F2Dot14

Rotation angle, 180° in counter-clockwise degrees per 1.0 of value. For variation, use varIndexBase + 0.

Source

pub fn center_x(&self) -> FWord

x coordinate for the center of rotation. For variation, use varIndexBase + 1.

Source

pub fn center_y(&self) -> FWord

y coordinate for the center of rotation. For variation, use varIndexBase + 2.

Source

pub fn var_index_base(&self) -> u32

Base index into DeltaSetIndexMap.

Source§

impl<'a> TableRef<'a, PaintSkewMarker>

Source

pub fn format(&self) -> u8

Set to 28.

Source

pub fn paint_offset(&self) -> Offset24

Offset to a Paint subtable.

Source

pub fn paint(&self) -> Result<Paint<'a>, ReadError>

Attempt to resolve paint_offset.

Source

pub fn x_skew_angle(&self) -> F2Dot14

Angle of skew in the direction of the x-axis, 180° in counter-clockwise degrees per 1.0 of value.

Source

pub fn y_skew_angle(&self) -> F2Dot14

Angle of skew in the direction of the y-axis, 180° in counter-clockwise degrees per 1.0 of value.

Source§

impl<'a> TableRef<'a, PaintVarSkewMarker>

Source

pub fn format(&self) -> u8

Set to 29.

Source

pub fn paint_offset(&self) -> Offset24

Offset to a Paint subtable.

Source

pub fn paint(&self) -> Result<Paint<'a>, ReadError>

Attempt to resolve paint_offset.

Source

pub fn x_skew_angle(&self) -> F2Dot14

Angle of skew in the direction of the x-axis, 180° ┬░ in counter-clockwise degrees per 1.0 of value. For variation, use varIndexBase + 0.

Source

pub fn y_skew_angle(&self) -> F2Dot14

Angle of skew in the direction of the y-axis, 180° in counter-clockwise degrees per 1.0 of value. For variation, use varIndexBase + 1.

Source

pub fn var_index_base(&self) -> u32

Base index into DeltaSetIndexMap.

Source§

impl<'a> TableRef<'a, PaintSkewAroundCenterMarker>

Source

pub fn format(&self) -> u8

Set to 30.

Source

pub fn paint_offset(&self) -> Offset24

Offset to a Paint subtable.

Source

pub fn paint(&self) -> Result<Paint<'a>, ReadError>

Attempt to resolve paint_offset.

Source

pub fn x_skew_angle(&self) -> F2Dot14

Angle of skew in the direction of the x-axis, 180° in counter-clockwise degrees per 1.0 of value.

Source

pub fn y_skew_angle(&self) -> F2Dot14

Angle of skew in the direction of the y-axis, 180° in counter-clockwise degrees per 1.0 of value.

Source

pub fn center_x(&self) -> FWord

x coordinate for the center of rotation.

Source

pub fn center_y(&self) -> FWord

y coordinate for the center of rotation.

Source§

impl<'a> TableRef<'a, PaintVarSkewAroundCenterMarker>

Source

pub fn format(&self) -> u8

Set to 31.

Source

pub fn paint_offset(&self) -> Offset24

Offset to a Paint subtable.

Source

pub fn paint(&self) -> Result<Paint<'a>, ReadError>

Attempt to resolve paint_offset.

Source

pub fn x_skew_angle(&self) -> F2Dot14

Angle of skew in the direction of the x-axis, 180° in counter-clockwise degrees per 1.0 of value. For variation, use varIndexBase + 0.

Source

pub fn y_skew_angle(&self) -> F2Dot14

Angle of skew in the direction of the y-axis, 180° in counter-clockwise degrees per 1.0 of value. For variation, use varIndexBase + 1.

Source

pub fn center_x(&self) -> FWord

x coordinate for the center of rotation. For variation, use varIndexBase + 2.

Source

pub fn center_y(&self) -> FWord

y coordinate for the center of rotation. For variation, use varIndexBase + 3.

Source

pub fn var_index_base(&self) -> u32

Base index into DeltaSetIndexMap.

Source§

impl<'a> TableRef<'a, PaintCompositeMarker>

Source

pub fn format(&self) -> u8

Set to 32.

Source

pub fn source_paint_offset(&self) -> Offset24

Offset to a source Paint table.

Source

pub fn source_paint(&self) -> Result<Paint<'a>, ReadError>

Attempt to resolve source_paint_offset.

Source

pub fn composite_mode(&self) -> CompositeMode

A CompositeMode enumeration value.

Source

pub fn backdrop_paint_offset(&self) -> Offset24

Offset to a backdrop Paint table.

Source

pub fn backdrop_paint(&self) -> Result<Paint<'a>, ReadError>

Attempt to resolve backdrop_paint_offset.

Source§

impl<'a> TableRef<'a, ColrMarker>

Source

pub fn v0_base_glyph( &self, glyph_id: GlyphId, ) -> Result<Option<Range<usize>>, ReadError>

Returns the COLRv0 base glyph for the given glyph identifier.

The return value is a range of layer indices that can be passed to v0_layer to retrieve the layer glyph identifiers and palette color indices.

Source

pub fn v0_layer(&self, index: usize) -> Result<(GlyphId16, u16), ReadError>

Returns the COLRv0 layer at the given index.

The layer is represented by a tuple containing the glyph identifier of the associated outline and the palette color index.

Source

pub fn v1_base_glyph( &self, glyph_id: GlyphId, ) -> Result<Option<(Paint<'a>, PaintId)>, ReadError>

Returns the COLRv1 base glyph for the given glyph identifier.

The second value in the tuple is a unique identifier for the paint that may be used to detect recursion in the paint graph.

Source

pub fn v1_layer(&self, index: usize) -> Result<(Paint<'a>, PaintId), ReadError>

Returns the COLRv1 layer at the given index.

The second value in the tuple is a unique identifier for the paint that may be used to detect recursion in the paint graph.

Source

pub fn v1_clip_box( &self, glyph_id: GlyphId, ) -> Result<Option<ClipBox<'a>>, ReadError>

Returns the COLRv1 clip box for the given glyph identifier.

Source§

impl<'a> TableRef<'a, CpalMarker>

Source

pub fn version(&self) -> u16

Table version number (=0).

Source

pub fn num_palette_entries(&self) -> u16

Number of palette entries in each palette.

Source

pub fn num_palettes(&self) -> u16

Number of palettes in the table.

Source

pub fn num_color_records(&self) -> u16

Total number of color records, combined for all palettes.

Source

pub fn color_records_array_offset(&self) -> Nullable<Offset32>

Offset from the beginning of CPAL table to the first ColorRecord.

Source

pub fn color_records_array( &self, ) -> Option<Result<&'a [ColorRecord], ReadError>>

Attempt to resolve color_records_array_offset.

Source

pub fn color_record_indices(&self) -> &'a [BigEndian<u16>]

Index of each palette’s first color record in the combined color record array.

Source

pub fn palette_types_array_offset(&self) -> Option<Nullable<Offset32>>

Offset from the beginning of CPAL table to the Palette Types Array.

This is an array of 32-bit flag fields that describe properties of each palette.

Source

pub fn palette_types_array( &self, ) -> Option<Result<&'a [BigEndian<PaletteType>], ReadError>>

Attempt to resolve palette_types_array_offset.

Source

pub fn palette_labels_array_offset(&self) -> Option<Nullable<Offset32>>

Offset from the beginning of CPAL table to the Palette Labels Array.

This is an array of ‘name’ table IDs (typically in the font-specific name ID range) that specify user interface strings associated with each palette. Use 0xFFFF if no name ID is provided for a palette.

Source

pub fn palette_labels_array( &self, ) -> Option<Result<&'a [BigEndian<u16>], ReadError>>

Attempt to resolve palette_labels_array_offset.

Source

pub fn palette_entry_labels_array_offset(&self) -> Option<Nullable<Offset32>>

Offset from the beginning of CPAL table to the Palette Entry Labels Array.

This is an array of ‘name’ table IDs (typically in the font-specific name ID range) that specify user interface strings associated with each palette entry, e.g. “Outline”, “Fill”. This set of palette entry labels applies to all palettes in the font. Use 0xFFFF if no name ID is provided for a palette entry.

Source

pub fn palette_entry_labels_array( &self, ) -> Option<Result<&'a [BigEndian<NameId>], ReadError>>

Source§

impl<'a> TableRef<'a, CvarMarker>

Source

pub fn version(&self) -> MajorMinor

Major/minor version number of the CVT variations table — set to (1,0).

Source

pub fn tuple_variation_count(&self) -> TupleVariationCount

A packed field. The high 4 bits are flags, and the low 12 bits are the number of tuple variation tables for this glyph. The number of tuple variation tables can be any number between 1 and 4095.

Source

pub fn data_offset(&self) -> Offset16

Offset from the start of the ‘cvar’ table to the serialized data.

Source

pub fn data(&self) -> Result<FontData<'a>, ReadError>

Attempt to resolve data_offset.

Source

pub fn tuple_variation_headers( &self, ) -> VarLenArray<'a, TupleVariationHeader<'_>>

Array of tuple variation headers.

Source§

impl<'a> TableRef<'a, CvarMarker>

Source

pub fn variation_data( &self, axis_count: u16, ) -> Result<CvtVariationData<'a>, ReadError>

Returns the variation data containing the tuples and deltas for the control value table.

This table doesn’t contain an axis count field so this must be provided by the user and can be read from the fvar table.

Source

pub fn deltas( &self, axis_count: u16, coords: &[F2Dot14], deltas: &mut [i32], ) -> Result<(), ReadError>

Computes the accumulated deltas for the given set of normalized coordinates and stores them in deltas.

The axis_count parameter expects the value from the fvar table.

The deltas slice should have a length greater than or equal to the number of values in the cvt table. The values are computed in 16.16 format.

Source§

impl<'a> TableRef<'a, EbdtMarker>

Source

pub fn major_version(&self) -> u16

Major version of the EBDT table, = 2.

Source

pub fn minor_version(&self) -> u16

Minor version of EBDT table, = 0.

Source§

impl<'a> TableRef<'a, EbdtMarker>

Source

pub fn data( &self, location: &BitmapLocation, ) -> Result<BitmapData<'a>, ReadError>

Source§

impl<'a> TableRef<'a, EblcMarker>

Source

pub fn major_version(&self) -> u16

Major version of the EBLC table, = 2.

Source

pub fn minor_version(&self) -> u16

Minor version of EBLC table, = 0.

Source

pub fn num_sizes(&self) -> u32

Number of BitmapSize records.

Source

pub fn bitmap_sizes(&self) -> &'a [BitmapSize]

BitmapSize records array.

Source§

impl<'a> TableRef<'a, FeatMarker>

Source

pub fn version(&self) -> MajorMinor

Version number of the feature name table (0x00010000 for the current version).

Source

pub fn feature_name_count(&self) -> u16

The number of entries in the feature name array.

Source

pub fn names(&self) -> &'a [FeatureName]

The feature name array, sorted by feature type.

Source§

impl<'a> TableRef<'a, SettingNameArrayMarker>

Source

pub fn read(data: FontData<'a>, n_settings: u16) -> Result<Self, ReadError>

A constructor that requires additional arguments.

This type requires some external state in order to be parsed.

Source§

impl<'a> TableRef<'a, SettingNameArrayMarker>

Source

pub fn settings(&self) -> &'a [SettingName]

List of setting names for a feature.

Source§

impl TableRef<'_, FeatMarker>

Source

pub fn find(&self, feature: u16) -> Option<FeatureName>

Returns the name for the given feature code.

Source§

impl<'a> TableRef<'a, FvarMarker>

Source

pub fn version(&self) -> MajorMinor

Major version number of the font variations table — set to 1. Minor version number of the font variations table — set to 0.

Source

pub fn axis_instance_arrays_offset(&self) -> Offset16

Offset in bytes from the beginning of the table to the start of the VariationAxisRecord array. The InstanceRecord array directly follows.

Source

pub fn axis_instance_arrays(&self) -> Result<AxisInstanceArrays<'a>, ReadError>

Attempt to resolve axis_instance_arrays_offset.

Source

pub fn axis_count(&self) -> u16

The number of variation axes in the font (the number of records in the axes array).

Source

pub fn axis_size(&self) -> u16

The size in bytes of each VariationAxisRecord — set to 20 (0x0014) for this version.

Source

pub fn instance_count(&self) -> u16

The number of named instances defined in the font (the number of records in the instances array).

Source

pub fn instance_size(&self) -> u16

The size in bytes of each InstanceRecord — set to either axisCount * sizeof(Fixed) + 4, or to axisCount * sizeof(Fixed) + 6.

Source§

impl<'a> TableRef<'a, AxisInstanceArraysMarker>

Source

pub fn read( data: FontData<'a>, axis_count: u16, instance_count: u16, instance_size: u16, ) -> Result<Self, ReadError>

A constructor that requires additional arguments.

This type requires some external state in order to be parsed.

Source§

impl<'a> TableRef<'a, AxisInstanceArraysMarker>

Source

pub fn axes(&self) -> &'a [VariationAxisRecord]

Variation axis record array.

Source

pub fn instances(&self) -> ComputedArray<'a, InstanceRecord<'a>>

Instance record array.

Source§

impl<'a> TableRef<'a, FvarMarker>

Source

pub fn axes(&self) -> Result<&'a [VariationAxisRecord], ReadError>

Returns the array of variation axis records.

Source

pub fn instances( &self, ) -> Result<ComputedArray<'a, InstanceRecord<'a>>, ReadError>

Returns the array of instance records.

Source

pub fn user_to_normalized( &self, avar: Option<&Avar<'_>>, user_coords: impl IntoIterator<Item = (Tag, Fixed)>, normalized_coords: &mut [F2Dot14], )

Converts user space coordinates provided by an unordered iterator of (tag, value) pairs to normalized coordinates in axis list order.

Stores the resulting normalized coordinates in the given slice.

  • User coordinate tags that don’t match an axis are ignored.
  • User coordinate values are clamped to the range of their associated axis before normalization.
  • If more than one user coordinate is provided for the same tag, the last one is used.
  • If no user coordinate for an axis is provided, the associated coordinate is set to the normalized value 0.0, representing the default location in variation space.
  • The length of normalized_coords should equal the number of axes present in the this table. If the length is smaller, axes at out of bounds indices are ignored. If the length is larger, the excess entries will be filled with zeros.

If the Avar table is provided, applies remapping of coordinates according to the specification.

Source§

impl<'a> TableRef<'a, GaspMarker>

Source

pub fn version(&self) -> u16

Version number (set to 1)

Source

pub fn num_ranges(&self) -> u16

Number of records to follow

Source

pub fn gasp_ranges(&self) -> &'a [GaspRange]

Sorted by ppem

Source§

impl<'a> TableRef<'a, GdefMarker>

Source

pub fn version(&self) -> MajorMinor

The major/minor version of the GDEF table

Source

pub fn glyph_class_def_offset(&self) -> Nullable<Offset16>

Offset to class definition table for glyph type, from beginning of GDEF header (may be NULL)

Source

pub fn glyph_class_def(&self) -> Option<Result<ClassDef<'a>, ReadError>>

Attempt to resolve glyph_class_def_offset.

Source

pub fn attach_list_offset(&self) -> Nullable<Offset16>

Offset to attachment point list table, from beginning of GDEF header (may be NULL)

Source

pub fn attach_list(&self) -> Option<Result<AttachList<'a>, ReadError>>

Attempt to resolve attach_list_offset.

Source

pub fn lig_caret_list_offset(&self) -> Nullable<Offset16>

Offset to ligature caret list table, from beginning of GDEF header (may be NULL)

Source

pub fn lig_caret_list(&self) -> Option<Result<LigCaretList<'a>, ReadError>>

Attempt to resolve lig_caret_list_offset.

Source

pub fn mark_attach_class_def_offset(&self) -> Nullable<Offset16>

Offset to class definition table for mark attachment type, from beginning of GDEF header (may be NULL)

Source

pub fn mark_attach_class_def(&self) -> Option<Result<ClassDef<'a>, ReadError>>

Attempt to resolve mark_attach_class_def_offset.

Source

pub fn mark_glyph_sets_def_offset(&self) -> Option<Nullable<Offset16>>

Offset to the table of mark glyph set definitions, from beginning of GDEF header (may be NULL)

Source

pub fn mark_glyph_sets_def( &self, ) -> Option<Result<MarkGlyphSets<'a>, ReadError>>

Attempt to resolve mark_glyph_sets_def_offset.

Source

pub fn item_var_store_offset(&self) -> Option<Nullable<Offset32>>

Offset to the Item Variation Store table, from beginning of GDEF header (may be NULL)

Source

pub fn item_var_store( &self, ) -> Option<Result<ItemVariationStore<'a>, ReadError>>

Attempt to resolve item_var_store_offset.

Source§

impl<'a> TableRef<'a, AttachListMarker>

Source

pub fn coverage_offset(&self) -> Offset16

Offset to Coverage table - from beginning of AttachList table

Source

pub fn coverage(&self) -> Result<CoverageTable<'a>, ReadError>

Attempt to resolve coverage_offset.

Source

pub fn glyph_count(&self) -> u16

Number of glyphs with attachment points

Source

pub fn attach_point_offsets(&self) -> &'a [BigEndian<Offset16>]

Array of offsets to AttachPoint tables-from beginning of AttachList table-in Coverage Index order

Source

pub fn attach_points(&self) -> ArrayOfOffsets<'a, AttachPoint<'a>, Offset16>

A dynamically resolving wrapper for attach_point_offsets.

Source§

impl<'a> TableRef<'a, AttachPointMarker>

Source

pub fn point_count(&self) -> u16

Number of attachment points on this glyph

Source

pub fn point_indices(&self) -> &'a [BigEndian<u16>]

Array of contour point indices -in increasing numerical order

Source§

impl<'a> TableRef<'a, LigCaretListMarker>

Source

pub fn coverage_offset(&self) -> Offset16

Offset to Coverage table - from beginning of LigCaretList table

Source

pub fn coverage(&self) -> Result<CoverageTable<'a>, ReadError>

Attempt to resolve coverage_offset.

Source

pub fn lig_glyph_count(&self) -> u16

Number of ligature glyphs

Source

pub fn lig_glyph_offsets(&self) -> &'a [BigEndian<Offset16>]

Array of offsets to LigGlyph tables, from beginning of LigCaretList table —in Coverage Index order

Source

pub fn lig_glyphs(&self) -> ArrayOfOffsets<'a, LigGlyph<'a>, Offset16>

A dynamically resolving wrapper for lig_glyph_offsets.

Source§

impl<'a> TableRef<'a, LigGlyphMarker>

Source

pub fn caret_count(&self) -> u16

Number of CaretValue tables for this ligature (components - 1)

Source

pub fn caret_value_offsets(&self) -> &'a [BigEndian<Offset16>]

Array of offsets to CaretValue tables, from beginning of LigGlyph table — in increasing coordinate order

Source

pub fn caret_values(&self) -> ArrayOfOffsets<'a, CaretValue<'a>, Offset16>

A dynamically resolving wrapper for caret_value_offsets.

Source§

impl<'a> TableRef<'a, CaretValueFormat1Marker>

Source

pub fn caret_value_format(&self) -> u16

Format identifier: format = 1

Source

pub fn coordinate(&self) -> i16

X or Y value, in design units

Source§

impl<'a> TableRef<'a, CaretValueFormat2Marker>

Source

pub fn caret_value_format(&self) -> u16

Format identifier: format = 2

Source

pub fn caret_value_point_index(&self) -> u16

Contour point index on glyph

Source§

impl<'a> TableRef<'a, CaretValueFormat3Marker>

Source

pub fn caret_value_format(&self) -> u16

Format identifier-format = 3

Source

pub fn coordinate(&self) -> i16

X or Y value, in design units

Source

pub fn device_offset(&self) -> Offset16

Offset to Device table (non-variable font) / Variation Index table (variable font) for X or Y value-from beginning of CaretValue table

Source

pub fn device(&self) -> Result<DeviceOrVariationIndex<'a>, ReadError>

Attempt to resolve device_offset.

Source§

impl<'a> TableRef<'a, MarkGlyphSetsMarker>

Source

pub fn format(&self) -> u16

Format identifier == 1

Source

pub fn mark_glyph_set_count(&self) -> u16

Number of mark glyph sets defined

Source

pub fn coverage_offsets(&self) -> &'a [BigEndian<Offset32>]

Array of offsets to mark glyph set coverage tables, from the start of the MarkGlyphSets table.

Source

pub fn coverages(&self) -> ArrayOfOffsets<'a, CoverageTable<'a>, Offset32>

A dynamically resolving wrapper for coverage_offsets.

Source§

impl<'a> TableRef<'a, SimpleGlyphMarker>

Source

pub fn number_of_contours(&self) -> i16

If the number of contours is greater than or equal to zero, this is a simple glyph. If negative, this is a composite glyph — the value -1 should be used for composite glyphs.

Source

pub fn x_min(&self) -> i16

Minimum x for coordinate data.

Source

pub fn y_min(&self) -> i16

Minimum y for coordinate data.

Source

pub fn x_max(&self) -> i16

Maximum x for coordinate data.

Source

pub fn y_max(&self) -> i16

Maximum y for coordinate data.

Source

pub fn end_pts_of_contours(&self) -> &'a [BigEndian<u16>]

Array of point indices for the last point of each contour, in increasing numeric order

Source

pub fn instruction_length(&self) -> u16

Total number of bytes for instructions. If instructionLength is zero, no instructions are present for this glyph, and this field is followed directly by the flags field.

Source

pub fn instructions(&self) -> &'a [u8]

Array of instruction byte code for the glyph.

Source

pub fn glyph_data(&self) -> &'a [u8]

the raw data for flags & x/y coordinates

Source§

impl<'a> TableRef<'a, CompositeGlyphMarker>

Source

pub fn number_of_contours(&self) -> i16

If the number of contours is greater than or equal to zero, this is a simple glyph. If negative, this is a composite glyph — the value -1 should be used for composite glyphs.

Source

pub fn x_min(&self) -> i16

Minimum x for coordinate data.

Source

pub fn y_min(&self) -> i16

Minimum y for coordinate data.

Source

pub fn x_max(&self) -> i16

Maximum x for coordinate data.

Source

pub fn y_max(&self) -> i16

Maximum y for coordinate data.

Source

pub fn component_data(&self) -> &'a [u8]

component flag glyph index of component

Source§

impl<'a> TableRef<'a, SimpleGlyphMarker>

Source

pub fn num_points(&self) -> usize

Returns the total number of points.

Source

pub fn has_overlapping_contours(&self) -> bool

Returns true if the contours in the simple glyph may overlap.

Source

pub fn read_points_fast<C: PointCoord>( &self, points: &mut [Point<C>], flags: &mut [PointFlags], ) -> Result<(), ReadError>

Reads points and flags into the provided buffers.

Drops all flag bits except on-curve. The lengths of the buffers must be equal to the value returned by num_points.

§Performance

As the name implies, this is faster than using the iterator returned by points so should be used when it is possible to preallocate buffers.

Source

pub fn points(&self) -> impl Iterator<Item = CurvePoint> + 'a + Clone

Returns an iterator over the points in the glyph.

§Performance

This is slower than read_points_fast but provides access to the points without requiring a preallocated buffer.

Source§

impl<'a> TableRef<'a, CompositeGlyphMarker>

Source

pub fn components(&self) -> impl Iterator<Item = Component> + 'a + Clone

Returns an iterator over the components of the composite glyph.

Source

pub fn component_glyphs_and_flags( &self, ) -> impl Iterator<Item = (GlyphId16, CompositeGlyphFlags)> + 'a + Clone

Returns an iterator that yields the glyph identifier and flags of each component in the composite glyph.

Source

pub fn count_and_instructions(&self) -> (usize, Option<&'a [u8]>)

Returns the component count and TrueType interpreter instructions in a single pass.

Source

pub fn instructions(&self) -> Option<&'a [u8]>

Returns the TrueType interpreter instructions.

Source§

impl<'a> TableRef<'a, GposMarker>

Source

pub fn version(&self) -> MajorMinor

The major and minor version of the GPOS table, as a tuple (u16, u16)

Source

pub fn script_list_offset(&self) -> Offset16

Offset to ScriptList table, from beginning of GPOS table

Source

pub fn script_list(&self) -> Result<ScriptList<'a>, ReadError>

Attempt to resolve script_list_offset.

Source

pub fn feature_list_offset(&self) -> Offset16

Offset to FeatureList table, from beginning of GPOS table

Source

pub fn feature_list(&self) -> Result<FeatureList<'a>, ReadError>

Attempt to resolve feature_list_offset.

Source

pub fn lookup_list_offset(&self) -> Offset16

Offset to LookupList table, from beginning of GPOS table

Source

pub fn lookup_list(&self) -> Result<PositionLookupList<'a>, ReadError>

Attempt to resolve lookup_list_offset.

Source

pub fn feature_variations_offset(&self) -> Option<Nullable<Offset32>>

Source

pub fn feature_variations( &self, ) -> Option<Result<FeatureVariations<'a>, ReadError>>

Attempt to resolve feature_variations_offset.

Source§

impl<'a> TableRef<'a, AnchorFormat1Marker>

Source

pub fn anchor_format(&self) -> u16

Format identifier, = 1

Source

pub fn x_coordinate(&self) -> i16

Horizontal value, in design units

Source

pub fn y_coordinate(&self) -> i16

Vertical value, in design units

Source§

impl<'a> TableRef<'a, AnchorFormat2Marker>

Source

pub fn anchor_format(&self) -> u16

Format identifier, = 2

Source

pub fn x_coordinate(&self) -> i16

Horizontal value, in design units

Source

pub fn y_coordinate(&self) -> i16

Vertical value, in design units

Source

pub fn anchor_point(&self) -> u16

Index to glyph contour point

Source§

impl<'a> TableRef<'a, AnchorFormat3Marker>

Source

pub fn anchor_format(&self) -> u16

Format identifier, = 3

Source

pub fn x_coordinate(&self) -> i16

Horizontal value, in design units

Source

pub fn y_coordinate(&self) -> i16

Vertical value, in design units

Source

pub fn x_device_offset(&self) -> Nullable<Offset16>

Offset to Device table (non-variable font) / VariationIndex table (variable font) for X coordinate, from beginning of Anchor table (may be NULL)

Source

pub fn x_device(&self) -> Option<Result<DeviceOrVariationIndex<'a>, ReadError>>

Attempt to resolve x_device_offset.

Source

pub fn y_device_offset(&self) -> Nullable<Offset16>

Offset to Device table (non-variable font) / VariationIndex table (variable font) for Y coordinate, from beginning of Anchor table (may be NULL)

Source

pub fn y_device(&self) -> Option<Result<DeviceOrVariationIndex<'a>, ReadError>>

Attempt to resolve y_device_offset.

Source§

impl<'a> TableRef<'a, MarkArrayMarker>

Source

pub fn mark_count(&self) -> u16

Number of MarkRecords

Source

pub fn mark_records(&self) -> &'a [MarkRecord]

Array of MarkRecords, ordered by corresponding glyphs in the associated mark Coverage table.

Source§

impl<'a> TableRef<'a, SinglePosFormat1Marker>

Source

pub fn pos_format(&self) -> u16

Format identifier: format = 1

Source

pub fn coverage_offset(&self) -> Offset16

Offset to Coverage table, from beginning of SinglePos subtable.

Source

pub fn coverage(&self) -> Result<CoverageTable<'a>, ReadError>

Attempt to resolve coverage_offset.

Source

pub fn value_format(&self) -> ValueFormat

Defines the types of data in the ValueRecord.

Source

pub fn value_record(&self) -> ValueRecord

Defines positioning value(s) — applied to all glyphs in the Coverage table.

Source§

impl<'a> TableRef<'a, SinglePosFormat2Marker>

Source

pub fn pos_format(&self) -> u16

Format identifier: format = 2

Source

pub fn coverage_offset(&self) -> Offset16

Offset to Coverage table, from beginning of SinglePos subtable.

Source

pub fn coverage(&self) -> Result<CoverageTable<'a>, ReadError>

Attempt to resolve coverage_offset.

Source

pub fn value_format(&self) -> ValueFormat

Defines the types of data in the ValueRecords.

Source

pub fn value_count(&self) -> u16

Number of ValueRecords — must equal glyphCount in the Coverage table.

Source

pub fn value_records(&self) -> ComputedArray<'a, ValueRecord>

Array of ValueRecords — positioning values applied to glyphs.

Source§

impl<'a> TableRef<'a, PairPosFormat1Marker>

Source

pub fn pos_format(&self) -> u16

Format identifier: format = 1

Source

pub fn coverage_offset(&self) -> Offset16

Offset to Coverage table, from beginning of PairPos subtable.

Source

pub fn coverage(&self) -> Result<CoverageTable<'a>, ReadError>

Attempt to resolve coverage_offset.

Source

pub fn value_format1(&self) -> ValueFormat

Defines the types of data in valueRecord1 — for the first glyph in the pair (may be zero).

Source

pub fn value_format2(&self) -> ValueFormat

Defines the types of data in valueRecord2 — for the second glyph in the pair (may be zero).

Source

pub fn pair_set_count(&self) -> u16

Number of PairSet tables

Source

pub fn pair_set_offsets(&self) -> &'a [BigEndian<Offset16>]

Array of offsets to PairSet tables. Offsets are from beginning of PairPos subtable, ordered by Coverage Index.

Source

pub fn pair_sets(&self) -> ArrayOfOffsets<'a, PairSet<'a>, Offset16>

A dynamically resolving wrapper for pair_set_offsets.

Source§

impl<'a> TableRef<'a, PairSetMarker>

Source

pub fn read( data: FontData<'a>, value_format1: ValueFormat, value_format2: ValueFormat, ) -> Result<Self, ReadError>

A constructor that requires additional arguments.

This type requires some external state in order to be parsed.

Source§

impl<'a> TableRef<'a, PairSetMarker>

Source

pub fn pair_value_count(&self) -> u16

Number of PairValueRecords

Source

pub fn pair_value_records(&self) -> ComputedArray<'a, PairValueRecord>

Array of PairValueRecords, ordered by glyph ID of the second glyph.

Source§

impl<'a> TableRef<'a, PairPosFormat2Marker>

Source

pub fn pos_format(&self) -> u16

Format identifier: format = 2

Source

pub fn coverage_offset(&self) -> Offset16

Offset to Coverage table, from beginning of PairPos subtable.

Source

pub fn coverage(&self) -> Result<CoverageTable<'a>, ReadError>

Attempt to resolve coverage_offset.

Source

pub fn value_format1(&self) -> ValueFormat

ValueRecord definition — for the first glyph of the pair (may be zero).

Source

pub fn value_format2(&self) -> ValueFormat

ValueRecord definition — for the second glyph of the pair (may be zero).

Source

pub fn class_def1_offset(&self) -> Offset16

Offset to ClassDef table, from beginning of PairPos subtable — for the first glyph of the pair.

Source

pub fn class_def1(&self) -> Result<ClassDef<'a>, ReadError>

Attempt to resolve class_def1_offset.

Source

pub fn class_def2_offset(&self) -> Offset16

Offset to ClassDef table, from beginning of PairPos subtable — for the second glyph of the pair.

Source

pub fn class_def2(&self) -> Result<ClassDef<'a>, ReadError>

Attempt to resolve class_def2_offset.

Source

pub fn class1_count(&self) -> u16

Number of classes in classDef1 table — includes Class 0.

Source

pub fn class2_count(&self) -> u16

Number of classes in classDef2 table — includes Class 0.

Source

pub fn class1_records(&self) -> ComputedArray<'a, Class1Record<'a>>

Array of Class1 records, ordered by classes in classDef1.

Source§

impl<'a> TableRef<'a, CursivePosFormat1Marker>

Source

pub fn pos_format(&self) -> u16

Format identifier: format = 1

Source

pub fn coverage_offset(&self) -> Offset16

Offset to Coverage table, from beginning of CursivePos subtable.

Source

pub fn coverage(&self) -> Result<CoverageTable<'a>, ReadError>

Attempt to resolve coverage_offset.

Source

pub fn entry_exit_count(&self) -> u16

Number of EntryExit records

Source

pub fn entry_exit_record(&self) -> &'a [EntryExitRecord]

Array of EntryExit records, in Coverage index order.

Source§

impl<'a> TableRef<'a, MarkBasePosFormat1Marker>

Source

pub fn pos_format(&self) -> u16

Format identifier: format = 1

Source

pub fn mark_coverage_offset(&self) -> Offset16

Offset to markCoverage table, from beginning of MarkBasePos subtable.

Source

pub fn mark_coverage(&self) -> Result<CoverageTable<'a>, ReadError>

Attempt to resolve mark_coverage_offset.

Source

pub fn base_coverage_offset(&self) -> Offset16

Offset to baseCoverage table, from beginning of MarkBasePos subtable.

Source

pub fn base_coverage(&self) -> Result<CoverageTable<'a>, ReadError>

Attempt to resolve base_coverage_offset.

Source

pub fn mark_class_count(&self) -> u16

Number of classes defined for marks

Source

pub fn mark_array_offset(&self) -> Offset16

Offset to MarkArray table, from beginning of MarkBasePos subtable.

Source

pub fn mark_array(&self) -> Result<MarkArray<'a>, ReadError>

Attempt to resolve mark_array_offset.

Source

pub fn base_array_offset(&self) -> Offset16

Offset to BaseArray table, from beginning of MarkBasePos subtable.

Source

pub fn base_array(&self) -> Result<BaseArray<'a>, ReadError>

Attempt to resolve base_array_offset.

Source§

impl<'a> TableRef<'a, BaseArrayMarker>

Source

pub fn read( data: FontData<'a>, mark_class_count: u16, ) -> Result<Self, ReadError>

A constructor that requires additional arguments.

This type requires some external state in order to be parsed.

Source§

impl<'a> TableRef<'a, BaseArrayMarker>

Source

pub fn base_count(&self) -> u16

Number of BaseRecords

Source

pub fn base_records(&self) -> ComputedArray<'a, BaseRecord<'a>>

Array of BaseRecords, in order of baseCoverage Index.

Source§

impl<'a> TableRef<'a, MarkLigPosFormat1Marker>

Source

pub fn pos_format(&self) -> u16

Format identifier: format = 1

Source

pub fn mark_coverage_offset(&self) -> Offset16

Offset to markCoverage table, from beginning of MarkLigPos subtable.

Source

pub fn mark_coverage(&self) -> Result<CoverageTable<'a>, ReadError>

Attempt to resolve mark_coverage_offset.

Source

pub fn ligature_coverage_offset(&self) -> Offset16

Offset to ligatureCoverage table, from beginning of MarkLigPos subtable.

Source

pub fn ligature_coverage(&self) -> Result<CoverageTable<'a>, ReadError>

Attempt to resolve ligature_coverage_offset.

Source

pub fn mark_class_count(&self) -> u16

Number of defined mark classes

Source

pub fn mark_array_offset(&self) -> Offset16

Offset to MarkArray table, from beginning of MarkLigPos subtable.

Source

pub fn mark_array(&self) -> Result<MarkArray<'a>, ReadError>

Attempt to resolve mark_array_offset.

Source

pub fn ligature_array_offset(&self) -> Offset16

Offset to LigatureArray table, from beginning of MarkLigPos subtable.

Source

pub fn ligature_array(&self) -> Result<LigatureArray<'a>, ReadError>

Attempt to resolve ligature_array_offset.

Source§

impl<'a> TableRef<'a, LigatureArrayMarker>

Source

pub fn read( data: FontData<'a>, mark_class_count: u16, ) -> Result<Self, ReadError>

A constructor that requires additional arguments.

This type requires some external state in order to be parsed.

Source§

impl<'a> TableRef<'a, LigatureArrayMarker>

Source

pub fn ligature_count(&self) -> u16

Number of LigatureAttach table offsets

Source

pub fn ligature_attach_offsets(&self) -> &'a [BigEndian<Offset16>]

Array of offsets to LigatureAttach tables. Offsets are from beginning of LigatureArray table, ordered by ligatureCoverage index.

Source

pub fn ligature_attaches( &self, ) -> ArrayOfOffsets<'a, LigatureAttach<'a>, Offset16>

A dynamically resolving wrapper for ligature_attach_offsets.

Source§

impl<'a> TableRef<'a, LigatureAttachMarker>

Source

pub fn read( data: FontData<'a>, mark_class_count: u16, ) -> Result<Self, ReadError>

A constructor that requires additional arguments.

This type requires some external state in order to be parsed.

Source§

impl<'a> TableRef<'a, LigatureAttachMarker>

Source

pub fn component_count(&self) -> u16

Number of ComponentRecords in this ligature

Source

pub fn component_records(&self) -> ComputedArray<'a, ComponentRecord<'a>>

Array of Component records, ordered in writing direction.

Source§

impl<'a> TableRef<'a, MarkMarkPosFormat1Marker>

Source

pub fn pos_format(&self) -> u16

Format identifier: format = 1

Source

pub fn mark1_coverage_offset(&self) -> Offset16

Offset to Combining Mark Coverage table, from beginning of MarkMarkPos subtable.

Source

pub fn mark1_coverage(&self) -> Result<CoverageTable<'a>, ReadError>

Attempt to resolve mark1_coverage_offset.

Source

pub fn mark2_coverage_offset(&self) -> Offset16

Offset to Base Mark Coverage table, from beginning of MarkMarkPos subtable.

Source

pub fn mark2_coverage(&self) -> Result<CoverageTable<'a>, ReadError>

Attempt to resolve mark2_coverage_offset.

Source

pub fn mark_class_count(&self) -> u16

Number of Combining Mark classes defined

Source

pub fn mark1_array_offset(&self) -> Offset16

Offset to MarkArray table for mark1, from beginning of MarkMarkPos subtable.

Source

pub fn mark1_array(&self) -> Result<MarkArray<'a>, ReadError>

Attempt to resolve mark1_array_offset.

Source

pub fn mark2_array_offset(&self) -> Offset16

Offset to Mark2Array table for mark2, from beginning of MarkMarkPos subtable.

Source

pub fn mark2_array(&self) -> Result<Mark2Array<'a>, ReadError>

Attempt to resolve mark2_array_offset.

Source§

impl<'a> TableRef<'a, Mark2ArrayMarker>

Source

pub fn read( data: FontData<'a>, mark_class_count: u16, ) -> Result<Self, ReadError>

A constructor that requires additional arguments.

This type requires some external state in order to be parsed.

Source§

impl<'a> TableRef<'a, Mark2ArrayMarker>

Source

pub fn mark2_count(&self) -> u16

Number of Mark2 records

Source

pub fn mark2_records(&self) -> ComputedArray<'a, Mark2Record<'a>>

Array of Mark2Records, in Coverage order.

Source§

impl<'a, T> TableRef<'a, ExtensionPosFormat1Marker<T>>

Source

pub fn pos_format(&self) -> u16

Format identifier: format = 1

Source

pub fn extension_lookup_type(&self) -> u16

Lookup type of subtable referenced by extensionOffset (i.e. the extension subtable).

Source

pub fn extension_offset(&self) -> Offset32

Offset to the extension subtable, of lookup type extensionLookupType, relative to the start of the ExtensionPosFormat1 subtable.

Source

pub fn extension(&self) -> Result<T, ReadError>
where T: FontRead<'a>,

Attempt to resolve extension_offset.

Source§

impl TableRef<'_, GsubMarker>

Source

pub fn closure_glyphs( &self, glyphs: HashSet<GlyphId16>, ) -> Result<HashSet<GlyphId16>, ReadError>

Available on crate feature std only.

Return the set of glyphs reachable from the input set via any substitution.

Source§

impl<'a> TableRef<'a, GsubMarker>

Source

pub fn version(&self) -> MajorMinor

The major and minor version of the GSUB table, as a tuple (u16, u16)

Source

pub fn script_list_offset(&self) -> Offset16

Offset to ScriptList table, from beginning of GSUB table

Source

pub fn script_list(&self) -> Result<ScriptList<'a>, ReadError>

Attempt to resolve script_list_offset.

Source

pub fn feature_list_offset(&self) -> Offset16

Offset to FeatureList table, from beginning of GSUB table

Source

pub fn feature_list(&self) -> Result<FeatureList<'a>, ReadError>

Attempt to resolve feature_list_offset.

Source

pub fn lookup_list_offset(&self) -> Offset16

Offset to LookupList table, from beginning of GSUB table

Source

pub fn lookup_list(&self) -> Result<SubstitutionLookupList<'a>, ReadError>

Attempt to resolve lookup_list_offset.

Source

pub fn feature_variations_offset(&self) -> Option<Nullable<Offset32>>

Offset to FeatureVariations table, from beginning of the GSUB table (may be NULL)

Source

pub fn feature_variations( &self, ) -> Option<Result<FeatureVariations<'a>, ReadError>>

Attempt to resolve feature_variations_offset.

Source§

impl<'a> TableRef<'a, SingleSubstFormat1Marker>

Source

pub fn subst_format(&self) -> u16

Format identifier: format = 1

Source

pub fn coverage_offset(&self) -> Offset16

Offset to Coverage table, from beginning of substitution subtable

Source

pub fn coverage(&self) -> Result<CoverageTable<'a>, ReadError>

Attempt to resolve coverage_offset.

Source

pub fn delta_glyph_id(&self) -> i16

Add to original glyph ID to get substitute glyph ID

Source§

impl<'a> TableRef<'a, SingleSubstFormat2Marker>

Source

pub fn subst_format(&self) -> u16

Format identifier: format = 2

Source

pub fn coverage_offset(&self) -> Offset16

Offset to Coverage table, from beginning of substitution subtable

Source

pub fn coverage(&self) -> Result<CoverageTable<'a>, ReadError>

Attempt to resolve coverage_offset.

Source

pub fn glyph_count(&self) -> u16

Number of glyph IDs in the substituteGlyphIDs array

Source

pub fn substitute_glyph_ids(&self) -> &'a [BigEndian<GlyphId16>]

Array of substitute glyph IDs — ordered by Coverage index

Source§

impl<'a> TableRef<'a, MultipleSubstFormat1Marker>

Source

pub fn subst_format(&self) -> u16

Format identifier: format = 1

Source

pub fn coverage_offset(&self) -> Offset16

Offset to Coverage table, from beginning of substitution subtable

Source

pub fn coverage(&self) -> Result<CoverageTable<'a>, ReadError>

Attempt to resolve coverage_offset.

Source

pub fn sequence_count(&self) -> u16

Number of Sequence table offsets in the sequenceOffsets array

Source

pub fn sequence_offsets(&self) -> &'a [BigEndian<Offset16>]

Array of offsets to Sequence tables. Offsets are from beginning of substitution subtable, ordered by Coverage index

Source

pub fn sequences(&self) -> ArrayOfOffsets<'a, Sequence<'a>, Offset16>

A dynamically resolving wrapper for sequence_offsets.

Source§

impl<'a> TableRef<'a, SequenceMarker>

Source

pub fn glyph_count(&self) -> u16

Number of glyph IDs in the substituteGlyphIDs array. This must always be greater than 0.

Source

pub fn substitute_glyph_ids(&self) -> &'a [BigEndian<GlyphId16>]

String of glyph IDs to substitute

Source§

impl<'a> TableRef<'a, AlternateSubstFormat1Marker>

Source

pub fn subst_format(&self) -> u16

Format identifier: format = 1

Source

pub fn coverage_offset(&self) -> Offset16

Offset to Coverage table, from beginning of substitution subtable

Source

pub fn coverage(&self) -> Result<CoverageTable<'a>, ReadError>

Attempt to resolve coverage_offset.

Source

pub fn alternate_set_count(&self) -> u16

Number of AlternateSet tables

Source

pub fn alternate_set_offsets(&self) -> &'a [BigEndian<Offset16>]

Array of offsets to AlternateSet tables. Offsets are from beginning of substitution subtable, ordered by Coverage index

Source

pub fn alternate_sets(&self) -> ArrayOfOffsets<'a, AlternateSet<'a>, Offset16>

A dynamically resolving wrapper for alternate_set_offsets.

Source§

impl<'a> TableRef<'a, AlternateSetMarker>

Source

pub fn glyph_count(&self) -> u16

Number of glyph IDs in the alternateGlyphIDs array

Source

pub fn alternate_glyph_ids(&self) -> &'a [BigEndian<GlyphId16>]

Array of alternate glyph IDs, in arbitrary order

Source§

impl<'a> TableRef<'a, LigatureSubstFormat1Marker>

Source

pub fn subst_format(&self) -> u16

Format identifier: format = 1

Source

pub fn coverage_offset(&self) -> Offset16

Offset to Coverage table, from beginning of substitution subtable

Source

pub fn coverage(&self) -> Result<CoverageTable<'a>, ReadError>

Attempt to resolve coverage_offset.

Source

pub fn ligature_set_count(&self) -> u16

Number of LigatureSet tables

Source

pub fn ligature_set_offsets(&self) -> &'a [BigEndian<Offset16>]

Array of offsets to LigatureSet tables. Offsets are from beginning of substitution subtable, ordered by Coverage index

Source

pub fn ligature_sets(&self) -> ArrayOfOffsets<'a, LigatureSet<'a>, Offset16>

A dynamically resolving wrapper for ligature_set_offsets.

Source§

impl<'a> TableRef<'a, LigatureSetMarker>

Source

pub fn ligature_count(&self) -> u16

Number of Ligature tables

Source

pub fn ligature_offsets(&self) -> &'a [BigEndian<Offset16>]

Array of offsets to Ligature tables. Offsets are from beginning of LigatureSet table, ordered by preference.

Source

pub fn ligatures(&self) -> ArrayOfOffsets<'a, Ligature<'a>, Offset16>

A dynamically resolving wrapper for ligature_offsets.

Source§

impl<'a> TableRef<'a, LigatureMarker>

Source

pub fn ligature_glyph(&self) -> GlyphId16

glyph ID of ligature to substitute

Source

pub fn component_count(&self) -> u16

Number of components in the ligature

Source

pub fn component_glyph_ids(&self) -> &'a [BigEndian<GlyphId16>]

Array of component glyph IDs — start with the second component, ordered in writing direction

Source§

impl<'a, T> TableRef<'a, ExtensionSubstFormat1Marker<T>>

Source

pub fn subst_format(&self) -> u16

Format identifier. Set to 1.

Source

pub fn extension_lookup_type(&self) -> u16

Lookup type of subtable referenced by extensionOffset (that is, the extension subtable).

Source

pub fn extension_offset(&self) -> Offset32

Offset to the extension subtable, of lookup type extensionLookupType, relative to the start of the ExtensionSubstFormat1 subtable.

Source

pub fn extension(&self) -> Result<T, ReadError>
where T: FontRead<'a>,

Attempt to resolve extension_offset.

Source§

impl<'a> TableRef<'a, ReverseChainSingleSubstFormat1Marker>

Source

pub fn subst_format(&self) -> u16

Format identifier: format = 1

Source

pub fn coverage_offset(&self) -> Offset16

Offset to Coverage table, from beginning of substitution subtable.

Source

pub fn coverage(&self) -> Result<CoverageTable<'a>, ReadError>

Attempt to resolve coverage_offset.

Source

pub fn backtrack_glyph_count(&self) -> u16

Number of glyphs in the backtrack sequence.

Source

pub fn backtrack_coverage_offsets(&self) -> &'a [BigEndian<Offset16>]

Array of offsets to coverage tables in backtrack sequence, in glyph sequence order.

Source

pub fn backtrack_coverages( &self, ) -> ArrayOfOffsets<'a, CoverageTable<'a>, Offset16>

A dynamically resolving wrapper for backtrack_coverage_offsets.

Source

pub fn lookahead_glyph_count(&self) -> u16

Number of glyphs in lookahead sequence.

Source

pub fn lookahead_coverage_offsets(&self) -> &'a [BigEndian<Offset16>]

Array of offsets to coverage tables in lookahead sequence, in glyph sequence order.

Source

pub fn lookahead_coverages( &self, ) -> ArrayOfOffsets<'a, CoverageTable<'a>, Offset16>

A dynamically resolving wrapper for lookahead_coverage_offsets.

Source

pub fn glyph_count(&self) -> u16

Number of glyph IDs in the substituteGlyphIDs array.

Source

pub fn substitute_glyph_ids(&self) -> &'a [BigEndian<GlyphId16>]

Array of substitute glyph IDs — ordered by Coverage index.

Source§

impl<'a> TableRef<'a, GvarMarker>

Source

pub fn version(&self) -> MajorMinor

Major/minor version number of the glyph variations table — set to (1,0).

Source

pub fn axis_count(&self) -> u16

The number of variation axes for this font. This must be the same number as axisCount in the ‘fvar’ table.

Source

pub fn shared_tuple_count(&self) -> u16

The number of shared tuple records. Shared tuple records can be referenced within glyph variation data tables for multiple glyphs, as opposed to other tuple records stored directly within a glyph variation data table.

Source

pub fn shared_tuples_offset(&self) -> Offset32

Offset from the start of this table to the shared tuple records.

Source

pub fn shared_tuples(&self) -> Result<SharedTuples<'a>, ReadError>

Attempt to resolve shared_tuples_offset.

Source

pub fn glyph_count(&self) -> u16

The number of glyphs in this font. This must match the number of glyphs stored elsewhere in the font.

Source

pub fn flags(&self) -> GvarFlags

Bit-field that gives the format of the offset array that follows. If bit 0 is clear, the offsets are uint16; if bit 0 is set, the offsets are uint32.

Source

pub fn glyph_variation_data_array_offset(&self) -> u32

Offset from the start of this table to the array of GlyphVariationData tables.

Source

pub fn glyph_variation_data_offsets(&self) -> ComputedArray<'a, U16Or32>

Offsets from the start of the GlyphVariationData array to each GlyphVariationData table.

Source§

impl<'a> TableRef<'a, SharedTuplesMarker>

Source

pub fn read( data: FontData<'a>, shared_tuple_count: u16, axis_count: u16, ) -> Result<Self, ReadError>

A constructor that requires additional arguments.

This type requires some external state in order to be parsed.

Source§

impl<'a> TableRef<'a, SharedTuplesMarker>

Source

pub fn tuples(&self) -> ComputedArray<'a, Tuple<'a>>

Source§

impl<'a> TableRef<'a, GlyphVariationDataHeaderMarker>

Source

pub fn tuple_variation_count(&self) -> TupleVariationCount

A packed field. The high 4 bits are flags, and the low 12 bits are the number of tuple variation tables for this glyph. The number of tuple variation tables can be any number between 1 and 4095.

Source

pub fn serialized_data_offset(&self) -> Offset16

Offset from the start of the GlyphVariationData table to the serialized data

Source

pub fn serialized_data(&self) -> Result<FontData<'a>, ReadError>

Attempt to resolve serialized_data_offset.

Source

pub fn tuple_variation_headers( &self, ) -> VarLenArray<'a, TupleVariationHeader<'_>>

Array of tuple variation headers.

Source§

impl<'a> TableRef<'a, GvarMarker>

Source

pub fn data_for_gid(&self, gid: GlyphId) -> Result<FontData<'a>, ReadError>

Source

pub fn glyph_variation_data( &self, gid: GlyphId, ) -> Result<GlyphVariationData<'a>, ReadError>

Get the variation data for a specific glyph.

Source

pub fn phantom_point_deltas( &self, glyf: &Glyf<'_>, loca: &Loca<'_>, coords: &[F2Dot14], glyph_id: GlyphId, ) -> Result<[Point<Fixed>; 4], ReadError>

Returns the phantom point deltas for the given variation coordinates and glyph identifier.

The resulting array will contain four deltas: [left, right, top, bottom].

Source§

impl<'a> TableRef<'a, HdmxMarker>

Source

pub fn read(data: FontData<'a>, num_glyphs: u16) -> Result<Self, ReadError>

A constructor that requires additional arguments.

This type requires some external state in order to be parsed.

Source§

impl<'a> TableRef<'a, HdmxMarker>

Source

pub fn version(&self) -> u16

Table version number (set to 0).

Source

pub fn num_records(&self) -> u16

Number of device records.

Source

pub fn size_device_record(&self) -> u32

Size of device record, 32-bit aligned.

Source

pub fn records(&self) -> ComputedArray<'a, DeviceRecord<'a>>

Array of device records.

Source§

impl<'a> TableRef<'a, HdmxMarker>

Source

pub fn record_for_size(&self, size: u8) -> Option<DeviceRecord<'a>>

Returns for the device record that exactly matches the given size (as ppem).

Source§

impl<'a> TableRef<'a, HeadMarker>

Source

pub fn version(&self) -> MajorMinor

Version number of the font header table, set to (1, 0)

Source

pub fn font_revision(&self) -> Fixed

Set by font manufacturer.

Source

pub fn checksum_adjustment(&self) -> u32

To compute: set it to 0, sum the entire font as uint32, then store 0xB1B0AFBA - sum. If the font is used as a component in a font collection file, the value of this field will be invalidated by changes to the file structure and font table directory, and must be ignored.

Source

pub fn magic_number(&self) -> u32

Set to 0x5F0F3CF5.

Source

pub fn flags(&self) -> u16

See the flags enum

Source

pub fn units_per_em(&self) -> u16

Set to a value from 16 to 16384. Any value in this range is valid. In fonts that have TrueType outlines, a power of 2 is recommended as this allows performance optimizations in some rasterizers.

Source

pub fn created(&self) -> LongDateTime

Number of seconds since 12:00 midnight that started January 1st 1904 in GMT/UTC time zone.

Source

pub fn modified(&self) -> LongDateTime

Number of seconds since 12:00 midnight that started January 1st 1904 in GMT/UTC time zone.

Source

pub fn x_min(&self) -> i16

Minimum x coordinate across all glyph bounding boxes.

Source

pub fn y_min(&self) -> i16

Minimum y coordinate across all glyph bounding boxes.

Source

pub fn x_max(&self) -> i16

Maximum x coordinate across all glyph bounding boxes.

Source

pub fn y_max(&self) -> i16

Maximum y coordinate across all glyph bounding boxes.

Source

pub fn mac_style(&self) -> MacStyle

Bits identifying the font’s style; see MacStyle

Source

pub fn lowest_rec_ppem(&self) -> u16

Smallest readable size in pixels.

Source

pub fn font_direction_hint(&self) -> i16

Deprecated (Set to 2).

Source

pub fn index_to_loc_format(&self) -> i16

0 for short offsets (Offset16), 1 for long (Offset32).

Source

pub fn glyph_data_format(&self) -> i16

0 for current format.

Source§

impl<'a> TableRef<'a, HheaMarker>

Source

pub fn version(&self) -> MajorMinor

The major/minor version (1, 0)

Source

pub fn ascender(&self) -> FWord

Typographic ascent.

Source

pub fn descender(&self) -> FWord

Typographic descent.

Source

pub fn line_gap(&self) -> FWord

Typographic line gap. Negative LineGap values are treated as zero in some legacy platform implementations.

Source

pub fn advance_width_max(&self) -> UfWord

Maximum advance width value in ‘hmtx’ table.

Source

pub fn min_left_side_bearing(&self) -> FWord

Minimum left sidebearing value in ‘hmtx’ table for glyphs with contours (empty glyphs should be ignored).

Source

pub fn min_right_side_bearing(&self) -> FWord

Minimum right sidebearing value; calculated as min(aw - (lsb + xMax - xMin)) for glyphs with contours (empty glyphs should be ignored).

Source

pub fn x_max_extent(&self) -> FWord

Max(lsb + (xMax-xMin))

Source

pub fn caret_slope_rise(&self) -> i16

Used to calculate the slope of the cursor (rise/run); 1 for vertical caret, 0 for horizontal.

Source

pub fn caret_slope_run(&self) -> i16

0 for vertical caret, 1 for horizontal.

Source

pub fn caret_offset(&self) -> i16

The amount by which a slanted highlight on a glyph needs to be shifted to produce the best appearance. Set to 0 for non-slanted fonts

Source

pub fn metric_data_format(&self) -> i16

0 for current format.

Source

pub fn number_of_long_metrics(&self) -> u16

Number of LongMetric entries in ‘hmtx’/‘vmtx’ table

Source§

impl<'a> TableRef<'a, HmtxMarker>

Source

pub fn read( data: FontData<'a>, number_of_h_metrics: u16, num_glyphs: u16, ) -> Result<Self, ReadError>

A constructor that requires additional arguments.

This type requires some external state in order to be parsed.

Source§

impl<'a> TableRef<'a, HmtxMarker>

Source

pub fn h_metrics(&self) -> &'a [LongMetric]

Paired advance width/height and left/top side bearing values for each glyph. Records are indexed by glyph ID.

Source

pub fn left_side_bearings(&self) -> &'a [BigEndian<i16>]

Leading (left/top) side bearings for glyph IDs greater than or equal to numberOfLongMetrics.

Source§

impl TableRef<'_, HmtxMarker>

Source

pub fn advance(&self, glyph_id: GlyphId) -> Option<u16>

Returns the advance width for the given glyph identifier.

Source

pub fn side_bearing(&self, glyph_id: GlyphId) -> Option<i16>

Returns the left side bearing for the given glyph identifier.

Source§

impl<'a> TableRef<'a, HvarMarker>

Source

pub fn version(&self) -> MajorMinor

Major version number of the horizontal metrics variations table — set to 1. Minor version number of the horizontal metrics variations table — set to 0.

Source

pub fn item_variation_store_offset(&self) -> Offset32

Offset in bytes from the start of this table to the item variation store table.

Source

pub fn item_variation_store(&self) -> Result<ItemVariationStore<'a>, ReadError>

Attempt to resolve item_variation_store_offset.

Source

pub fn advance_width_mapping_offset(&self) -> Nullable<Offset32>

Offset in bytes from the start of this table to the delta-set index mapping for advance widths (may be NULL).

Source

pub fn advance_width_mapping( &self, ) -> Option<Result<DeltaSetIndexMap<'a>, ReadError>>

Attempt to resolve advance_width_mapping_offset.

Source

pub fn lsb_mapping_offset(&self) -> Nullable<Offset32>

Offset in bytes from the start of this table to the delta-set index mapping for left side bearings (may be NULL).

Source

pub fn lsb_mapping(&self) -> Option<Result<DeltaSetIndexMap<'a>, ReadError>>

Attempt to resolve lsb_mapping_offset.

Source

pub fn rsb_mapping_offset(&self) -> Nullable<Offset32>

Offset in bytes from the start of this table to the delta-set index mapping for right side bearings (may be NULL).

Source

pub fn rsb_mapping(&self) -> Option<Result<DeltaSetIndexMap<'a>, ReadError>>

Attempt to resolve rsb_mapping_offset.

Source§

impl TableRef<'_, HvarMarker>

Source

pub fn advance_width_delta( &self, glyph_id: GlyphId, coords: &[F2Dot14], ) -> Result<Fixed, ReadError>

Returns the advance width delta for the specified glyph identifier and normalized variation coordinates.

Source

pub fn lsb_delta( &self, glyph_id: GlyphId, coords: &[F2Dot14], ) -> Result<Fixed, ReadError>

Returns the left side bearing delta for the specified glyph identifier and normalized variation coordinates.

Source

pub fn rsb_delta( &self, glyph_id: GlyphId, coords: &[F2Dot14], ) -> Result<Fixed, ReadError>

Returns the left side bearing delta for the specified glyph identifier and normalized variation coordinates.

Source§

impl<'a> TableRef<'a, PatchMapFormat1Marker>

Source

pub fn format(&self) -> u8

Format identifier: format = 1

Source

pub fn compatibility_id(&self) -> CompatibilityId

Unique ID that identifies compatible patches.

Source

pub fn max_entry_index(&self) -> u16

Largest entry index which appears in either the glyph map or feature map.

Source

pub fn max_glyph_map_entry_index(&self) -> u16

Largest entry index which appears in the glyph map.

Source

pub fn glyph_count(&self) -> Uint24

Source

pub fn glyph_map_offset(&self) -> Offset32

Sub table that maps glyph ids to entry indices.

Source

pub fn glyph_map(&self) -> Result<GlyphMap<'a>, ReadError>

Attempt to resolve glyph_map_offset.

Source

pub fn feature_map_offset(&self) -> Nullable<Offset32>

Sub table that maps feature and glyph ids to entry indices.

Source

pub fn feature_map(&self) -> Option<Result<FeatureMap<'a>, ReadError>>

Attempt to resolve feature_map_offset.

Source

pub fn applied_entries_bitmap(&self) -> &'a [u8]

Source

pub fn uri_template_length(&self) -> u16

Source

pub fn uri_template(&self) -> &'a [u8]

Source

pub fn patch_format(&self) -> u8

Patch format number for patches referenced by this mapping.

Source§

impl<'a> TableRef<'a, GlyphMapMarker>

Source

pub fn read( data: FontData<'a>, glyph_count: Uint24, max_entry_index: u16, ) -> Result<Self, ReadError>

A constructor that requires additional arguments.

This type requires some external state in order to be parsed.

Source§

impl<'a> TableRef<'a, GlyphMapMarker>

Source

pub fn first_mapped_glyph(&self) -> u16

Source

pub fn entry_index(&self) -> ComputedArray<'a, U8Or16>

Source§

impl<'a> TableRef<'a, FeatureMapMarker>

Source

pub fn read(data: FontData<'a>, max_entry_index: u16) -> Result<Self, ReadError>

A constructor that requires additional arguments.

This type requires some external state in order to be parsed.

Source§

impl<'a> TableRef<'a, FeatureMapMarker>

Source

pub fn feature_count(&self) -> u16

Source

pub fn feature_records(&self) -> ComputedArray<'a, FeatureRecord>

Source

pub fn entry_map_data(&self) -> &'a [u8]

Source§

impl<'a> TableRef<'a, PatchMapFormat2Marker>

Source

pub fn format(&self) -> u8

Format identifier: format = 2

Source

pub fn compatibility_id(&self) -> CompatibilityId

Unique ID that identifies compatible patches.

Source

pub fn default_patch_format(&self) -> u8

Patch format number for patches referenced by this mapping.

Source

pub fn entry_count(&self) -> Uint24

Source

pub fn entries_offset(&self) -> Offset32

Source

pub fn entries(&self) -> Result<MappingEntries<'a>, ReadError>

Attempt to resolve entries_offset.

Source

pub fn entry_id_string_data_offset(&self) -> Nullable<Offset32>

Source

pub fn entry_id_string_data( &self, ) -> Option<Result<IdStringData<'a>, ReadError>>

Attempt to resolve entry_id_string_data_offset.

Source

pub fn uri_template_length(&self) -> u16

Source

pub fn uri_template(&self) -> &'a [u8]

Source§

impl<'a> TableRef<'a, MappingEntriesMarker>

Source

pub fn entry_data(&self) -> &'a [u8]

Source§

impl<'a> TableRef<'a, EntryDataMarker>

Source

pub fn read( data: FontData<'a>, entry_id_string_data_offset: Offset32, ) -> Result<Self, ReadError>

A constructor that requires additional arguments.

This type requires some external state in order to be parsed.

Source§

impl<'a> TableRef<'a, EntryDataMarker>

Source

pub fn format_flags(&self) -> EntryFormatFlags

Source

pub fn feature_count(&self) -> Option<u8>

Source

pub fn feature_tags(&self) -> Option<&'a [BigEndian<Tag>]>

Source

pub fn design_space_count(&self) -> Option<u16>

Source

pub fn design_space_segments(&self) -> Option<&'a [DesignSpaceSegment]>

Source

pub fn copy_count(&self) -> Option<u8>

Source

pub fn copy_indices(&self) -> Option<&'a [BigEndian<Uint24>]>

Source

pub fn entry_id_delta(&self) -> Option<IdDeltaOrLength>

Source

pub fn patch_format(&self) -> Option<u8>

Source

pub fn codepoint_data(&self) -> &'a [u8]

Source§

impl<'a> TableRef<'a, IdStringDataMarker>

Source

pub fn id_data(&self) -> &'a [u8]

Source§

impl<'a> TableRef<'a, TableKeyedPatchMarker>

Source

pub fn format(&self) -> Tag

Source

pub fn compatibility_id(&self) -> CompatibilityId

Unique ID that identifies compatible patches.

Source

pub fn patches_count(&self) -> u16

Source

pub fn patch_offsets(&self) -> &'a [BigEndian<Offset32>]

Source

pub fn patches(&self) -> ArrayOfOffsets<'a, TablePatch<'a>, Offset32>

A dynamically resolving wrapper for patch_offsets.

Source§

impl<'a> TableRef<'a, TablePatchMarker>

Source

pub fn tag(&self) -> Tag

Source

pub fn flags(&self) -> TablePatchFlags

Source

pub fn max_uncompressed_length(&self) -> u32

Source

pub fn brotli_stream(&self) -> &'a [u8]

Source§

impl<'a> TableRef<'a, GlyphKeyedPatchMarker>

Source

pub fn format(&self) -> Tag

Source

pub fn flags(&self) -> GlyphKeyedFlags

Source

pub fn compatibility_id(&self) -> CompatibilityId

Source

pub fn max_uncompressed_length(&self) -> u32

Source

pub fn brotli_stream(&self) -> &'a [u8]

Source§

impl<'a> TableRef<'a, GlyphPatchesMarker>

Source

pub fn read( data: FontData<'a>, flags: GlyphKeyedFlags, ) -> Result<Self, ReadError>

A constructor that requires additional arguments.

This type requires some external state in order to be parsed.

Source§

impl<'a> TableRef<'a, GlyphPatchesMarker>

Source

pub fn glyph_count(&self) -> u32

Source

pub fn table_count(&self) -> u8

Source

pub fn glyph_ids(&self) -> ComputedArray<'a, U16Or24>

Source

pub fn tables(&self) -> &'a [BigEndian<Tag>]

Source

pub fn glyph_data_offsets(&self) -> &'a [BigEndian<Offset32>]

Source

pub fn glyph_data(&self) -> ArrayOfOffsets<'a, GlyphData<'a>, Offset32>

A dynamically resolving wrapper for glyph_data_offsets.

Source§

impl<'a> TableRef<'a, GlyphDataMarker>

Source

pub fn data(&self) -> &'a [u8]

Source§

impl<'a> TableRef<'a, PatchMapFormat1Marker>

Source

pub fn gid_to_entry_iter(&'a self) -> impl Iterator<Item = (GlyphId, u16)> + 'a

Source

pub fn entry_count(&self) -> u32

Source

pub fn uri_template_as_string(&self) -> Result<&str, ReadError>

Source

pub fn is_entry_applied(&self, entry_index: u16) -> bool

Source§

impl TableRef<'_, PatchMapFormat2Marker>

Source§

impl TableRef<'_, FeatureMapMarker>

Source

pub fn entry_records_size( &self, max_entry_index: u16, ) -> Result<usize, ReadError>

Source§

impl<'a> TableRef<'a, GlyphPatchesMarker>

Source

pub fn glyph_data_for_table( &'a self, table_index: usize, ) -> impl Iterator<Item = Result<(GlyphId, &'a [u8]), ReadError>>

Returns an iterator over the per glyph data for the table with the given index.

Source§

impl<'a> TableRef<'a, FeatureListMarker>

Source

pub fn get(&self, index: u16) -> Result<TaggedElement<Feature<'a>>, ReadError>

Returns the tag and feature at the given index.

Source§

impl<'a> TableRef<'a, ScriptListMarker>

Source

pub fn index_for_tag(&self, tag: Tag) -> Option<u16>

Returns the index of the script with the given tag.

Source

pub fn get(&self, index: u16) -> Result<TaggedElement<Script<'a>>, ReadError>

Returns the tag and script at the given index.

Source

pub fn select(&self, tags: &[Tag]) -> Option<SelectedScript>

Finds the first available script that matches one of the given tags.

When none of the requested scripts are available, then DFLT, dflt and latn tags are tried in that order.

If you’re starting from a Unicode script code, use the ScriptTags::from_unicode function to generate the appropriate set of tags to pass to this method.

See hb_ot_layout_table_select_script for the corresponding HarfBuzz function.

Source§

impl<'a> TableRef<'a, ScriptMarker>

Source

pub fn lang_sys_index_for_tag(&self, tag: Tag) -> Option<u16>

If the script contains a language system with the given tag, returns the index.

Source

pub fn lang_sys( &self, index: u16, ) -> Result<TaggedElement<LangSys<'a>>, ReadError>

Returns the language system with the given index.

Source§

impl TableRef<'_, LangSysMarker>

Source

pub fn feature_index_for_tag( &self, list: &FeatureList<'_>, tag: Tag, ) -> Option<u16>

If the language system references a feature with the given tag, returns the index of that feature in the specified feature list.

The feature list can be obtained from the feature_list method on the parent Gsub or Gpos tables.

Source§

impl<'a> TableRef<'a, ScriptListMarker>

Source

pub fn script_count(&self) -> u16

Number of ScriptRecords

Source

pub fn script_records(&self) -> &'a [ScriptRecord]

Array of ScriptRecords, listed alphabetically by script tag

Source§

impl<'a> TableRef<'a, ScriptMarker>

Source

pub fn default_lang_sys_offset(&self) -> Nullable<Offset16>

Offset to default LangSys table, from beginning of Script table — may be NULL

Source

pub fn default_lang_sys(&self) -> Option<Result<LangSys<'a>, ReadError>>

Attempt to resolve default_lang_sys_offset.

Source

pub fn lang_sys_count(&self) -> u16

Number of LangSysRecords for this script — excluding the default LangSys

Source

pub fn lang_sys_records(&self) -> &'a [LangSysRecord]

Array of LangSysRecords, listed alphabetically by LangSys tag

Source§

impl<'a> TableRef<'a, LangSysMarker>

Source

pub fn required_feature_index(&self) -> u16

Index of a feature required for this language system; if no required features = 0xFFFF

Source

pub fn feature_index_count(&self) -> u16

Number of feature index values for this language system — excludes the required feature

Source

pub fn feature_indices(&self) -> &'a [BigEndian<u16>]

Array of indices into the FeatureList, in arbitrary order

Source§

impl<'a> TableRef<'a, FeatureListMarker>

Source

pub fn feature_count(&self) -> u16

Number of FeatureRecords in this table

Source

pub fn feature_records(&self) -> &'a [FeatureRecord]

Array of FeatureRecords — zero-based (first feature has FeatureIndex = 0), listed alphabetically by feature tag

Source§

impl<'a> TableRef<'a, FeatureMarker>

Source

pub fn read(data: FontData<'a>, feature_tag: Tag) -> Result<Self, ReadError>

A constructor that requires additional arguments.

This type requires some external state in order to be parsed.

Source§

impl<'a> TableRef<'a, FeatureMarker>

Source

pub fn feature_params_offset(&self) -> Nullable<Offset16>

Offset from start of Feature table to FeatureParams table, if defined for the feature and present, else NULL

Source

pub fn feature_params(&self) -> Option<Result<FeatureParams<'a>, ReadError>>

Attempt to resolve feature_params_offset.

Source

pub fn lookup_index_count(&self) -> u16

Number of LookupList indices for this feature

Source

pub fn lookup_list_indices(&self) -> &'a [BigEndian<u16>]

Array of indices into the LookupList — zero-based (first lookup is LookupListIndex = 0)

Source§

impl<'a, T> TableRef<'a, LookupListMarker<T>>

Source

pub fn lookup_count(&self) -> u16

Number of lookups in this table

Source

pub fn lookup_offsets(&self) -> &'a [BigEndian<Offset16>]

Array of offsets to Lookup tables, from beginning of LookupList — zero based (first lookup is Lookup index = 0)

Source

pub fn lookups(&self) -> ArrayOfOffsets<'a, T, Offset16>
where T: FontRead<'a>,

A dynamically resolving wrapper for lookup_offsets.

Source§

impl<'a, T> TableRef<'a, LookupMarker<T>>

Source

pub fn lookup_type(&self) -> u16

Different enumerations for GSUB and GPOS

Source

pub fn lookup_flag(&self) -> LookupFlag

Lookup qualifiers

Source

pub fn sub_table_count(&self) -> u16

Number of subtables for this lookup

Source

pub fn subtable_offsets(&self) -> &'a [BigEndian<Offset16>]

Array of offsets to lookup subtables, from beginning of Lookup table

Source

pub fn subtables(&self) -> ArrayOfOffsets<'a, T, Offset16>
where T: FontRead<'a>,

A dynamically resolving wrapper for subtable_offsets.

Source

pub fn mark_filtering_set(&self) -> Option<u16>

Index (base 0) into GDEF mark glyph sets structure. This field is only present if the USE_MARK_FILTERING_SET lookup flag is set.

Source§

impl<'a> TableRef<'a, CoverageFormat1Marker>

Source

pub fn coverage_format(&self) -> u16

Format identifier — format = 1

Source

pub fn glyph_count(&self) -> u16

Number of glyphs in the glyph array

Source

pub fn glyph_array(&self) -> &'a [BigEndian<GlyphId16>]

Array of glyph IDs — in numerical order

Source§

impl<'a> TableRef<'a, CoverageFormat2Marker>

Source

pub fn coverage_format(&self) -> u16

Format identifier — format = 2

Source

pub fn range_count(&self) -> u16

Number of RangeRecords

Source

pub fn range_records(&self) -> &'a [RangeRecord]

Array of glyph ranges — ordered by startGlyphID.

Source§

impl<'a> TableRef<'a, ClassDefFormat1Marker>

Source

pub fn class_format(&self) -> u16

Format identifier — format = 1

Source

pub fn start_glyph_id(&self) -> GlyphId16

First glyph ID of the classValueArray

Source

pub fn glyph_count(&self) -> u16

Size of the classValueArray

Source

pub fn class_value_array(&self) -> &'a [BigEndian<u16>]

Array of Class Values — one per glyph ID

Source§

impl<'a> TableRef<'a, ClassDefFormat2Marker>

Source

pub fn class_format(&self) -> u16

Format identifier — format = 2

Source

pub fn class_range_count(&self) -> u16

Number of ClassRangeRecords

Source

pub fn class_range_records(&self) -> &'a [ClassRangeRecord]

Array of ClassRangeRecords — ordered by startGlyphID

Source§

impl<'a> TableRef<'a, SequenceContextFormat1Marker>

Source

pub fn format(&self) -> u16

Format identifier: format = 1

Source

pub fn coverage_offset(&self) -> Offset16

Offset to Coverage table, from beginning of SequenceContextFormat1 table

Source

pub fn coverage(&self) -> Result<CoverageTable<'a>, ReadError>

Attempt to resolve coverage_offset.

Source

pub fn seq_rule_set_count(&self) -> u16

Number of SequenceRuleSet tables

Source

pub fn seq_rule_set_offsets(&self) -> &'a [BigEndian<Nullable<Offset16>>]

Array of offsets to SequenceRuleSet tables, from beginning of SequenceContextFormat1 table (offsets may be NULL)

Source

pub fn seq_rule_sets( &self, ) -> ArrayOfNullableOffsets<'a, SequenceRuleSet<'a>, Offset16>

A dynamically resolving wrapper for seq_rule_set_offsets.

Source§

impl<'a> TableRef<'a, SequenceRuleSetMarker>

Source

pub fn seq_rule_count(&self) -> u16

Number of SequenceRule tables

Source

pub fn seq_rule_offsets(&self) -> &'a [BigEndian<Offset16>]

Array of offsets to SequenceRule tables, from beginning of the SequenceRuleSet table

Source

pub fn seq_rules(&self) -> ArrayOfOffsets<'a, SequenceRule<'a>, Offset16>

A dynamically resolving wrapper for seq_rule_offsets.

Source§

impl<'a> TableRef<'a, SequenceRuleMarker>

Source

pub fn glyph_count(&self) -> u16

Number of glyphs in the input glyph sequence

Source

pub fn seq_lookup_count(&self) -> u16

Number of SequenceLookupRecords

Source

pub fn input_sequence(&self) -> &'a [BigEndian<GlyphId16>]

Array of input glyph IDs—starting with the second glyph

Source

pub fn seq_lookup_records(&self) -> &'a [SequenceLookupRecord]

Array of Sequence lookup records

Source§

impl<'a> TableRef<'a, SequenceContextFormat2Marker>

Source

pub fn format(&self) -> u16

Format identifier: format = 2

Source

pub fn coverage_offset(&self) -> Offset16

Offset to Coverage table, from beginning of SequenceContextFormat2 table

Source

pub fn coverage(&self) -> Result<CoverageTable<'a>, ReadError>

Attempt to resolve coverage_offset.

Source

pub fn class_def_offset(&self) -> Offset16

Offset to ClassDef table, from beginning of SequenceContextFormat2 table

Source

pub fn class_def(&self) -> Result<ClassDef<'a>, ReadError>

Attempt to resolve class_def_offset.

Source

pub fn class_seq_rule_set_count(&self) -> u16

Number of ClassSequenceRuleSet tables

Source

pub fn class_seq_rule_set_offsets(&self) -> &'a [BigEndian<Nullable<Offset16>>]

Array of offsets to ClassSequenceRuleSet tables, from beginning of SequenceContextFormat2 table (may be NULL)

Source

pub fn class_seq_rule_sets( &self, ) -> ArrayOfNullableOffsets<'a, ClassSequenceRuleSet<'a>, Offset16>

A dynamically resolving wrapper for class_seq_rule_set_offsets.

Source§

impl<'a> TableRef<'a, ClassSequenceRuleSetMarker>

Source

pub fn class_seq_rule_count(&self) -> u16

Number of ClassSequenceRule tables

Source

pub fn class_seq_rule_offsets(&self) -> &'a [BigEndian<Offset16>]

Array of offsets to ClassSequenceRule tables, from beginning of ClassSequenceRuleSet table

Source

pub fn class_seq_rules( &self, ) -> ArrayOfOffsets<'a, ClassSequenceRule<'a>, Offset16>

A dynamically resolving wrapper for class_seq_rule_offsets.

Source§

impl<'a> TableRef<'a, ClassSequenceRuleMarker>

Source

pub fn glyph_count(&self) -> u16

Number of glyphs to be matched

Source

pub fn seq_lookup_count(&self) -> u16

Number of SequenceLookupRecords

Source

pub fn input_sequence(&self) -> &'a [BigEndian<u16>]

Sequence of classes to be matched to the input glyph sequence, beginning with the second glyph position

Source

pub fn seq_lookup_records(&self) -> &'a [SequenceLookupRecord]

Array of SequenceLookupRecords

Source§

impl<'a> TableRef<'a, SequenceContextFormat3Marker>

Source

pub fn format(&self) -> u16

Format identifier: format = 3

Source

pub fn glyph_count(&self) -> u16

Number of glyphs in the input sequence

Source

pub fn seq_lookup_count(&self) -> u16

Number of SequenceLookupRecords

Source

pub fn coverage_offsets(&self) -> &'a [BigEndian<Offset16>]

Array of offsets to Coverage tables, from beginning of SequenceContextFormat3 subtable

Source

pub fn coverages(&self) -> ArrayOfOffsets<'a, CoverageTable<'a>, Offset16>

A dynamically resolving wrapper for coverage_offsets.

Source

pub fn seq_lookup_records(&self) -> &'a [SequenceLookupRecord]

Array of SequenceLookupRecords

Source§

impl<'a> TableRef<'a, ChainedSequenceContextFormat1Marker>

Source

pub fn format(&self) -> u16

Format identifier: format = 1

Source

pub fn coverage_offset(&self) -> Offset16

Offset to Coverage table, from beginning of ChainSequenceContextFormat1 table

Source

pub fn coverage(&self) -> Result<CoverageTable<'a>, ReadError>

Attempt to resolve coverage_offset.

Source

pub fn chained_seq_rule_set_count(&self) -> u16

Number of ChainedSequenceRuleSet tables

Source

pub fn chained_seq_rule_set_offsets( &self, ) -> &'a [BigEndian<Nullable<Offset16>>]

Array of offsets to ChainedSeqRuleSet tables, from beginning of ChainedSequenceContextFormat1 table (may be NULL)

Source

pub fn chained_seq_rule_sets( &self, ) -> ArrayOfNullableOffsets<'a, ChainedSequenceRuleSet<'a>, Offset16>

A dynamically resolving wrapper for chained_seq_rule_set_offsets.

Source§

impl<'a> TableRef<'a, ChainedSequenceRuleSetMarker>

Source

pub fn chained_seq_rule_count(&self) -> u16

Number of ChainedSequenceRule tables

Source

pub fn chained_seq_rule_offsets(&self) -> &'a [BigEndian<Offset16>]

Array of offsets to ChainedSequenceRule tables, from beginning of ChainedSequenceRuleSet table

Source

pub fn chained_seq_rules( &self, ) -> ArrayOfOffsets<'a, ChainedSequenceRule<'a>, Offset16>

A dynamically resolving wrapper for chained_seq_rule_offsets.

Source§

impl<'a> TableRef<'a, ChainedSequenceRuleMarker>

Source

pub fn backtrack_glyph_count(&self) -> u16

Number of glyphs in the backtrack sequence

Source

pub fn backtrack_sequence(&self) -> &'a [BigEndian<GlyphId16>]

Array of backtrack glyph IDs

Source

pub fn input_glyph_count(&self) -> u16

Number of glyphs in the input sequence

Source

pub fn input_sequence(&self) -> &'a [BigEndian<GlyphId16>]

Array of input glyph IDs—start with second glyph

Source

pub fn lookahead_glyph_count(&self) -> u16

Number of glyphs in the lookahead sequence

Source

pub fn lookahead_sequence(&self) -> &'a [BigEndian<GlyphId16>]

Array of lookahead glyph IDs

Source

pub fn seq_lookup_count(&self) -> u16

Number of SequenceLookupRecords

Source

pub fn seq_lookup_records(&self) -> &'a [SequenceLookupRecord]

Array of SequenceLookupRecords

Source§

impl<'a> TableRef<'a, ChainedSequenceContextFormat2Marker>

Source

pub fn format(&self) -> u16

Format identifier: format = 2

Source

pub fn coverage_offset(&self) -> Offset16

Offset to Coverage table, from beginning of ChainedSequenceContextFormat2 table

Source

pub fn coverage(&self) -> Result<CoverageTable<'a>, ReadError>

Attempt to resolve coverage_offset.

Source

pub fn backtrack_class_def_offset(&self) -> Offset16

Offset to ClassDef table containing backtrack sequence context, from beginning of ChainedSequenceContextFormat2 table

Source

pub fn backtrack_class_def(&self) -> Result<ClassDef<'a>, ReadError>

Attempt to resolve backtrack_class_def_offset.

Source

pub fn input_class_def_offset(&self) -> Offset16

Offset to ClassDef table containing input sequence context, from beginning of ChainedSequenceContextFormat2 table

Source

pub fn input_class_def(&self) -> Result<ClassDef<'a>, ReadError>

Attempt to resolve input_class_def_offset.

Source

pub fn lookahead_class_def_offset(&self) -> Offset16

Offset to ClassDef table containing lookahead sequence context, from beginning of ChainedSequenceContextFormat2 table

Source

pub fn lookahead_class_def(&self) -> Result<ClassDef<'a>, ReadError>

Attempt to resolve lookahead_class_def_offset.

Source

pub fn chained_class_seq_rule_set_count(&self) -> u16

Number of ChainedClassSequenceRuleSet tables

Source

pub fn chained_class_seq_rule_set_offsets( &self, ) -> &'a [BigEndian<Nullable<Offset16>>]

Array of offsets to ChainedClassSequenceRuleSet tables, from beginning of ChainedSequenceContextFormat2 table (may be NULL)

Source

pub fn chained_class_seq_rule_sets( &self, ) -> ArrayOfNullableOffsets<'a, ChainedClassSequenceRuleSet<'a>, Offset16>

A dynamically resolving wrapper for chained_class_seq_rule_set_offsets.

Source§

impl<'a> TableRef<'a, ChainedClassSequenceRuleSetMarker>

Source

pub fn chained_class_seq_rule_count(&self) -> u16

Number of ChainedClassSequenceRule tables

Source

pub fn chained_class_seq_rule_offsets(&self) -> &'a [BigEndian<Offset16>]

Array of offsets to ChainedClassSequenceRule tables, from beginning of ChainedClassSequenceRuleSet

Source

pub fn chained_class_seq_rules( &self, ) -> ArrayOfOffsets<'a, ChainedClassSequenceRule<'a>, Offset16>

A dynamically resolving wrapper for chained_class_seq_rule_offsets.

Source§

impl<'a> TableRef<'a, ChainedClassSequenceRuleMarker>

Source

pub fn backtrack_glyph_count(&self) -> u16

Number of glyphs in the backtrack sequence

Source

pub fn backtrack_sequence(&self) -> &'a [BigEndian<u16>]

Array of backtrack-sequence classes

Source

pub fn input_glyph_count(&self) -> u16

Total number of glyphs in the input sequence

Source

pub fn input_sequence(&self) -> &'a [BigEndian<u16>]

Array of input sequence classes, beginning with the second glyph position

Source

pub fn lookahead_glyph_count(&self) -> u16

Number of glyphs in the lookahead sequence

Source

pub fn lookahead_sequence(&self) -> &'a [BigEndian<u16>]

Array of lookahead-sequence classes

Source

pub fn seq_lookup_count(&self) -> u16

Number of SequenceLookupRecords

Source

pub fn seq_lookup_records(&self) -> &'a [SequenceLookupRecord]

Array of SequenceLookupRecords

Source§

impl<'a> TableRef<'a, ChainedSequenceContextFormat3Marker>

Source

pub fn format(&self) -> u16

Format identifier: format = 3

Source

pub fn backtrack_glyph_count(&self) -> u16

Number of glyphs in the backtrack sequence

Source

pub fn backtrack_coverage_offsets(&self) -> &'a [BigEndian<Offset16>]

Array of offsets to coverage tables for the backtrack sequence

Source

pub fn backtrack_coverages( &self, ) -> ArrayOfOffsets<'a, CoverageTable<'a>, Offset16>

A dynamically resolving wrapper for backtrack_coverage_offsets.

Source

pub fn input_glyph_count(&self) -> u16

Number of glyphs in the input sequence

Source

pub fn input_coverage_offsets(&self) -> &'a [BigEndian<Offset16>]

Array of offsets to coverage tables for the input sequence

Source

pub fn input_coverages(&self) -> ArrayOfOffsets<'a, CoverageTable<'a>, Offset16>

A dynamically resolving wrapper for input_coverage_offsets.

Source

pub fn lookahead_glyph_count(&self) -> u16

Number of glyphs in the lookahead sequence

Source

pub fn lookahead_coverage_offsets(&self) -> &'a [BigEndian<Offset16>]

Array of offsets to coverage tables for the lookahead sequence

Source

pub fn lookahead_coverages( &self, ) -> ArrayOfOffsets<'a, CoverageTable<'a>, Offset16>

A dynamically resolving wrapper for lookahead_coverage_offsets.

Source

pub fn seq_lookup_count(&self) -> u16

Number of SequenceLookupRecords

Source

pub fn seq_lookup_records(&self) -> &'a [SequenceLookupRecord]

Array of SequenceLookupRecords

Source§

impl<'a> TableRef<'a, DeviceMarker>

Source

pub fn start_size(&self) -> u16

Smallest size to correct, in ppem

Source

pub fn end_size(&self) -> u16

Largest size to correct, in ppem

Source

pub fn delta_format(&self) -> DeltaFormat

Format of deltaValue array data: 0x0001, 0x0002, or 0x0003

Source

pub fn delta_value(&self) -> &'a [BigEndian<u16>]

Array of compressed data

Source§

impl<'a> TableRef<'a, VariationIndexMarker>

Source

pub fn delta_set_outer_index(&self) -> u16

A delta-set outer index — used to select an item variation data subtable within the item variation store.

Source

pub fn delta_set_inner_index(&self) -> u16

A delta-set inner index — used to select a delta-set row within an item variation data subtable.

Source

pub fn delta_format(&self) -> DeltaFormat

Format, = 0x8000

Source§

impl<'a> TableRef<'a, FeatureVariationsMarker>

Source

pub fn version(&self) -> MajorMinor

Source

pub fn feature_variation_record_count(&self) -> u32

Number of feature variation records.

Source

pub fn feature_variation_records(&self) -> &'a [FeatureVariationRecord]

Array of feature variation records.

Source§

impl<'a> TableRef<'a, ConditionSetMarker>

Source

pub fn condition_count(&self) -> u16

Number of conditions for this condition set.

Source

pub fn condition_offsets(&self) -> &'a [BigEndian<Offset32>]

Array of offsets to condition tables, from beginning of the ConditionSet table.

Source

pub fn conditions(&self) -> ArrayOfOffsets<'a, Condition<'a>, Offset32>

A dynamically resolving wrapper for condition_offsets.

Source§

impl<'a> TableRef<'a, ConditionFormat1Marker>

Source

pub fn format(&self) -> u16

Format, = 1

Source

pub fn axis_index(&self) -> u16

Index (zero-based) for the variation axis within the ‘fvar’ table.

Source

pub fn filter_range_min_value(&self) -> F2Dot14

Minimum value of the font variation instances that satisfy this condition.

Source

pub fn filter_range_max_value(&self) -> F2Dot14

Maximum value of the font variation instances that satisfy this condition.

Source§

impl<'a> TableRef<'a, ConditionFormat2Marker>

Source

pub fn format(&self) -> u16

Format, = 2

Source

pub fn default_value(&self) -> i16

Value at default instance.

Source

pub fn var_index(&self) -> u32

Variation index to vary the value based on current designspace location.

Source§

impl<'a> TableRef<'a, ConditionFormat3Marker>

Source

pub fn format(&self) -> u16

Format, = 3

Source

pub fn condition_count(&self) -> u8

Number of conditions.

Source

pub fn condition_offsets(&self) -> &'a [BigEndian<Offset24>]

Array of condition tables for this conjunction (AND) expression.

Source

pub fn conditions(&self) -> ArrayOfOffsets<'a, Condition<'a>, Offset24>

A dynamically resolving wrapper for condition_offsets.

Source§

impl<'a> TableRef<'a, ConditionFormat4Marker>

Source

pub fn format(&self) -> u16

Format, = 4

Source

pub fn condition_count(&self) -> u8

Number of conditions.

Source

pub fn condition_offsets(&self) -> &'a [BigEndian<Offset24>]

Array of condition tables for this disjunction (OR) expression.

Source

pub fn conditions(&self) -> ArrayOfOffsets<'a, Condition<'a>, Offset24>

A dynamically resolving wrapper for condition_offsets.

Source§

impl<'a> TableRef<'a, ConditionFormat5Marker>

Source

pub fn format(&self) -> u16

Format, = 5

Source

pub fn condition_offset(&self) -> Offset24

Condition to negate.

Source

pub fn condition(&self) -> Result<Condition<'a>, ReadError>

Attempt to resolve condition_offset.

Source§

impl<'a> TableRef<'a, FeatureTableSubstitutionMarker>

Source

pub fn version(&self) -> MajorMinor

Major & minor version of the table: (1, 0)

Source

pub fn substitution_count(&self) -> u16

Number of feature table substitution records.

Source

pub fn substitutions(&self) -> &'a [FeatureTableSubstitutionRecord]

Array of feature table substitution records.

Source§

impl<'a> TableRef<'a, SizeParamsMarker>

Source

pub fn design_size(&self) -> u16

The first value represents the design size in 720/inch units (decipoints).

The design size entry must be non-zero. When there is a design size but no recommended size range, the rest of the array will consist of zeros.

Source

pub fn identifier(&self) -> u16

The second value has no independent meaning, but serves as an identifier that associates fonts in a subfamily.

All fonts which share a Typographic or Font Family name and which differ only by size range shall have the same subfamily value, and no fonts which differ in weight or style shall have the same subfamily value. If this value is zero, the remaining fields in the array will be ignored.

Source

pub fn name_entry(&self) -> u16

The third value enables applications to use a single name for the subfamily identified by the second value.

If the preceding value is non-zero, this value must be set in the range 256 – 32767 (inclusive). It records the value of a field in the ‘name’ table, which must contain English-language strings encoded in Windows Unicode and Macintosh Roman, and may contain additional strings localized to other scripts and languages. Each of these strings is the name an application should use, in combination with the family name, to represent the subfamily in a menu. Applications will choose the appropriate version based on their selection criteria.

Source

pub fn range_start(&self) -> u16

The fourth and fifth values represent the small end of the recommended usage range (exclusive) and the large end of the recommended usage range (inclusive), stored in 720/inch units (decipoints).

Ranges must not overlap, and should generally be contiguous.

Source

pub fn range_end(&self) -> u16

Source§

impl<'a> TableRef<'a, StylisticSetParamsMarker>

Source

pub fn version(&self) -> u16

Source

pub fn ui_name_id(&self) -> NameId

The ‘name’ table name ID that specifies a string (or strings, for multiple languages) for a user-interface label for this feature.

The value of uiLabelNameId is expected to be in the font-specific name ID range (256-32767), though that is not a requirement in this Feature Parameters specification. The user-interface label for the feature can be provided in multiple languages. An English string should be included as a fallback. The string should be kept to a minimal length to fit comfortably with different application interfaces.

Source§

impl<'a> TableRef<'a, CharacterVariantParamsMarker>

Source

pub fn format(&self) -> u16

Format number is set to 0.

Source

pub fn feat_ui_label_name_id(&self) -> NameId

The ‘name’ table name ID that specifies a string (or strings, for multiple languages) for a user-interface label for this feature. (May be NULL.)

Source

pub fn feat_ui_tooltip_text_name_id(&self) -> NameId

The ‘name’ table name ID that specifies a string (or strings, for multiple languages) that an application can use for tooltip text for this feature. (May be NULL.)

Source

pub fn sample_text_name_id(&self) -> NameId

The ‘name’ table name ID that specifies sample text that illustrates the effect of this feature. (May be NULL.)

Source

pub fn num_named_parameters(&self) -> u16

Number of named parameters. (May be zero.)

Source

pub fn first_param_ui_label_name_id(&self) -> NameId

The first ‘name’ table name ID used to specify strings for user-interface labels for the feature parameters. (Must be zero if numParameters is zero.)

Source

pub fn char_count(&self) -> u16

The count of characters for which this feature provides glyph variants. (May be zero.)

Source

pub fn character(&self) -> &'a [BigEndian<Uint24>]

The Unicode Scalar Value of the characters for which this feature provides glyph variants.

Source§

impl<'a, T: FontRead<'a>> TableRef<'a, LookupMarker<T>>

Source

pub fn get_subtable(&self, offset: Offset16) -> Result<T, ReadError>

Source§

impl TableRef<'_, CoverageFormat1Marker>

Source

pub fn get(&self, gid: impl Into<GlyphId>) -> Option<u16>

If this glyph is in the coverage table, returns its index

Source§

impl TableRef<'_, CoverageFormat2Marker>

Source

pub fn get(&self, gid: impl Into<GlyphId>) -> Option<u16>

If this glyph is in the coverage table, returns its index

Source§

impl<'a> TableRef<'a, ClassDefFormat1Marker>

Source

pub fn get(&self, gid: GlyphId16) -> u16

Get the class for this glyph id

Source

pub fn iter(&self) -> impl Iterator<Item = (GlyphId16, u16)> + 'a

Iterate over each glyph and its class.

Source§

impl<'a> TableRef<'a, ClassDefFormat2Marker>

Source

pub fn get(&self, gid: GlyphId16) -> u16

Get the class for this glyph id

Source

pub fn iter(&self) -> impl Iterator<Item = (GlyphId16, u16)> + 'a

Iterate over each glyph and its class.

Source§

impl<'a> TableRef<'a, DeviceMarker>

Source

pub fn iter(&self) -> impl Iterator<Item = i8> + 'a

Iterate over the decoded values for this device

Source§

impl<'a> TableRef<'a, LtagMarker>

Source

pub fn version(&self) -> u32

Table version; currently 1.

Source

pub fn flags(&self) -> u32

Table flags; currently none defined.

Source

pub fn num_tags(&self) -> u32

Number of language tags which follow.

Source

pub fn tag_ranges(&self) -> &'a [FTStringRange]

Range of each tag’s string.

Source§

impl<'a> TableRef<'a, LtagMarker>

Source

pub fn tag_indices(&self) -> impl Iterator<Item = (u32, &'a str)>

Returns an iterator yielding the index and string value of each tag in the table.

Source

pub fn index_for_tag(&self, tag: &str) -> Option<u32>

Returns the index of the given language tag.

Source§

impl<'a> TableRef<'a, MaxpMarker>

Source

pub fn version(&self) -> Version16Dot16

The version: 0x00005000 for version 0.5, 0x00010000 for version 1.0.

Source

pub fn num_glyphs(&self) -> u16

The number of glyphs in the font.

Source

pub fn max_points(&self) -> Option<u16>

Maximum points in a non-composite glyph.

Source

pub fn max_contours(&self) -> Option<u16>

Maximum contours in a non-composite glyph.

Source

pub fn max_composite_points(&self) -> Option<u16>

Maximum points in a composite glyph.

Source

pub fn max_composite_contours(&self) -> Option<u16>

Maximum contours in a composite glyph.

Source

pub fn max_zones(&self) -> Option<u16>

1 if instructions do not use the twilight zone (Z0), or 2 if instructions do use Z0; should be set to 2 in most cases.

Source

pub fn max_twilight_points(&self) -> Option<u16>

Maximum points used in Z0.

Source

pub fn max_storage(&self) -> Option<u16>

Number of Storage Area locations.

Source

pub fn max_function_defs(&self) -> Option<u16>

Number of FDEFs, equal to the highest function number + 1.

Source

pub fn max_instruction_defs(&self) -> Option<u16>

Number of IDEFs.

Source

pub fn max_stack_elements(&self) -> Option<u16>

Maximum stack depth across Font Program (‘fpgm’ table), CVT Program (‘prep’ table) and all glyph instructions (in the ‘glyf’ table).

Source

pub fn max_size_of_instructions(&self) -> Option<u16>

Maximum byte count for glyph instructions.

Source

pub fn max_component_elements(&self) -> Option<u16>

Maximum number of components referenced at “top level” for any composite glyph.

Source

pub fn max_component_depth(&self) -> Option<u16>

Maximum levels of recursion; 1 for simple components.

Source§

impl<'a> TableRef<'a, MetaMarker>

Source

pub fn version(&self) -> u32

Version number of the metadata table — set to 1.

Source

pub fn flags(&self) -> u32

Flags — currently unused; set to 0.

Source

pub fn data_maps_count(&self) -> u32

The number of data maps in the table.

Source

pub fn data_maps(&self) -> &'a [DataMapRecord]

Array of data map records.

Source§

impl<'a> TableRef<'a, MvarMarker>

Source

pub fn version(&self) -> MajorMinor

Major version number of the horizontal metrics variations table — set to 1. Minor version number of the horizontal metrics variations table — set to 0.

Source

pub fn value_record_size(&self) -> u16

The size in bytes of each value record — must be greater than zero.

Source

pub fn value_record_count(&self) -> u16

The number of value records — may be zero.

Source

pub fn item_variation_store_offset(&self) -> Nullable<Offset16>

Offset in bytes from the start of this table to the item variation store table. If valueRecordCount is zero, set to zero; if valueRecordCount is greater than zero, must be greater than zero.

Source

pub fn item_variation_store( &self, ) -> Option<Result<ItemVariationStore<'a>, ReadError>>

Attempt to resolve item_variation_store_offset.

Source

pub fn value_records(&self) -> &'a [ValueRecord]

Array of value records that identify target items and the associated delta-set index for each. The valueTag records must be in binary order of their valueTag field.

Source§

impl TableRef<'_, MvarMarker>

Source

pub fn metric_delta( &self, tag: Tag, coords: &[F2Dot14], ) -> Result<Fixed, ReadError>

Returns the metric delta for the specified tag and normalized variation coordinates. Possible tags are found in the tags module.

Source§

impl<'a> TableRef<'a, NameMarker>

Source

pub fn version(&self) -> u16

Table version number (0 or 1)

Source

pub fn count(&self) -> u16

Number of name records.

Source

pub fn storage_offset(&self) -> u16

Offset to start of string storage (from start of table).

Source

pub fn name_record(&self) -> &'a [NameRecord]

The name records where count is the number of records.

Source

pub fn lang_tag_count(&self) -> Option<u16>

Number of language-tag records.

Source

pub fn lang_tag_record(&self) -> Option<&'a [LangTagRecord]>

The language-tag records where langTagCount is the number of records.

Source§

impl<'a> TableRef<'a, NameMarker>

Source

pub fn string_data(&self) -> FontData<'a>

The FontData containing the encoded name strings.

Source§

impl<'a> TableRef<'a, Os2Marker>

Source

pub fn version(&self) -> u16

Source

pub fn x_avg_char_width(&self) -> i16

Average weighted escapement.

The Average Character Width parameter specifies the arithmetic average of the escapement (width) of all non-zero width glyphs in the font.

Source

pub fn us_weight_class(&self) -> u16

Weight class.

Indicates the visual weight (degree of blackness or thickness of strokes) of the characters in the font. Values from 1 to 1000 are valid.

Source

pub fn us_width_class(&self) -> u16

Width class.

Indicates a relative change from the normal aspect ratio (width to height ratio) as specified by a font designer for the glyphs in a font.

Source

pub fn fs_type(&self) -> u16

Type flags.

Indicates font embedding licensing rights for the font.

Source

pub fn y_subscript_x_size(&self) -> i16

The recommended horizontal size in font design units for subscripts for this font.

Source

pub fn y_subscript_y_size(&self) -> i16

The recommended vertical size in font design units for subscripts for this font.

Source

pub fn y_subscript_x_offset(&self) -> i16

The recommended horizontal offset in font design units for subscripts for this font.

Source

pub fn y_subscript_y_offset(&self) -> i16

The recommended vertical offset in font design units for subscripts for this font.

Source

pub fn y_superscript_x_size(&self) -> i16

The recommended horizontal size in font design units for superscripts for this font.

Source

pub fn y_superscript_y_size(&self) -> i16

The recommended vertical size in font design units for superscripts for this font.

Source

pub fn y_superscript_x_offset(&self) -> i16

The recommended horizontal offset in font design units for superscripts for this font.

Source

pub fn y_superscript_y_offset(&self) -> i16

The recommended vertical offset in font design units for superscripts for this font.

Source

pub fn y_strikeout_size(&self) -> i16

Thickness of the strikeout stroke in font design units.

Source

pub fn y_strikeout_position(&self) -> i16

The position of the top of the strikeout stroke relative to the baseline in font design units.

Source

pub fn s_family_class(&self) -> i16

Font-family class and subclass. This parameter is a classification of font-family design.

Source

pub fn panose_10(&self) -> &'a [u8]

PANOSE classification number.

Additional specifications are required for PANOSE to classify non-Latin character sets.

Source

pub fn ul_unicode_range_1(&self) -> u32

Unicode Character Range.

Unicode Character Range (bits 0-31).

Source

pub fn ul_unicode_range_2(&self) -> u32

Unicode Character Range (bits 32-63).

Source

pub fn ul_unicode_range_3(&self) -> u32

Unicode Character Range (bits 64-95).

Source

pub fn ul_unicode_range_4(&self) -> u32

Unicode Character Range (bits 96-127).

Source

pub fn ach_vend_id(&self) -> Tag

Font Vendor Identification.

The four-character identifier for the vendor of the given type face.

Source

pub fn fs_selection(&self) -> SelectionFlags

Font selection flags.

Contains information concerning the nature of the font patterns.

Source

pub fn us_first_char_index(&self) -> u16

The minimum Unicode index (character code) in this font.

Source

pub fn us_last_char_index(&self) -> u16

The maximum Unicode index (character code) in this font.

Source

pub fn s_typo_ascender(&self) -> i16

The typographic ascender for this font.

Source

pub fn s_typo_descender(&self) -> i16

The typographic descender for this font.

Source

pub fn s_typo_line_gap(&self) -> i16

The typographic line gap for this font.

Source

pub fn us_win_ascent(&self) -> u16

The “Windows ascender” metric.

This should be used to specify the height above the baseline for a clipping region.

Source

pub fn us_win_descent(&self) -> u16

The “Windows descender” metric.

This should be used to specify the vertical extent below the baseline for a clipping region.

Source

pub fn ul_code_page_range_1(&self) -> Option<u32>

Code page character range bits 0-31.

Source

pub fn ul_code_page_range_2(&self) -> Option<u32>

Code page character range bits 32-63.

Source

pub fn sx_height(&self) -> Option<i16>

This metric specifies the distance between the baseline and the approximate height of non-ascending lowercase letters measured in FUnits.

Source

pub fn s_cap_height(&self) -> Option<i16>

This metric specifies the distance between the baseline and the approximate height of uppercase letters measured in FUnits.

Source

pub fn us_default_char(&self) -> Option<u16>

This is the Unicode code point, in UTF-16 encoding, of a character that can be used for a default glyph.

Source

pub fn us_break_char(&self) -> Option<u16>

his is the Unicode code point, in UTF-16 encoding, of a character that can be used as a default break character.

Source

pub fn us_max_context(&self) -> Option<u16>

This field is used for fonts with multiple optical styles.

Source

pub fn us_lower_optical_point_size(&self) -> Option<u16>

This field is used for fonts with multiple optical styles.

Source

pub fn us_upper_optical_point_size(&self) -> Option<u16>

This field is used for fonts with multiple optical styles.

Source§

impl<'a> TableRef<'a, PostMarker>

Source

pub fn version(&self) -> Version16Dot16

0x00010000 for version 1.0 0x00020000 for version 2.0 0x00025000 for version 2.5 (deprecated) 0x00030000 for version 3.0

Source

pub fn italic_angle(&self) -> Fixed

Italic angle in counter-clockwise degrees from the vertical. Zero for upright text, negative for text that leans to the right (forward).

Source

pub fn underline_position(&self) -> FWord

This is the suggested distance of the top of the underline from the baseline (negative values indicate below baseline). The PostScript definition of this FontInfo dictionary key (the y coordinate of the center of the stroke) is not used for historical reasons. The value of the PostScript key may be calculated by subtracting half the underlineThickness from the value of this field.

Source

pub fn underline_thickness(&self) -> FWord

Suggested values for the underline thickness. In general, the underline thickness should match the thickness of the underscore character (U+005F LOW LINE), and should also match the strikeout thickness, which is specified in the OS/2 table.

Source

pub fn is_fixed_pitch(&self) -> u32

Set to 0 if the font is proportionally spaced, non-zero if the font is not proportionally spaced (i.e. monospaced).

Source

pub fn min_mem_type42(&self) -> u32

Minimum memory usage when an OpenType font is downloaded.

Source

pub fn max_mem_type42(&self) -> u32

Maximum memory usage when an OpenType font is downloaded.

Source

pub fn min_mem_type1(&self) -> u32

Minimum memory usage when an OpenType font is downloaded as a Type 1 font.

Source

pub fn max_mem_type1(&self) -> u32

Maximum memory usage when an OpenType font is downloaded as a Type 1 font.

Source

pub fn num_glyphs(&self) -> Option<u16>

Number of glyphs (this should be the same as numGlyphs in ‘maxp’ table).

Source

pub fn glyph_name_index(&self) -> Option<&'a [BigEndian<u16>]>

Array of indices into the string data. See below for details.

Source

pub fn string_data(&self) -> Option<VarLenArray<'a, PString<'a>>>

Storage for the string data.

Source§

impl<'a> TableRef<'a, PostMarker>

Source

pub fn num_names(&self) -> usize

The number of glyph names covered by this table

Source

pub fn glyph_name(&self, glyph_id: GlyphId16) -> Option<&str>

Source§

impl<'a> TableRef<'a, Index1Marker>

Source

pub fn size_in_bytes(&self) -> Result<usize, ReadError>

Returns the total size in bytes of the index table.

Source

pub fn get_offset(&self, index: usize) -> Result<usize, Error>

Returns the offset of the object at the given index.

Source

pub fn get(&self, index: usize) -> Result<&'a [u8], Error>

Returns the data for the object at the given index.

Source§

impl<'a> TableRef<'a, Index2Marker>

Source

pub fn size_in_bytes(&self) -> Result<usize, ReadError>

Returns the total size in bytes of the index table.

Source

pub fn get_offset(&self, index: usize) -> Result<usize, Error>

Returns the offset of the object at the given index.

Source

pub fn get(&self, index: usize) -> Result<&'a [u8], Error>

Returns the data for the object at the given index.

Source§

impl<'a> TableRef<'a, Index1Marker>

Source

pub fn count(&self) -> u16

Number of objects stored in INDEX.

Source

pub fn off_size(&self) -> u8

Object array element size.

Source

pub fn offsets(&self) -> &'a [u8]

Bytes containing count + 1 offsets each of off_size.

Source

pub fn data(&self) -> &'a [u8]

Array containing the object data.

Source§

impl<'a> TableRef<'a, Index2Marker>

Source

pub fn count(&self) -> u32

Number of objects stored in INDEX.

Source

pub fn off_size(&self) -> u8

Object array element size.

Source

pub fn offsets(&self) -> &'a [u8]

Bytes containing count + 1 offsets each of off_size.

Source

pub fn data(&self) -> &'a [u8]

Array containing the object data.

Source§

impl<'a> TableRef<'a, FdSelectFormat0Marker>

Source

pub fn format(&self) -> u8

Format = 0.

Source

pub fn fds(&self) -> &'a [u8]

FD selector array (one entry for each glyph).

Source§

impl<'a> TableRef<'a, FdSelectFormat3Marker>

Source

pub fn format(&self) -> u8

Format = 3.

Source

pub fn n_ranges(&self) -> u16

Number of ranges.

Source

pub fn ranges(&self) -> &'a [FdSelectRange3]

Range3 array.

Source

pub fn sentinel(&self) -> u16

Sentinel GID. Set equal to the number of glyphs in the font.

Source§

impl<'a> TableRef<'a, FdSelectFormat4Marker>

Source

pub fn format(&self) -> u8

Format = 4.

Source

pub fn n_ranges(&self) -> u32

Number of ranges.

Source

pub fn ranges(&self) -> &'a [FdSelectRange4]

Range4 array.

Source

pub fn sentinel(&self) -> u32

Sentinel GID. Set equal to the number of glyphs in the font.

Source§

impl<'a> TableRef<'a, SbixMarker>

Source

pub fn read(data: FontData<'a>, num_glyphs: u16) -> Result<Self, ReadError>

A constructor that requires additional arguments.

This type requires some external state in order to be parsed.

Source§

impl<'a> TableRef<'a, SbixMarker>

Source

pub fn version(&self) -> u16

Table version number — set to 1.

Source

pub fn flags(&self) -> HeaderFlags

Bit 0: Set to 1. Bit 1: Draw outlines. Bits 2 to 15: reserved (set to 0).

Source

pub fn num_strikes(&self) -> u32

Number of bitmap strikes.

Source

pub fn strike_offsets(&self) -> &'a [BigEndian<Offset32>]

Offsets from the beginning of the ‘sbix’ table to data for each individual bitmap strike.

Source

pub fn strikes(&self) -> ArrayOfOffsets<'a, Strike<'a>, Offset32>

A dynamically resolving wrapper for strike_offsets.

Source§

impl<'a> TableRef<'a, StrikeMarker>

Source

pub fn read(data: FontData<'a>, num_glyphs: u16) -> Result<Self, ReadError>

A constructor that requires additional arguments.

This type requires some external state in order to be parsed.

Source§

impl<'a> TableRef<'a, StrikeMarker>

Source

pub fn ppem(&self) -> u16

The PPEM size for which this strike was designed.

Source

pub fn ppi(&self) -> u16

The device pixel density (in PPI) for which this strike was designed. (E.g., 96 PPI, 192 PPI.)

Source

pub fn glyph_data_offsets(&self) -> &'a [BigEndian<u32>]

Offset from the beginning of the strike data header to bitmap data for an individual glyph ID.

Source§

impl<'a> TableRef<'a, GlyphDataMarker>

Source

pub fn origin_offset_x(&self) -> i16

The horizontal (x-axis) position of the left edge of the bitmap graphic in relation to the glyph design space origin.

Source

pub fn origin_offset_y(&self) -> i16

The vertical (y-axis) position of the bottom edge of the bitmap graphic in relation to the glyph design space origin.

Source

pub fn graphic_type(&self) -> Tag

Indicates the format of the embedded graphic data: one of ’jpg ’, ’png ’ or ‘tiff’, or the special format ‘dupe’.

Source

pub fn data(&self) -> &'a [u8]

The actual embedded graphic data. The total length is inferred from sequential entries in the glyphDataOffsets array and the fixed size (8 bytes) of the preceding fields.

Source§

impl<'a> TableRef<'a, StrikeMarker>

Source

pub fn glyph_data( &self, glyph_id: GlyphId, ) -> Result<Option<GlyphData<'a>>, ReadError>

Source§

impl<'a> TableRef<'a, StatMarker>

Source

pub fn version(&self) -> MajorMinor

Major/minor version number. Set to 1.2 for new fonts.

Source

pub fn design_axis_size(&self) -> u16

The size in bytes of each axis record.

Source

pub fn design_axis_count(&self) -> u16

The number of axis records. In a font with an ‘fvar’ table, this value must be greater than or equal to the axisCount value in the ‘fvar’ table. In all fonts, must be greater than zero if axisValueCount is greater than zero.

Source

pub fn design_axes_offset(&self) -> Offset32

Offset in bytes from the beginning of the STAT table to the start of the design axes array. If designAxisCount is zero, set to zero; if designAxisCount is greater than zero, must be greater than zero.

Source

pub fn design_axes(&self) -> Result<&'a [AxisRecord], ReadError>

Attempt to resolve design_axes_offset.

Source

pub fn axis_value_count(&self) -> u16

The number of axis value tables.

Source

pub fn offset_to_axis_value_offsets(&self) -> Nullable<Offset32>

Offset in bytes from the beginning of the STAT table to the start of the design axes value offsets array. If axisValueCount is zero, set to zero; if axisValueCount is greater than zero, must be greater than zero.

Source

pub fn offset_to_axis_values( &self, ) -> Option<Result<AxisValueArray<'a>, ReadError>>

Attempt to resolve offset_to_axis_value_offsets.

Source

pub fn elided_fallback_name_id(&self) -> Option<NameId>

Name ID used as fallback when projection of names into a particular font model produces a subfamily name containing only elidable elements.

Source§

impl<'a> TableRef<'a, AxisValueArrayMarker>

Source

pub fn read( data: FontData<'a>, axis_value_count: u16, ) -> Result<Self, ReadError>

A constructor that requires additional arguments.

This type requires some external state in order to be parsed.

Source§

impl<'a> TableRef<'a, AxisValueArrayMarker>

Source

pub fn axis_value_offsets(&self) -> &'a [BigEndian<Offset16>]

Array of offsets to axis value tables, in bytes from the start of the axis value offsets array.

Source

pub fn axis_values(&self) -> ArrayOfOffsets<'a, AxisValue<'a>, Offset16>

A dynamically resolving wrapper for axis_value_offsets.

Source§

impl<'a> TableRef<'a, AxisValueFormat1Marker>

Source

pub fn format(&self) -> u16

Format identifier — set to 1.

Source

pub fn axis_index(&self) -> u16

Zero-base index into the axis record array identifying the axis of design variation to which the axis value table applies. Must be less than designAxisCount.

Source

pub fn flags(&self) -> AxisValueTableFlags

Flags — see below for details.

Source

pub fn value_name_id(&self) -> NameId

The name ID for entries in the ‘name’ table that provide a display string for this attribute value.

Source

pub fn value(&self) -> Fixed

A numeric value for this attribute value.

Source§

impl<'a> TableRef<'a, AxisValueFormat2Marker>

Source

pub fn format(&self) -> u16

Format identifier — set to 2.

Source

pub fn axis_index(&self) -> u16

Zero-base index into the axis record array identifying the axis of design variation to which the axis value table applies. Must be less than designAxisCount.

Source

pub fn flags(&self) -> AxisValueTableFlags

Flags — see below for details.

Source

pub fn value_name_id(&self) -> NameId

The name ID for entries in the ‘name’ table that provide a display string for this attribute value.

Source

pub fn nominal_value(&self) -> Fixed

A nominal numeric value for this attribute value.

Source

pub fn range_min_value(&self) -> Fixed

The minimum value for a range associated with the specified name ID.

Source

pub fn range_max_value(&self) -> Fixed

The maximum value for a range associated with the specified name ID.

Source§

impl<'a> TableRef<'a, AxisValueFormat3Marker>

Source

pub fn format(&self) -> u16

Format identifier — set to 3.

Source

pub fn axis_index(&self) -> u16

Zero-base index into the axis record array identifying the axis of design variation to which the axis value table applies. Must be less than designAxisCount.

Source

pub fn flags(&self) -> AxisValueTableFlags

Flags — see below for details.

Source

pub fn value_name_id(&self) -> NameId

The name ID for entries in the ‘name’ table that provide a display string for this attribute value.

Source

pub fn value(&self) -> Fixed

A numeric value for this attribute value.

Source

pub fn linked_value(&self) -> Fixed

The numeric value for a style-linked mapping from this value.

Source§

impl<'a> TableRef<'a, AxisValueFormat4Marker>

Source

pub fn format(&self) -> u16

Format identifier — set to 4.

Source

pub fn axis_count(&self) -> u16

The total number of axes contributing to this axis-values combination.

Source

pub fn flags(&self) -> AxisValueTableFlags

Flags — see below for details.

Source

pub fn value_name_id(&self) -> NameId

The name ID for entries in the ‘name’ table that provide a display string for this combination of axis values.

Source

pub fn axis_values(&self) -> &'a [AxisValueRecord]

Array of AxisValue records that provide the combination of axis values, one for each contributing axis.

Source§

impl<'a> TableRef<'a, SvgMarker>

Source

pub fn version(&self) -> u16

Table version (starting at 0). Set to 0.

Source

pub fn svg_document_list_offset(&self) -> Offset32

Offset to the SVGDocumentList, from the start of the SVG table. Must be non-zero.

Source

pub fn svg_document_list(&self) -> Result<SVGDocumentList<'a>, ReadError>

Attempt to resolve svg_document_list_offset.

Source§

impl<'a> TableRef<'a, SVGDocumentListMarker>

Source

pub fn num_entries(&self) -> u16

Number of SVGDocumentRecords. Must be non-zero.

Source

pub fn document_records(&self) -> &'a [SVGDocumentRecord]

Array of SVGDocumentRecords.

Source§

impl<'a> TableRef<'a, SvgMarker>

Source

pub fn glyph_data( &self, glyph_id: GlyphId, ) -> Result<Option<&'a [u8]>, ReadError>

Get the raw data of the SVG document. Is not guaranteed to be valid and might be compressed.

Source§

impl<'a> TableRef<'a, VarcMarker>

Source

pub fn version(&self) -> MajorMinor

Major/minor version number. Set to 1.0.

Source

pub fn coverage_offset(&self) -> Offset32

Source

pub fn coverage(&self) -> Result<CoverageTable<'a>, ReadError>

Attempt to resolve coverage_offset.

Source

pub fn multi_var_store_offset(&self) -> Nullable<Offset32>

Source

pub fn multi_var_store( &self, ) -> Option<Result<MultiItemVariationStore<'a>, ReadError>>

Attempt to resolve multi_var_store_offset.

Source

pub fn condition_list_offset(&self) -> Nullable<Offset32>

Source

pub fn condition_list(&self) -> Option<Result<ConditionList<'a>, ReadError>>

Attempt to resolve condition_list_offset.

Source

pub fn axis_indices_list_offset(&self) -> Nullable<Offset32>

Source

pub fn axis_indices_list(&self) -> Option<Result<Index2<'a>, ReadError>>

Attempt to resolve axis_indices_list_offset.

Source

pub fn var_composite_glyphs_offset(&self) -> Offset32

Source

pub fn var_composite_glyphs(&self) -> Result<Index2<'a>, ReadError>

Attempt to resolve var_composite_glyphs_offset.

Source§

impl<'a> TableRef<'a, MultiItemVariationStoreMarker>

Source

pub fn format(&self) -> u16

Source

pub fn region_list_offset(&self) -> Offset32

Source

pub fn region_list(&self) -> Result<SparseVariationRegionList<'a>, ReadError>

Attempt to resolve region_list_offset.

Source

pub fn variation_data_count(&self) -> u16

Source

pub fn variation_data_offsets(&self) -> &'a [BigEndian<Offset32>]

Source

pub fn variation_data( &self, ) -> ArrayOfOffsets<'a, MultiItemVariationData<'a>, Offset32>

A dynamically resolving wrapper for variation_data_offsets.

Source§

impl<'a> TableRef<'a, SparseVariationRegionListMarker>

Source

pub fn region_count(&self) -> u16

Source

pub fn region_offsets(&self) -> &'a [BigEndian<Offset32>]

Source

pub fn regions(&self) -> ArrayOfOffsets<'a, SparseVariationRegion<'a>, Offset32>

A dynamically resolving wrapper for region_offsets.

Source§

impl<'a> TableRef<'a, SparseVariationRegionMarker>

Source§

impl<'a> TableRef<'a, MultiItemVariationDataMarker>

Source

pub fn format(&self) -> u8

Source

pub fn region_index_count(&self) -> u16

Source

pub fn region_indices(&self) -> &'a [BigEndian<u16>]

Source

pub fn raw_delta_sets(&self) -> &'a [u8]

Source§

impl<'a> TableRef<'a, ConditionListMarker>

Source

pub fn condition_count(&self) -> u32

Source

pub fn condition_offsets(&self) -> &'a [BigEndian<Offset32>]

Source

pub fn conditions(&self) -> ArrayOfOffsets<'a, Condition<'a>, Offset32>

A dynamically resolving wrapper for condition_offsets.

Source§

impl TableRef<'_, VarcMarker>

Source

pub fn axis_indices(&self, nth: usize) -> Result<PackedDeltas<'_>, ReadError>

Friendlier accessor than directly using raw data via Index2

Source

pub fn glyph(&self, nth: usize) -> Result<VarcGlyph<'_>, ReadError>

Friendlier accessor than directly using raw data via Index2

nth would typically be obtained by looking up a GlyphId in Self::coverage.

Source§

impl<'a> TableRef<'a, MultiItemVariationDataMarker>

Source

pub fn delta_sets(&self) -> Result<Index2<'a>, ReadError>

An Index2 where each item is a PackedDeltas

Source

pub fn delta_set(&self, i: usize) -> Result<PackedDeltas<'a>, ReadError>

Read a specific delta set.

Equivalent to calling Self::delta_sets, fetching item i, and parsing as PackedDeltas

Source§

impl<'a> TableRef<'a, TupleVariationHeaderMarker>

Source

pub fn read(data: FontData<'a>, axis_count: u16) -> Result<Self, ReadError>

A constructor that requires additional arguments.

This type requires some external state in order to be parsed.

Source§

impl<'a> TableRef<'a, TupleVariationHeaderMarker>

Source

pub fn variation_data_size(&self) -> u16

The size in bytes of the serialized data for this tuple variation table.

Source

pub fn tuple_index(&self) -> TupleIndex

A packed field. The high 4 bits are flags (see below). The low 12 bits are an index into a shared tuple records array.

Source§

impl<'a> TableRef<'a, DeltaSetIndexMapFormat0Marker>

Source

pub fn format(&self) -> u8

DeltaSetIndexMap format: set to 0.

Source

pub fn entry_format(&self) -> EntryFormat

A packed field that describes the compressed representation of delta-set indices. See details below.

Source

pub fn map_count(&self) -> u16

The number of mapping entries.

Source

pub fn map_data(&self) -> &'a [u8]

The delta-set index mapping data. See details below.

Source§

impl<'a> TableRef<'a, DeltaSetIndexMapFormat1Marker>

Source

pub fn format(&self) -> u8

DeltaSetIndexMap format: set to 1.

Source

pub fn entry_format(&self) -> EntryFormat

A packed field that describes the compressed representation of delta-set indices. See details below.

Source

pub fn map_count(&self) -> u32

The number of mapping entries.

Source

pub fn map_data(&self) -> &'a [u8]

The delta-set index mapping data. See details below.

Source§

impl<'a> TableRef<'a, VariationRegionListMarker>

Source

pub fn axis_count(&self) -> u16

The number of variation axes for this font. This must be the same number as axisCount in the ‘fvar’ table.

Source

pub fn region_count(&self) -> u16

The number of variation region tables in the variation region list. Must be less than 32,768.

Source

pub fn variation_regions(&self) -> ComputedArray<'a, VariationRegion<'a>>

Array of variation regions.

Source§

impl<'a> TableRef<'a, ItemVariationStoreMarker>

Source

pub fn format(&self) -> u16

Format— set to 1

Source

pub fn variation_region_list_offset(&self) -> Offset32

Offset in bytes from the start of the item variation store to the variation region list.

Source

pub fn variation_region_list( &self, ) -> Result<VariationRegionList<'a>, ReadError>

Attempt to resolve variation_region_list_offset.

Source

pub fn item_variation_data_count(&self) -> u16

The number of item variation data subtables.

Source

pub fn item_variation_data_offsets(&self) -> &'a [BigEndian<Nullable<Offset32>>]

Offsets in bytes from the start of the item variation store to each item variation data subtable.

Source

pub fn item_variation_data( &self, ) -> ArrayOfNullableOffsets<'a, ItemVariationData<'a>, Offset32>

A dynamically resolving wrapper for item_variation_data_offsets.

Source§

impl<'a> TableRef<'a, ItemVariationDataMarker>

Source

pub fn item_count(&self) -> u16

The number of delta sets for distinct items.

Source

pub fn word_delta_count(&self) -> u16

A packed field: the high bit is a flag—see details below.

Source

pub fn region_index_count(&self) -> u16

The number of variation regions referenced.

Source

pub fn region_indexes(&self) -> &'a [BigEndian<u16>]

Array of indices into the variation region list for the regions referenced by this item variation data table.

Source

pub fn delta_sets(&self) -> &'a [u8]

Delta-set rows.

Source§

impl<'a> TableRef<'a, TupleVariationHeaderMarker>

Source

pub fn peak_tuple(&self) -> Option<Tuple<'a>>

Peak tuple record for this tuple variation table — optional, determined by flags in the tupleIndex value. Note that this must always be included in the ‘cvar’ table.

Source

pub fn intermediate_start_tuple(&self) -> Option<Tuple<'a>>

Intermediate start tuple record for this tuple variation table — optional, determined by flags in the tupleIndex value.

Source

pub fn intermediate_end_tuple(&self) -> Option<Tuple<'a>>

Intermediate end tuple record for this tuple variation table — optional, determined by flags in the tupleIndex value.

Source§

impl TableRef<'_, ItemVariationStoreMarker>

Source

pub fn compute_delta( &self, index: DeltaSetIndex, coords: &[F2Dot14], ) -> Result<i32, ReadError>

Computes the delta value for the specified index and set of normalized variation coordinates.

Source

pub fn compute_float_delta( &self, index: DeltaSetIndex, coords: &[F2Dot14], ) -> Result<FloatItemDelta, ReadError>

Computes the delta value in floating point for the specified index and set of normalized variation coordinates.

Source§

impl<'a> TableRef<'a, ItemVariationDataMarker>

Source

pub fn delta_set( &self, inner_index: u16, ) -> impl Iterator<Item = i32> + 'a + Clone

Returns an iterator over the per-region delta values for the specified inner index.

Source§

impl<'a> TableRef<'a, VheaMarker>

Source

pub fn version(&self) -> Version16Dot16

The major/minor version (1, 1)

Source

pub fn ascender(&self) -> FWord

Typographic ascent.

Source

pub fn descender(&self) -> FWord

Typographic descent.

Source

pub fn line_gap(&self) -> FWord

Typographic line gap. Negative LineGap values are treated as zero in some legacy platform implementations.

Source

pub fn advance_height_max(&self) -> UfWord

Maximum advance height value in ‘vmtx’ table.

Source

pub fn min_top_side_bearing(&self) -> FWord

Minimum top sidebearing value in ‘vmtx’ table for glyphs with contours (empty glyphs should be ignored).

Source

pub fn min_bottom_side_bearing(&self) -> FWord

Minimum bottom sidebearing value

Source

pub fn y_max_extent(&self) -> FWord

Defined as max( tsb + (yMax-yMin)).

Source

pub fn caret_slope_rise(&self) -> i16

Used to calculate the slope of the cursor (rise/run); 1 for vertical caret, 0 for horizontal.

Source

pub fn caret_slope_run(&self) -> i16

0 for vertical caret, 1 for horizontal.

Source

pub fn caret_offset(&self) -> i16

The amount by which a slanted highlight on a glyph needs to be shifted to produce the best appearance. Set to 0 for non-slanted fonts

Source

pub fn metric_data_format(&self) -> i16

0 for current format.

Source

pub fn number_of_long_ver_metrics(&self) -> u16

Number of LongMetric entries in ‘hmtx’/‘vmtx’ table

Source§

impl<'a> TableRef<'a, VmtxMarker>

Source

pub fn read( data: FontData<'a>, number_of_long_ver_metrics: u16, num_glyphs: u16, ) -> Result<Self, ReadError>

A constructor that requires additional arguments.

This type requires some external state in order to be parsed.

Source§

impl<'a> TableRef<'a, VmtxMarker>

Source

pub fn v_metrics(&self) -> &'a [LongMetric]

Paired advance height and top side bearing values for each glyph. Records are indexed by glyph ID.

Source

pub fn top_side_bearings(&self) -> &'a [BigEndian<i16>]

Top side bearings for glyph IDs greater than or equal to numberOfLongMetrics.

Source§

impl TableRef<'_, VmtxMarker>

Source

pub fn advance(&self, glyph_id: GlyphId) -> Option<u16>

Returns the advance height for the given glyph identifier.

Source

pub fn side_bearing(&self, glyph_id: GlyphId) -> Option<i16>

Returns the top side bearing for the given glyph identifier.

Source§

impl<'a> TableRef<'a, VorgMarker>

Source

pub fn version(&self) -> MajorMinor

Major/minor version number. Set to 1.0.

Source

pub fn default_vert_origin_y(&self) -> i16

The y coordinate of a glyph’s vertical origin, in the font’s design coordinate system, to be used if no entry is present for the glyph in the vertOriginYMetrics array.

Source

pub fn num_vert_origin_y_metrics(&self) -> u16

Number of elements in the vertOriginYMetrics array.

Source

pub fn vert_origin_y_metrics(&self) -> &'a [VertOriginYMetrics]

Array of VertOriginYMetrics records, sorted by glyph ID.

Source§

impl TableRef<'_, VorgMarker>

Source

pub fn vertical_origin_y(&self, glyph_id: GlyphId) -> i16

Returns the y coordinate of the of the glyph’s vertical origin.

Source§

impl<'a> TableRef<'a, VvarMarker>

Source

pub fn version(&self) -> MajorMinor

Major version number of the horizontal metrics variations table — set to 1. Minor version number of the horizontal metrics variations table — set to 0.

Source

pub fn item_variation_store_offset(&self) -> Offset32

Offset in bytes from the start of this table to the item variation store table.

Source

pub fn item_variation_store(&self) -> Result<ItemVariationStore<'a>, ReadError>

Attempt to resolve item_variation_store_offset.

Source

pub fn advance_height_mapping_offset(&self) -> Nullable<Offset32>

Offset in bytes from the start of this table to the delta-set index mapping for advance heights (may be NULL).

Source

pub fn advance_height_mapping( &self, ) -> Option<Result<DeltaSetIndexMap<'a>, ReadError>>

Attempt to resolve advance_height_mapping_offset.

Source

pub fn tsb_mapping_offset(&self) -> Nullable<Offset32>

Offset in bytes from the start of this table to the delta-set index mapping for top side bearings (may be NULL).

Source

pub fn tsb_mapping(&self) -> Option<Result<DeltaSetIndexMap<'a>, ReadError>>

Attempt to resolve tsb_mapping_offset.

Source

pub fn bsb_mapping_offset(&self) -> Nullable<Offset32>

Offset in bytes from the start of this table to the delta-set index mapping for bottom side bearings (may be NULL).

Source

pub fn bsb_mapping(&self) -> Option<Result<DeltaSetIndexMap<'a>, ReadError>>

Attempt to resolve bsb_mapping_offset.

Source

pub fn v_org_mapping_offset(&self) -> Nullable<Offset32>

Offset in bytes from the start of this table to the delta-set index mapping for Y coordinates of vertical origins (may be NULL).

Source

pub fn v_org_mapping(&self) -> Option<Result<DeltaSetIndexMap<'a>, ReadError>>

Attempt to resolve v_org_mapping_offset.

Source§

impl TableRef<'_, VvarMarker>

Source

pub fn advance_height_delta( &self, glyph_id: GlyphId, coords: &[F2Dot14], ) -> Result<Fixed, ReadError>

Returns the advance height delta for the specified glyph identifier and normalized variation coordinates.

Source

pub fn tsb_delta( &self, glyph_id: GlyphId, coords: &[F2Dot14], ) -> Result<Fixed, ReadError>

Returns the top side bearing delta for the specified glyph identifier and normalized variation coordinates.

Source

pub fn bsb_delta( &self, glyph_id: GlyphId, coords: &[F2Dot14], ) -> Result<Fixed, ReadError>

Returns the bottom side bearing delta for the specified glyph identifier and normalized variation coordinates.

Source

pub fn v_org_delta( &self, glyph_id: GlyphId, coords: &[F2Dot14], ) -> Result<Fixed, ReadError>

Returns the vertical origin delta for the specified glyph identifier and normalized variation coordinates.

Source§

impl<'a> TableRef<'a, TableDirectoryMarker>

Source

pub fn sfnt_version(&self) -> u32

0x00010000 or 0x4F54544F

Source

pub fn num_tables(&self) -> u16

Number of tables.

Source

pub fn search_range(&self) -> u16

Source

pub fn entry_selector(&self) -> u16

Source

pub fn range_shift(&self) -> u16

Source

pub fn table_records(&self) -> &'a [TableRecord]

Table records array—one for each top-level table in the font

Source§

impl<'a> TableRef<'a, TTCHeaderMarker>

Source

pub fn ttc_tag(&self) -> Tag

Font Collection ID string: "ttcf"

Source

pub fn version(&self) -> MajorMinor

Major/minor version of the TTC Header

Source

pub fn num_fonts(&self) -> u32

Number of fonts in TTC

Source

pub fn table_directory_offsets(&self) -> &'a [BigEndian<u32>]

Array of offsets to the TableDirectory for each font from the beginning of the file

Source

pub fn dsig_tag(&self) -> Option<u32>

Tag indicating that a DSIG table exists, 0x44534947 (‘DSIG’) (null if no signature)

Source

pub fn dsig_length(&self) -> Option<u32>

The length (in bytes) of the DSIG table (null if no signature)

Source

pub fn dsig_offset(&self) -> Option<u32>

The offset (in bytes) of the DSIG table from the beginning of the TTC file (null if no signature)

Trait Implementations§

Source§

impl<'a, T: Clone> Clone for TableRef<'a, T>

Source§

fn clone(&self) -> TableRef<'a, T>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl<'a, T> Freeze for TableRef<'a, T>
where T: Freeze,

§

impl<'a, T> RefUnwindSafe for TableRef<'a, T>
where T: RefUnwindSafe,

§

impl<'a, T> Send for TableRef<'a, T>
where T: Send,

§

impl<'a, T> Sync for TableRef<'a, T>
where T: Sync,

§

impl<'a, T> Unpin for TableRef<'a, T>
where T: Unpin,

§

impl<'a, T> UnwindSafe for TableRef<'a, T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<'a, T> FontReadWithArgs<'a> for T
where T: FontRead<'a>,

Source§

fn read_with_args( data: FontData<'a>, _: &<T as ReadArgs>::Args, ) -> Result<T, ReadError>

read an item, using the provided args. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<'a, T> ReadArgs for T
where T: FontRead<'a>,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.