Skip to main content

Crate titanf

Crate titanf 

Source
Expand description

§TitanF

TitanF is a blazingly fast, dependency-free font rasterizer written in pure Rust.

  • Fast: all geometry work happens once at font load
  • Exact curves: quadratics are rasterized directly, never flattened
  • Zero dependencies, no_std compatible (requires alloc)
  • Kerning from both the legacy kern table and GPOS pair positioning
  • Panic-free on malformed or truncated fonts
use titanf::TrueTypeFont;

let font_data = std::fs::read("Roboto-Medium.ttf").unwrap();
let mut font = TrueTypeFont::load_font(&font_data).unwrap();

let (metrics, bitmap) = font.get_char::<false>('A', 16.0);
//                                      ^^^^^ turn caching on/off

§See Also

Re-exports§

pub use crate::font::TrueTypeFont;

Modules§

cache
Caching mechanisms
font
rasterizer
Glyph rasterization and scanline algorithms
render
Rendering utilities
tables
TrueType table structures (CMAP, GLYF, etc.)

Traits§

F32NoStd
A no_std replacement for common f32 methods