CBLCTable

Struct CBLCTable 

Source
pub struct CBLCTable<'a> {
    pub major_version: u16,
    pub minor_version: u16,
    pub bitmap_sizes: Vec<BitmapSize<'a>>,
}
Expand description

CBLC — Color Bitmap Location Table

Fields§

§major_version: u16

Major version of this table.

2 for EBLC, 3, for CBLC

§minor_version: u16

Minor version of this table.

§bitmap_sizes: Vec<BitmapSize<'a>>

Array of “strikes” available for this font.

Implementations§

Source§

impl<'a> CBLCTable<'a>

Source

pub fn find_strike( &self, glyph_id: u16, target_ppem: u8, max_bit_depth: BitDepth, ) -> Option<MatchingStrike<'_, 'a>>

Find a strike matching the supplied criteria.

  • glyph_id is the glyph to lookup.
  • target_ppem is the desired size. If an exact match can’t be found the nearest one will be returned, favouring being oversize vs. undersized.
  • max_bit_depth is the maximum accepted bit depth of the bitmap to return. If you accept all bit depths then use BitDepth::ThirtyTwo.

Trait Implementations§

Source§

impl<'b> ReadBinary for CBLCTable<'b>

Source§

type HostType<'a> = CBLCTable<'a>

Source§

fn read<'a>(ctxt: &mut ReadCtxt<'a>) -> Result<Self::HostType<'a>, ParseError>

Auto Trait Implementations§

§

impl<'a> Freeze for CBLCTable<'a>

§

impl<'a> RefUnwindSafe for CBLCTable<'a>

§

impl<'a> Send for CBLCTable<'a>

§

impl<'a> Sync for CBLCTable<'a>

§

impl<'a> Unpin for CBLCTable<'a>

§

impl<'a> UnwindSafe for CBLCTable<'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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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

impl<T> ReadBinaryDep for T
where T: ReadBinary,

Source§

type Args<'a> = ()

Source§

type HostType<'a> = <T as ReadBinary>::HostType<'a>

Source§

fn read_dep<'a>( ctxt: &mut ReadCtxt<'a>, _: <T as ReadBinaryDep>::Args<'_>, ) -> Result<<T as ReadBinaryDep>::HostType<'a>, ParseError>

Source§

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

Source§

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>,

Source§

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.