#bm-font #font #game

bmf-parser

read BMFont binary files

2 releases

Uses new Rust 2024

new 0.0.2 Apr 4, 2025
0.0.1 Nov 3, 2024

#1700 in Game dev

Download history 21/week @ 2024-12-16 57/week @ 2024-12-30 67/week @ 2025-01-06 102/week @ 2025-01-13 32/week @ 2025-01-20 3/week @ 2025-01-27 19/week @ 2025-02-03 15/week @ 2025-02-10 32/week @ 2025-02-17 30/week @ 2025-02-24 116/week @ 2025-03-03 51/week @ 2025-03-10 21/week @ 2025-03-17 64/week @ 2025-03-24 185/week @ 2025-03-31

323 downloads per month
Used in 26 crates (2 directly)

MIT license

23KB
424 lines

bmf-parser 🖋️

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.

✨ Features

  • Simple API: Load BMFont binary data directly into a BMFont structure using a single method.
  • Comprehensive Font Data: Access font metadata, character properties, page details, and kerning pairs.
  • Efficient Parsing: Designed to be fast and efficient, perfect for games and applications needing bitmap font support.

📦 Installation

To start using bmf-parser, add it as a dependency in your Cargo.toml:

[dependencies]
bmf-parser = "0.0.1"

Usage

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(())
}

License

This project is licensed under the MIT License - see the LICENSE file for details.

Dependencies

~125KB