3 ms·
One unfortunate lesson I've had to relearn a couple times is that once your font rendering library is done, you get to start the unbearably complex task of actu
by kevingadd 7y ago
One unfortunate lesson I've had to relearn a couple times is that once your font rendering library is done, you get to start the unbearably complex task of actually using it to render text, which means shaping - taking the text and splitting it out into individual glyphs from one or more fonts and laying them out. This task is simple enough for western character sets that you can ignore it (and people often do) but the moment you've got customers overseas the risk increases that you will suddenly have to do a ton of work.
Unfortunately, the main good shapers out there I'm aware of are either built to be used with FreeType or are built for a specific OS and its platform-specific font infrastructure. I'd love to see a lightweight shaper to go with a library like libschrift. Anyone run across one before?
- jchw 7y agoDon’t forget layout; Freetype + HarfBuzz + FreeBiDi seems to be the defacto combination. Of all the things I want rewrite-it-in-Rust alternatives, these are probably the things I want the most. (I am aware of RustType; certainly it’s a start.)
- floatboth 7y agoAlso https://github.com/yeslogic/allsorts https://github.com/yeslogic/allsorts https://github.com/RazrFalcon/rustybuzz https://github.com/RazrFalcon/rustybuzz
- jfk13 7y agoHarfBuzz seems like it ought to fit the bill. It does come with some freetype-integration code, but you don't have to use that; it's fairly straightforward to use harfbuzz shaping in conjunction with Quartz2d or DirectWrite glyph rendering, for example. I imagine using it with libschrift would be similar.
- qznc 7y agoHere is a war story from the Harfbuzz dude: https://docs.google.com/document/d/1wMPwVNBvsIriamcyBO5aNs7Cdr8lmbwLJ8GmZBAswF4 https://docs.google.com/document/d/1wMPwVNBvsIriamcyBO5aNs7C... > It turns out, for many of the scripts we are interested in (Indic-like ones), we have to deal with a word list of around a million items or less to cover all of Wikipedia! That was great, because now I could run the entire test suite for, say, Hindi, and it would take 10 seconds to run [...] For the two years since we have use this test-driven methodology for all changes to the Indic-related shaping logic and has been able to constantly improve the quality of the shaper release after release. So even if you have a great infrastructure in place, it is still years of tuning.