bmf-parser 0.0.2

read BMFont binary files
Documentation
  • Coverage
  • 0%
    0 out of 48 items documented0 out of 8 items with examples
  • Size
  • Source code size: 41.03 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.46 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 12s Average build duration of successful builds.
  • all releases: 15s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • piot/bmf-parser
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • piot

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

Useful links

License

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