Struct sfl_parser::BMFont [] [src]

pub struct BMFont {
    pub font_name: String,
    pub image_path: PathBuf,
    pub chars: HashMap<u32, BMCharacter>,
    pub line_height: u32,
    pub size: u32,
}

Loaded and parsed struct of an .sfl file (a bitmap font file).

Fields

The name of the font.

The path of the image atlas for the font.

Hashmap of the characters in the font. &ltCharID, BMCharacter&gt

Line height of the font.

Size of the font.

Methods

impl BMFont
[src]

[src]

Load and parse a BMFont from the given path, which should be an .sfl file.

Examples

use sfl_parser::BMFont;

let bmfont = match BMFont::from_path("examples/fonts/iosevka.sfl") {
    Ok(bmfont) => bmfont,
    Err(_) => panic!("Failed to load iosevka.sfl"),
};

println!("bmfont: {}", bmfont);

Trait Implementations

impl Debug for BMFont
[src]

[src]

Formats the value using the given formatter. Read more

impl Display for BMFont
[src]

[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl Send for BMFont

impl Sync for BMFont