5 stable releases
Uses old Rust 2015
1.3.1 | Jan 15, 2019 |
---|---|
1.3.0 | Mar 18, 2018 |
1.2.0 | Mar 13, 2018 |
1.1.0 | Mar 11, 2018 |
1.0.2 | Mar 10, 2018 |
#2117 in Parser implementations
15KB
270 lines
sfl_parser
sfl_parser has permanently moved to bmfont_parser
, as the name has grown inaccurate to the functionality of this crate
A lightweight and easy-to-use .sfl file (bitmap font) parser made with Rust.
How to use
Documentation at docs.rs or simply:
- Add the following to your dependencies:
[dependencies] sfl_parser="1.3"
- To your Rust project add the following line:
extern crate sfl_parser;
- You're done! Here is an example of how to use it:
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);
License
This crate is distributed under the terms of the MIT License.