pub struct ScriptList<'a> { /* private fields */ }Expand description
Implementations§
Source§impl<'a> ScriptList<'a>
impl<'a> ScriptList<'a>
Sourcepub fn index_for_tag(&self, tag: Tag) -> Option<u16>
pub fn index_for_tag(&self, tag: Tag) -> Option<u16>
Returns the index of the script with the given tag.
Sourcepub fn get(&self, index: u16) -> Result<TaggedElement<Script<'a>>, ReadError>
pub fn get(&self, index: u16) -> Result<TaggedElement<Script<'a>>, ReadError>
Returns the tag and script at the given index.
Sourcepub fn select(&self, tags: &[Tag]) -> Option<SelectedScript>
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>
impl<'a> ScriptList<'a>
pub const MIN_SIZE: usize = u16::RAW_BYTE_LEN
Sourcepub fn resolve_offset<O: Offset, R: FontRead<'a>>(
&self,
offset: O,
) -> Result<R, ReadError>
pub fn resolve_offset<O: Offset, R: FontRead<'a>>( &self, offset: O, ) -> Result<R, ReadError>
Resolve the provided offset from the start of this table.
Sourcepub fn offset_data(&self) -> FontData<'a>
pub fn offset_data(&self) -> FontData<'a>
Return a reference to this table’s raw data.
We use this in the compile crate to resolve offsets.
Sourcepub fn shape(&self) -> &Self
👎Deprecated: just use the base type directly
pub fn shape(&self) -> &Self
just use the base type directly
Return a reference to the table’s ‘Shape’ struct.
This is a low level implementation detail, but it can be useful in some cases where you want to know things about a table’s layout, such as the byte offsets of specific fields.
Sourcepub fn script_count(&self) -> u16
pub fn script_count(&self) -> u16
Number of ScriptRecords
Sourcepub fn script_records(&self) -> &'a [ScriptRecord]
pub fn script_records(&self) -> &'a [ScriptRecord]
Array of ScriptRecords, listed alphabetically by script tag
pub fn script_count_byte_range(&self) -> Range<usize> ⓘ
pub fn script_records_byte_range(&self) -> Range<usize> ⓘ
Trait Implementations§
Source§impl<'a> Clone for ScriptList<'a>
impl<'a> Clone for ScriptList<'a>
Source§fn clone(&self) -> ScriptList<'a>
fn clone(&self) -> ScriptList<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more