A lightweight and easy-to-use .sfl and .fnt file (bitmap font) parser made with Rust.
Documentation at docs.rs or simply:
toml
[dependencies]
bmfont_parser="0.1"
rust
extern crate bmfont_parser;
You're done! Here is an example of how to use it: ```rust use bmfont_parser::{BMFont, Format};
let bmfont = match BMFont::frompath(Format::SFL, "examples/fonts/iosevka.sfl") { Ok(bmfont) => bmfont, Err() => panic!("Failed to load iosevka.sfl"), };
println!("bmfont: {}", bmfont);
// Or Alternatively
let iosevkasfl = includestr!("examples/fonts/iosevka.sfl");
let bmfont = match BMFont::fromloaded(Format::SFL, iosevkasfl, "examples/fonts/iosevka.sfl") { Ok(bmfont) => bmfont, Err(_) => panic!("Failed to load iosevka.sfl"), };
println!("bmfont: {}", bmfont); ```
This crate is distributed under the terms of the MIT License.