pub struct TableDirectory<'a> { /* private fields */ }Expand description
The OpenType Table Directory
Implementations§
Source§impl<'a> TableDirectory<'a>
impl<'a> TableDirectory<'a>
pub const MIN_SIZE: usize
Sourcepub fn resolve_offset<O: Offset, R: FontRead<'a>>(
&self,
offset: O,
) -> Result<R, ReadError>
pub fn resolve_offset<O: Offset, R: FontRead<'a>>( &self, offset: O, ) -> Result<R, ReadError>
Resolve the provided offset from the start of this table.
Sourcepub fn offset_data(&self) -> FontData<'a>
pub fn offset_data(&self) -> FontData<'a>
Return a reference to this table’s raw data.
We use this in the compile crate to resolve offsets.
Sourcepub fn shape(&self) -> &Self
👎Deprecated: just use the base type directly
pub fn shape(&self) -> &Self
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 sfnt_version(&self) -> u32
pub fn sfnt_version(&self) -> u32
0x00010000 or 0x4F54544F
Sourcepub fn num_tables(&self) -> u16
pub fn num_tables(&self) -> u16
Number of tables.
pub fn search_range(&self) -> u16
pub fn entry_selector(&self) -> u16
pub fn range_shift(&self) -> u16
Sourcepub fn table_records(&self) -> &'a [TableRecord]
pub fn table_records(&self) -> &'a [TableRecord]
Table records array—one for each top-level table in the font
pub fn sfnt_version_byte_range(&self) -> Range<usize> ⓘ
pub fn num_tables_byte_range(&self) -> Range<usize> ⓘ
pub fn search_range_byte_range(&self) -> Range<usize> ⓘ
pub fn entry_selector_byte_range(&self) -> Range<usize> ⓘ
pub fn range_shift_byte_range(&self) -> Range<usize> ⓘ
pub fn table_records_byte_range(&self) -> Range<usize> ⓘ
Trait Implementations§
Source§impl<'a> Clone for TableDirectory<'a>
impl<'a> Clone for TableDirectory<'a>
Source§fn clone(&self) -> TableDirectory<'a>
fn clone(&self) -> TableDirectory<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> FontRead<'a> for TableDirectory<'a>
impl<'a> FontRead<'a> for TableDirectory<'a>
Source§impl<'a> MinByteRange<'a> for TableDirectory<'a>
impl<'a> MinByteRange<'a> for TableDirectory<'a>
Auto Trait Implementations§
impl<'a> Freeze for TableDirectory<'a>
impl<'a> RefUnwindSafe for TableDirectory<'a>
impl<'a> Send for TableDirectory<'a>
impl<'a> Sync for TableDirectory<'a>
impl<'a> Unpin for TableDirectory<'a>
impl<'a> UnsafeUnpin for TableDirectory<'a>
impl<'a> UnwindSafe for TableDirectory<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more