Skip to main content

FontInfo

Struct FontInfo 

Source
pub struct FontInfo {
Show 20 fields pub name: Vec<u8>, pub size: i32, pub design_size: i32, pub checksum: u32, pub params: Vec<i32>, pub chars: HashMap<u32, CharMetrics, FastHash>, pub hyphen_char: i32, pub skew_char: i32, pub kind: FontKind, pub handle: u64, pub char_codes: [HashMap<u32, i32>; 4], pub ignore_ligatures: i32, pub data: Option<FontData>, pub lig_kern: LigKernMap, pub right_boundary: Option<u32>, pub expansion: Option<FontExpansion>, pub math_constants: Option<Rc<MathConstants>>, pub math_chars: Option<Rc<HashMap<u32, MathCharInfo>>>, pub size_spec: i32, pub vf: Option<Rc<VirtualFont>>,
}
Expand description

A loaded font.

Fields§

§name: Vec<u8>

The name as \fontname prints it.

§size: i32

The size (sp).

§design_size: i32

The design size (sp).

§checksum: u32

The TFM checksum (or the checksum of a Lua font table), written to DVI font definitions.

§params: Vec<i32>

Font parameters; params[k] is \fontdimen k (index 0 unused).

§chars: HashMap<u32, CharMetrics, FastHash>

Character metrics.

§hyphen_char: i32

\hyphenchar.

§skew_char: i32

\skewchar.

§kind: FontKind

The kind of font.

§handle: u64

Opaque handle for the loader/backend (e.g. index of the parsed OpenType font and its feature set).

§char_codes: [HashMap<u32, i32>; 4]

Per-character \lpcode, \rpcode, \efcode, \tagcode.

§ignore_ligatures: i32

\ignoreligaturesinfont and other per-font integers.

§data: Option<FontData>

Host data (shaping, embedding).

§lig_kern: LigKernMap

Lig/kern programs by left character; only the first step for each right character is kept. LEFT_BOUNDARY holds the left boundary program.

§right_boundary: Option<u32>

The right boundary character (TFM’s bchar), if any.

§expansion: Option<FontExpansion>

Font expansion parameters (\expandglyphsinfont), if expandable.

§math_constants: Option<Rc<MathConstants>>

The OpenType MathConstants (in scaled points, or percent), for fonts loaded with a MATH table; they set the \Umath… parameters when the font is assigned to a math family.

§math_chars: Option<Rc<HashMap<u32, MathCharInfo>>>

Per-character OpenType math data (variants, extensible parts, top accent attachments), for math fonts.

§size_spec: i32

The size requested by \font (positive at size, or minus the scaled factor); i32::MIN if not loaded by \font.

§vf: Option<Rc<VirtualFont>>

How to draw the characters, for a TFM font that has a virtual font (.vf) of the same name, or a font from Lua whose characters have commands.

Implementations§

Source§

impl FontInfo

Source

pub fn null() -> Self

The null font: no characters, seven zero parameters.

Trait Implementations§

Source§

impl Clone for FontInfo

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FontInfo

Source§

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

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

impl Default for FontInfo

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

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

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.