pub trait Font: Clone + Debug {
type Char: Character;
type Dim: TeXDimen;
type Int: TeXInt;
type CS: CSName<Self::Char>;
Show 19 methods
// Required methods
fn get_at(&self) -> Self::Dim;
fn has_at_set(&self) -> bool;
fn set_at(&mut self, d: Self::Dim);
fn name(&self) -> &Self::CS;
fn filename(&self) -> &str;
fn get_dim(&self, idx: u16) -> Self::Dim;
fn set_dim(&mut self, idx: u16, d: Self::Dim);
fn get_hyphenchar(&self) -> Self::Int;
fn set_hyphenchar(&mut self, c: Self::Int);
fn get_skewchar(&self) -> Self::Int;
fn set_skewchar(&mut self, c: Self::Int);
fn has_char(&self, c: Self::Char) -> bool;
fn display<W: Write>(
&self,
i: &<Self::CS as CSName<Self::Char>>::Handler,
w: W,
) -> Result;
fn get_wd(&self, c: Self::Char) -> Self::Dim;
fn get_ht(&self, c: Self::Char) -> Self::Dim;
fn get_dp(&self, c: Self::Char) -> Self::Dim;
fn get_ic(&self, c: Self::Char) -> Self::Dim;
fn set_ic(&mut self, c: Self::Char, d: Self::Dim);
fn ligature(&self, c1: Self::Char, c2: Self::Char) -> Option<Self::Char>;
}Expand description
Required Associated Types§
Sourcetype Dim: TeXDimen
type Dim: TeXDimen
The type of TeXDimens used by this font, for e.g. \fontdimen, \fontcharwd etc.
Sourcetype CS: CSName<Self::Char>
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.
Required Methods§
Sourcefn get_at(&self) -> Self::Dim
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.
Sourcefn has_at_set(&self) -> bool
fn has_at_set(&self) -> bool
Returns whether the size of the font has been set via e.g. at ....
Sourcefn get_dim(&self, idx: u16) -> Self::Dim
fn get_dim(&self, idx: u16) -> Self::Dim
Returns the \fontdimen at the given index (-1); i.e. \fontdimen5 returns get_dim(4).
Sourcefn set_dim(&mut self, idx: u16, d: Self::Dim)
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).
Sourcefn get_hyphenchar(&self) -> Self::Int
fn get_hyphenchar(&self) -> Self::Int
Returns the \hyphenchar of this font.
Sourcefn set_hyphenchar(&mut self, c: Self::Int)
fn set_hyphenchar(&mut self, c: Self::Int)
Sets the \hyphenchar of this font.
Sourcefn get_skewchar(&self) -> Self::Int
fn get_skewchar(&self) -> Self::Int
Returns the \skewchar of this font.
Sourcefn set_skewchar(&mut self, c: Self::Int)
fn set_skewchar(&mut self, c: Self::Int)
Sets the \skewchar of this font.
Sourcefn has_char(&self, c: Self::Char) -> bool
fn has_char(&self, c: Self::Char) -> bool
Returns whether this font has a glyph for the given Character.
Sourcefn display<W: Write>(
&self,
i: &<Self::CS as CSName<Self::Char>>::Handler,
w: W,
) -> Result
fn display<W: Write>( &self, i: &<Self::CS as CSName<Self::Char>>::Handler, w: W, ) -> Result
Writes a human-readable representation of this font to the given std::fmt::Writer
Sourcefn get_wd(&self, c: Self::Char) -> Self::Dim
fn get_wd(&self, c: Self::Char) -> Self::Dim
Returns the width the given Character in this font.
Sourcefn get_ht(&self, c: Self::Char) -> Self::Dim
fn get_ht(&self, c: Self::Char) -> Self::Dim
Returns the height the given Character in this font.
Sourcefn get_dp(&self, c: Self::Char) -> Self::Dim
fn get_dp(&self, c: Self::Char) -> Self::Dim
Returns the depth the given Character in this font.
Sourcefn get_ic(&self, c: Self::Char) -> Self::Dim
fn get_ic(&self, c: Self::Char) -> Self::Dim
Returns the litalic correction of the given Character in this font.
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.