Crates.io | sfl_parser |
lib.rs | sfl_parser |
version | 1.3.1 |
source | src |
created_at | 2018-03-10 22:07:49.195655 |
updated_at | 2019-01-15 21:14:32.026065 |
description | Lightweight and easy-to-use bitmap font (.sfl) parser |
homepage | |
repository | https://github.com/Teascade/sfl_parser |
max_upload_size | |
id | 54916 |
size | 27,675 |
bmfont_parser
, as the name has grown inaccurate to the functionality of this crateA lightweight and easy-to-use .sfl file (bitmap font) parser made with Rust.
Documentation at docs.rs or simply:
[dependencies]
sfl_parser="1.3"
extern crate sfl_parser;
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);
// Or Alternatively
let iosevka_sfl = include_str!("examples/fonts/iosevka.sfl");
let bmfont = match BMFont::from_loaded(iosevka_sfl, "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.