Skip to content

Consider using ttf-parser crate

As stated in the readme:

Replacing the dependency on stb_truetype-rs (a translation of stb_truetype.h), with OpenType font loading written in idiomatic Rust.

ttf-parser is a pure Rust, zero unsafe, zero allocation TrueType and OpenType parser. It's still in development, but it's already better that stb-truetype-rs. It supports more features, mainly CFF, and around 20% faster in glyf outlining. Also, it support most of the cmap tables.

I'm not sure what features do you require, but I'm happy to implement them. The main one is outlining. ttf-parser is pretty high-level, so it produces only curves, not raw points (which are used in rusttype, afaiu). On the other hand, CFF contains only curves anyway. Also, ttf-parser doesn't support the kern table yet, which is required by rusttype.