For a while now I have been working on tatfi, a font parsing library in Zig. It is a port of the great ttf_parser Rust library.
It is almost stateless, almost allocation-free. Aims to be completely safe from memory corruption and panics. Obviously Zig doesn’t have the same guarantees as Rust, but I promise I did my best! If you find any panics please report them as bugs.
It is still a work on progress, with the API surface not replicated yet, and the library not “ziggified” yet. I am still yet also to port tests. Any help in this regard is appreciated.
The library needs users to know where the holes are. It should already be usable for most uses including rasterization, and, if you dare, shaping.
It compiles fine in 0.15.2 and master, so far.
Please have fun. If you do something cool with the library, please let me know so I can add it to the README.
Yes, I’m that guy yapping about other people work… sorry about that. Still, I just want to ask: when you say ttf parser – does this include otf?
I mean, forget the fancy features like dynamic ligatures and stuff like this for full Unicode but the fact that OpenType supports natively an entire font family in a single file is huge from the get go as far as font management go… Just saying…
Later edit:
I have a very strange ISP contract: lets me spam people but is very expensive to click links and inform myself… :)) just saw in your link “OpenType” so… great news. I’ll try to help by shutting up from now on
Small update on the library. The API surface port is now complete, I think. I will start porting tests soon, but the best tests are users trying out the library.
If you’re looking to build a font rasterizer, you can use tatfi to get the outlines and colors. Please do so and let me know.