titanf 2.0.0

Fast, safe, no_std font rasterizer written in pure Rust
Documentation

TiTanFont

Fast TrueType font rasterizer in pure Rust

Rust License no_std crates.io

🦀 Pure Rust • 📦 Zero Dependencies • ⚙️ no_std

Quick Start

use titanf::TrueTypeFont;

fn main() {
    let font_data = include_bytes!("Roboto-Medium.ttf");
    let mut font = TrueTypeFont::load_font(font_data);

    // Render a character
    let (metrics, bitmap) = font.get_char::<false>('A', 16.0);

    // Enable built-in glyph caching
    let (metrics, bitmap) = font.get_char::<true>('B', 16.0);
    //                                      ^^^^ caching enabled
}

Add to your Cargo.toml:

[dependencies]

titanf = "x.x.0"

Features

  • 🚀 Fast — Up to 100,000 glyphs/second at 16px
  • 🦀 Zero Dependencies — Pure Rust, no external crates
  • 📦 no_std — Works in bare-metal environments (requires alloc)
  • 💯 Stable Rust — No nightly features, no unsafe code
  • 🔧 Built-in Parser — Handles TrueType tables: cmap, glyf, head, hhea, hmtx, kern, loca, maxp

Benchmarks

All benchmarks run on the same hardware with consistent methodology:

  • Identical parameters across rasterizers
  • Results wrapped in black_box() to prevent optimization
  • Multiple runs averaged for consistency
  • No caching enabled

Run benchmarks yourself:

cargo bench

License

Licensed under the MIT License.

Contributing

Contributions are welcome! Open an issue or PR on GitHub.