pub enum Index<'a> {
Empty,
Format1(Index1<'a>),
Format2(Index2<'a>),
}
Expand description
Common type for uniform access to CFF and CFF2 index formats.
Variants§
Implementations§
source§impl<'a> Index<'a>
impl<'a> Index<'a>
sourcepub fn new(data: &'a [u8], is_cff2: bool) -> Result<Self, Error>
pub fn new(data: &'a [u8], is_cff2: bool) -> Result<Self, Error>
Creates a new index from the given data.
The caller must specify whether the data comes from a CFF2
table.
sourcepub fn subr_bias(&self) -> i32
pub fn subr_bias(&self) -> i32
Computes a bias that is added to a subroutine operator in a charstring.
See https://learn.microsoft.com/en-us/typography/opentype/spec/cff2#9-local-and-global-subr-indexes
sourcepub fn size_in_bytes(&self) -> Result<usize, ReadError>
pub fn size_in_bytes(&self) -> Result<usize, ReadError>
Returns the total size in bytes of the index table.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Index<'a>
impl<'a> RefUnwindSafe for Index<'a>
impl<'a> Send for Index<'a>
impl<'a> Sync for Index<'a>
impl<'a> Unpin for Index<'a>
impl<'a> UnwindSafe for Index<'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,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)