#bm-font #font #game

bmf-parser

read BMFont binary files

2 releases

Uses new Rust 2024

0.0.2 Apr 4, 2025
0.0.1 Nov 3, 2024

#1830 in Game dev

Download history 132/week @ 2025-01-08 38/week @ 2025-01-15 30/week @ 2025-01-22 3/week @ 2025-01-29 23/week @ 2025-02-05 26/week @ 2025-02-12 28/week @ 2025-02-19 81/week @ 2025-02-26 78/week @ 2025-03-05 38/week @ 2025-03-12 18/week @ 2025-03-19 73/week @ 2025-03-26 237/week @ 2025-04-02 35/week @ 2025-04-09 61/week @ 2025-04-16 68/week @ 2025-04-23

410 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