| Crates.io | bmf-parser |
| lib.rs | bmf-parser |
| version | 0.0.2 |
| created_at | 2024-11-03 14:42:08.60465+00 |
| updated_at | 2025-04-04 12:39:09.289759+00 |
| description | read BMFont binary files |
| homepage | |
| repository | https://github.com/piot/bmf-parser |
| max_upload_size | |
| id | 1433828 |
| size | 41,521 |
bmf-parser is a Rust crate for reading and parsing BMFont binary files, a popular font format for bitmap fonts often used in games and graphical applications. With bmf-parser, you can easily load BMFont data into a BMFont struct.
BMFont structure using a single method.To start using bmf-parser, add it as a dependency in your Cargo.toml:
[dependencies]
bmf-parser = "0.0.1"
use bmf_parser::BMFont;
use std::{fs, io};
fn main() -> std::io::Result<()> {
let mut octets = fs::read("path/to/font.fnt")?;
let font = BMFont::from_octets(&octets)?;
println!("Font info: {:?}", font.info);
println!("Character count: {}", font.chars.len());
Ok(())
}
This project is licensed under the MIT License - see the LICENSE file for details.