Skip to main content

TfmFont

Type Alias TfmFont 

Source
pub type TfmFont<I, D, CS> = Ptr<TfmFontI<I, D, CS>>;
Expand description

A Font represented by a .tfm-file, as used by plain TeX, eTeX and pdfTeX for Character=u8; defined as Rc<TfmFontI> for clonability.

Aliased Type§

pub struct TfmFont<I, D, CS> { /* private fields */ }

Trait Implementations§

Source§

impl<I: TeXInt, D: TeXDimen + Numeric<I>, CS: CSName<u8>> Font for TfmFont<I, D, CS>

Source§

type Char = u8

The type of Characters used by this font.
Source§

type CS = CS

The type of control sequences used to give a name to a font; returned by e.g. \the when followed by a font.
Source§

type Int = I

The type of TeXInts used by this font, for e.g. \skewchar, \hyphenchar etc. - these numbers may escape the actual character range of the font, so we use TeXInts instead of Characters.
Source§

type Dim = D

The type of TeXDimens used by this font, for e.g. \fontdimen, \fontcharwd etc.
Source§

fn has_char(&self, c: Self::Char) -> bool

Returns whether this font has a glyph for the given Character.
Source§

fn get_hyphenchar(&self) -> I

Returns the \hyphenchar of this font.
Source§

fn set_hyphenchar(&mut self, c: I)

Sets the \hyphenchar of this font.
Source§

fn get_skewchar(&self) -> I

Returns the \skewchar of this font.
Source§

fn set_skewchar(&mut self, c: I)

Sets the \skewchar of this font.
Source§

fn get_at(&self) -> Self::Dim

The size of the font; initially provided by the font itself, but can be set via e.g. \font\foo=cmr10 at 12pt.
Source§

fn has_at_set(&self) -> bool

Returns whether the size of the font has been set via e.g. at ....
Source§

fn get_dim(&self, idx: u16) -> Self::Dim

Returns the \fontdimen at the given index (-1); i.e. \fontdimen5 returns get_dim(4).
Source§

fn set_dim(&mut self, idx: u16, d: Self::Dim)

Sets the \fontdimen at the given index (-1); i.e. \fontdimen5=... calls set_dim(4).
Source§

fn set_at(&mut self, d: Self::Dim)

Sets the size of the font.
Source§

fn name(&self) -> &Self::CS

Returns the name of the font as a CSName; used by e.g. \the\font.
Source§

fn filename(&self) -> &str

Returns the filename of the font.
Source§

fn display<W: Write>( &self, _i: &<Self::CS as CSName<u8>>::Handler, w: W, ) -> Result

Writes a human-readable representation of this font to the given std::fmt::Writer Read more
Source§

fn get_ic(&self, c: Self::Char) -> Self::Dim

Returns the litalic correction of the given Character in this font.
Source§

fn set_ic(&mut self, c: Self::Char, d: Self::Dim)

Sets the litalic correction of the given Character in this font.
Source§

fn get_wd(&self, c: Self::Char) -> Self::Dim

Returns the width the given Character in this font.
Source§

fn get_ht(&self, c: Self::Char) -> Self::Dim

Returns the height the given Character in this font.
Source§

fn get_dp(&self, c: Self::Char) -> Self::Dim

Returns the depth the given Character in this font.
Source§

fn ligature(&self, char1: Self::Char, char2: Self::Char) -> Option<Self::Char>

Returns the ligature of the given Characters in this font, if any; e.g. most fonts combine - and - into an endash.
Source§

impl<I: TeXInt, D: TeXDimen + Numeric<I>, CS: CSName<u8>> FontWithLpRp for TfmFont<I, D, CS>

Source§

fn get_lp(&self, c: Self::Char) -> I

Source§

fn set_lp(&mut self, c: Self::Char, d: I)

Source§

fn get_rp(&self, c: Self::Char) -> I

Source§

fn set_rp(&mut self, c: Self::Char, d: I)