New TrueType Package

So far it’s only stb_truetype.h ported to Zig but I think it would be nice to evolve past that if there’s interest.

Here’s a screenshot of it in use:

26 Likes

:hearts: :hearts: :hearts:

… C++, a programming language everyone agrees should be wiped from the face of the Earth.
My personal code of conduct forbids me from adding libc++ as a runtime dependency to any of my projects.

4 Likes

Are you interested in supporting open type fonts too? Looks like you haven’t added support for CFF tables and ‘charstring’ instruction parsing. I have already ported that logic from stb_truetype to zig in my truetype project and was considering making a PR. The main thing this would be adding is the *T2() methods such as this

yeah sure, seems reasonable. let me fix the unit tests real quick, I was leaving that last one I added running for a few days to test 100% of the input space, but it should really just test a sample so that the unit tests don’t take multiple days to run :slight_smile:

edit: done

ah. now i see why the tests were taking so long to run.

i’ll try to include some new tests with a small otf font file too.

might be a bit. some tests aren’t passing with a few .otf files i’ve tried.