Struct TableDirectory
pub struct TableDirectory<'a> { /* private fields */ }Expand description
The OpenType Table Directory
Implementations§
§impl<'a> TableDirectory<'a>
impl<'a> TableDirectory<'a>
pub const MIN_SIZE: usize
pub fn resolve_offset<O, R>(&self, offset: O) -> Result<R, ReadError>
pub fn resolve_offset<O, R>(&self, offset: O) -> Result<R, ReadError>
Resolve the provided offset from the start of this table.
pub 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.
pub fn shape(&self) -> &TableDirectory<'a>
👎Deprecated: just use the base type directly
pub fn shape(&self) -> &TableDirectory<'a>
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.
pub fn sfnt_version(&self) -> u32
pub fn sfnt_version(&self) -> u32
0x00010000 or 0x4F54544F
pub 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
pub 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§
§impl<'a> Clone for TableDirectory<'a>
impl<'a> Clone for TableDirectory<'a>
§fn clone(&self) -> TableDirectory<'a>
fn clone(&self) -> TableDirectory<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Default for TableDirectory<'_>
impl Default for TableDirectory<'_>
§fn default() -> TableDirectory<'_>
fn default() -> TableDirectory<'_>
Returns the “default value” for a type. Read more
§impl<'a> FontRead<'a> for TableDirectory<'a>
impl<'a> FontRead<'a> for TableDirectory<'a>
§impl<'a> MinByteRange<'a> for TableDirectory<'a>
impl<'a> MinByteRange<'a> for TableDirectory<'a>
fn min_byte_range(&self) -> Range<usize> ⓘ
fn min_table_bytes(&self) -> &'a [u8] ⓘ
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<'a, T> FontReadWithArgs<'a> for Twhere
T: FontRead<'a>,
impl<'a, T> FontReadWithArgs<'a> for Twhere
T: FontRead<'a>,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.