fontmesh
Library for converting TrueType font glyphs to 2D and 3D triangle meshes. A faster, pure Rust alternative to ttf2mesh.
Quick Start
use ;
let font_data = include_bytes!;
let face = parse?;
// 2D mesh with 20 subdivisions per curve
let mesh_2d = char_to_mesh_2d?;
// 3D mesh with depth 5.0 and 50 subdivisions
let mesh_3d = char_to_mesh_3d?;
Caching
use HashMap;
use Arc;
// Cache just the font data
let mut cache: = new;
cache.insert;
// Parse Face when needed (cheap!)
let data = cache.get.unwrap;
let face = parse?;
let mesh = char_to_mesh_3d?;
Examples
Performance
fontmesh is 2-3x faster than comparable libraries.
Run benchmarks: cargo bench
License
MIT