Enum read_fonts::tables::loca::Loca

source ·
pub enum Loca<'a> {
    Short(&'a [BigEndian<u16>]),
    Long(&'a [BigEndian<u32>]),
}
Expand description

The loca table.

Variants§

§

Short(&'a [BigEndian<u16>])

§

Long(&'a [BigEndian<u32>])

Implementations§

source§

impl<'a> Loca<'a>

source

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

source

pub fn len(&self) -> usize

source

pub fn is_empty(&self) -> bool

source

pub fn get_raw(&self, idx: usize) -> Option<u32>

Attempt to return the offset for a given glyph id.

source

pub fn get_glyf( &self, gid: GlyphId, glyf: &Glyf<'a> ) -> Result<Option<Glyph<'a>>, ReadError>

Trait Implementations§

source§

impl<'a> Clone for Loca<'a>

source§

fn clone(&self) -> Loca<'a>

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
source§

impl<'a> Debug for Loca<'a>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a> FontReadWithArgs<'a> for Loca<'a>

source§

fn read_with_args( data: FontData<'a>, args: &Self::Args ) -> Result<Self, ReadError>

read an item, using the provided args. Read more
source§

impl ReadArgs for Loca<'_>

§

type Args = bool

source§

impl<'a> SomeArray<'a> for Loca<'a>

source§

fn len(&self) -> usize

The length of the array.
source§

fn get(&self, idx: usize) -> Option<FieldType<'a>>

Return the item at idx, or None if idx is out of bounds.
source§

fn type_name(&self) -> &str

The name of this type. For an array of u16s, this is [u16].
source§

fn is_empty(&self) -> bool

Returns true if this array is empty.
source§

impl<'a> SomeTable<'a> for Loca<'a>

source§

fn type_name(&self) -> &str

The name of this table
source§

fn get_field(&self, idx: usize) -> Option<Field<'a>>

Access this table’s fields, in declaration order.
source§

impl TopLevelTable for Loca<'_>

source§

const TAG: Tag = _

The table’s tag.

Auto Trait Implementations§

§

impl<'a> Freeze for Loca<'a>

§

impl<'a> RefUnwindSafe for Loca<'a>

§

impl<'a> Send for Loca<'a>

§

impl<'a> Sync for Loca<'a>

§

impl<'a> Unpin for Loca<'a>

§

impl<'a> UnwindSafe for Loca<'a>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.