pub trait Format {
// Required methods
fn null() -> Self;
fn width(&self, c: char) -> Option<Scaled>;
fn height(&self, c: char) -> Option<Scaled>;
fn depth(&self, c: char) -> Option<Scaled>;
fn default_space(&self) -> Glue;
fn extra_space(&self) -> Scaled;
// Provided method
fn width_height_depth(&self, c: char) -> Option<[Scaled; 3]> { ... }
}Expand description
Implementations of this trait provide the minimal set of features required by a font format.
Required Methods§
Sourcefn width(&self, c: char) -> Option<Scaled>
fn width(&self, c: char) -> Option<Scaled>
Get the width of the character, or None if the character is not defined in the font.
Sourcefn height(&self, c: char) -> Option<Scaled>
fn height(&self, c: char) -> Option<Scaled>
Get the height of the character, or None if the character is not defined in the font.
Sourcefn depth(&self, c: char) -> Option<Scaled>
fn depth(&self, c: char) -> Option<Scaled>
Get the depth of the character, or None if the character is not defined in the font.
fn default_space(&self) -> Glue
fn extra_space(&self) -> Scaled
Provided Methods§
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.