read_fonts::tables::layout

Type Alias ScriptList

Source
pub type ScriptList<'a> = TableRef<'a, ScriptListMarker>;
Expand description

Aliased Type§

struct ScriptList<'a> { /* private fields */ }

Implementations§

Source§

impl<'a> ScriptList<'a>

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> ScriptList<'a>

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, 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.

Trait Implementations§

Source§

impl<'a> FontRead<'a> for ScriptList<'a>

Source§

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

Read an instance of Self from the provided data, performing validation. Read more
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