Skip to main content

FontSystem

Trait FontSystem 

Source
pub trait FontSystem: Clone + Debug {
    type Char: Character;
    type CS: CSName<Self::Char>;
    type Int: TeXInt;
    type Font: Font<Char = Self::Char, CS = Self::CS, Dim = Self::Dim, Int = Self::Int>;
    type Dim: TeXDimen;

    // Required methods
    fn null(&self) -> Self::Font;
    fn new<ET: EngineTypes<Char = Self::Char, CSName = Self::CS>>(
        aux: &mut EngineAux<ET>,
    ) -> Self;
    fn new_font<S: AsRef<str>, F: FileSystem>(
        &mut self,
        path: S,
        macroname: <Self::Font as Font>::CS,
        fs: &mut F,
    ) -> Self::Font;
}
Expand description

A font system provides Fonts, which in turn provide various information about Characters (or, rather, glyphs) in that font.

Required Associated Types§

Source

type Char: Character

The type of Characters used by this font system.

Source

type CS: CSName<Self::Char>

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: TeXInt

The type of TeXInts used by this font system, 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 Font: Font<Char = Self::Char, CS = Self::CS, Dim = Self::Dim, Int = Self::Int>

The type of Fonts provided by this font system.

Source

type Dim: TeXDimen

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

Required Methods§

Source

fn null(&self) -> Self::Font

Returns the \nullfont.

Source

fn new<ET: EngineTypes<Char = Self::Char, CSName = Self::CS>>( aux: &mut EngineAux<ET>, ) -> Self

Creates a new font system.

Source

fn new_font<S: AsRef<str>, F: FileSystem>( &mut self, path: S, macroname: <Self::Font as Font>::CS, fs: &mut F, ) -> Self::Font

Creates a new font with the given macroname and filepath (in plain TeX a .tfm-file).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<I: TeXInt, D: TeXDimen + Numeric<I>, CS: CSName<u8>> FontSystem for TfmFontSystem<I, D, CS>

Source§

type Char = u8

Source§

type Int = I

Source§

type Font = Arc<TfmFontI<I, D, CS>>

Source§

type Dim = D

Source§

type CS = CS