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
font_name: String
The name of the font.
image_path: PathBuf
The path of the image atlas for the font.
chars: HashMap<u32, BMCharacter>
Hashmap of the characters in the font. <CharID, BMCharacter
>
line_height: u32
Line height of the font.
size: u32
Size of the font.
Methods
impl BMFont
[src]
pub fn load_and_parse<T: Into<PathBuf>>(path: T) -> Result<BMFont, String>
[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::load_and_parse("examples/fonts/iosevka.sfl") { Ok(bmfont) => bmfont, Err(_) => panic!("Failed to load iosevka.sfl"), }; println!("bmfont: {}", bmfont);
Trait Implementations
impl Debug for BMFont
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more