Skip to main content

FontTable

Struct FontTable 

Source
pub struct FontTable {
    pub fonts: Vec<FontInfo>,
    pub id_cs: Vec<CsId>,
    pub loader: Option<Box<dyn FontLoader>>,
    pub dense: Vec<DenseMetrics>,
}
Expand description

The table of loaded fonts.

Fields§

§fonts: Vec<FontInfo>

Fonts by id; id 0 is \nullfont.

§id_cs: Vec<CsId>

Identifier control sequence of each font (TeX’s font_id_text).

§loader: Option<Box<dyn FontLoader>>

The loader, if any.

§dense: Vec<DenseMetrics>

Dense metric tables for fast lookup of small character codes, by font id (see FontTable::sync_dense).

Implementations§

Source§

impl FontTable

Source

pub fn sync_dense(&mut self)

Builds the dense tables of fonts added since the last call. Call before hot loops; the character metrics of a font must not change afterwards (call FontTable::invalidate_dense if they do).

Source

pub fn invalidate_dense(&mut self, f: u32)

Forgets the dense table of font f and those after it.

Source

pub fn char_metrics(&self, f: u32, c: u32) -> Option<&CharMetrics>

The metrics of character c in font f.

Trait Implementations§

Source§

impl Debug for FontTable

Source§

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

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

impl Default for FontTable

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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> ErasedDestructor for T
where T: 'static,

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.