Enum ggez::graphics::Font [] [src]

pub enum Font {
    TTFFont {
        font: Font<'static>,
        points: u32,
    },
    BitmapFont {
        surface: Surface<'static>,
        glyphs: BTreeMap<char, u32>,
        glyph_width: u32,
    },
}

A font that defines the shape of characters drawn on the screen. Can be created from a .ttf file or from an image (bitmap fonts).

Variants

Fields of TTFFont

Fields of BitmapFont

Methods

impl Font
[src]

Load a new TTF font from the given file.

Loads an Image and uses it to create a new bitmap font The Image is a 1D list of glyphs, which maybe isn't super ideal but should be fine. The glyphs string is the characters in the image from left to right.

Trait Implementations

impl Debug for Font
[src]

Formats the value using the given formatter.