Format

Trait Format 

Source
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§

Source

fn null() -> Self

Return the null font in this format.

Source

fn width(&self, c: char) -> Option<Scaled>

Get the width of the character, or None if the character is not defined in the font.

Source

fn height(&self, c: char) -> Option<Scaled>

Get the height of the character, or None if the character is not defined in the font.

Source

fn depth(&self, c: char) -> Option<Scaled>

Get the depth of the character, or None if the character is not defined in the font.

Source

fn default_space(&self) -> Glue

Source

fn extra_space(&self) -> Scaled

Provided Methods§

Source

fn width_height_depth(&self, c: char) -> Option<[Scaled; 3]>

Get the width, height and depth of the character, or None if the character is not defined in the 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.

Implementors§