logo
pub trait Font {
    const FONT_IMAGE: &'static [u8];
    const FONT_IMAGE_WIDTH: u32;
    const CHARACTER_SIZE: Size;
    const CHARACTER_SPACING: u32;
    const VARIABLE_WIDTH: bool;

    fn char_offset(_: char) -> u32;

    fn char_width(c: char) -> u32 { ... }
fn character_pixel(c: char, x: u32, y: u32) -> bool { ... } }
Expand description

Monospaced bitmap font.

Associated Constants

Raw image data containing the font.

The width of the raw image data.

The width must be divisible by 8 and CHARACTER_SIZE.width.

Size of a single character in pixel.

Spacing between characters.

The spacing defines how many empty pixels are added horizontally between adjacent characters on a single line of text.

Whether characters have a variable width or not.

Variable width characters have a maximum width of CHARACTER_SIZE.x, but the empty columns at the right of each characters are ignored, allowing some characters to be smaller than others.

Required methods

Returns the position a character in the font.

Provided methods

Returns the actual width of a character in the font.

Returns the value of a pixel in a character in the font.

Implementors