Skip to main content

TrueTypeFont

Struct TrueTypeFont 

Source
pub struct TrueTypeFont {
    pub kern_table: BTreeMap<(u32, u32), i16>,
    pub cache: Cache,
    pub dpi: f32,
    /* private fields */
}

Fields§

§kern_table: BTreeMap<(u32, u32), i16>§cache: Cache§dpi: f32

Implementations§

Source§

impl TrueTypeFont

Source

pub fn set_dpi(&mut self, dpi: f32)

Source

pub fn load_font(font_bytes: &[u8]) -> Result<Self, FontError>

Source§

impl TrueTypeFont

Source

pub fn get_char<const CACHE: bool>( &mut self, c: char, size: f32, ) -> (Metrics, Vec<u8>)

Source

pub fn get_char_lines( &self, c: char, size: f32, ) -> (Metrics, Vec<Line>, Vec<Line>, Vec<Line>)

Source§

impl TrueTypeFont

Source

pub fn load_cmap(&mut self, font_bytes: &[u8]) -> Result<(), FontError>

Source

pub fn load_cmap_encodings(&mut self, font_bytes: &[u8])

Source

pub fn load_cmap_subtable_formats(&mut self, font_bytes: &[u8])

Source

pub fn load_cmap_subtables(&mut self, font_bytes: &[u8])

Source§

impl TrueTypeFont

Source

pub fn get_kerning_by_id(&self, left: u32, right: u32) -> Option<&i16>

Source

pub fn get_kerning(&self, left: char, right: char) -> Option<&i16>

Auto Trait Implementations§

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