pioneerspacesim/pioneer — pull request #2796 by robn (2014-03-03 03:32:55+00:00)
Title: Incremental glyph rendering

This changes the text renderer to load and render glyphs from the font on demand, rather than up front. This is necessary for non-Latin languages that will never use the basic set that we load at startup, and for any language that uses a large range of codepoints (eg CJK) where pre-rendering will overflow the atlas.

It still can't do anything about overflowing the atlas (other than a fairly useless error), though that could be handled if necessary (grow the atlas or start a new one). I'm also not doing per-glyph font fallbacks as discussed because I need to be a bunch more thinking around non-matching metrics across multiple fonts.

With the addition of a CJK-capable font, this is enough to get our Chinese Mandarin translation up and running:

![](http://i.imgur.com/DPDSxZB.png)

I will submit that in a separate PR once this is merged and we've been able to select appropriate fonts. Further discussion on that should go to [this thread](http://pioneerspacesim.net/forum/viewtopic.php?f=4&t=165).