3 ms·
Show HN: TrueType Rasterizer
Hi. I wrote a (relatively) small TrueType rasterizer. It's not very powerful at this point but it will be expanded with more features in the near future. It has the most needed features and i guess it might be useful to someone. It can properly visualize 99.9% (or something like that) of the western glyphs, no support for left-to-right writing systems for now. I've tested in on a dozen of fonts and it works quite well. It is very slow at this point, and this is the main area for improvement for the next release. Also, it cannot properly render glyphs with self-intersecting contours - fortunatelly such glyphs are very rare. This issue will be fixed soon i hope. Another thing is that the rendering of small-size glyphs (below 14-15px) is not that good (but it's decent) as the rasterizer does not support hinting. The next release, that will come in few months, will probably have gradient-colored glyphs/strings and pre-computed glyphs to improve the drawing performance drastically (among other smaller improvements). More information in the Github page. It is C++ only but conversion to C should be very easy and probably i'll do it when i have some free time.
- chadcmulligan 1y agoVery nice, its great to see a rasteriser thats in a couple of files, a lot easier to study.
- s_petrov 1y agoYeah, also the code is relatively easy to understand (or atleast most of it). But, to get it to that level was very hard. Especially because of the OpenType/TrueType documentation which is quite unclear about certain aspects of the format.
- chadcmulligan 1y agoYou've done a very nice job. I don't know if you're interested in going that way but I'd happily purchase a book describing the code etc
- s_petrov 1y agoI will describe the code in detail when i have some free time, in few weeks maybe or something like that.
- deleted 1y ago[deleted]