pioneerspacesim/pioneer — pull request #1899 by johnbartholomew (2013-01-04 01:51:52+00:00)
Title: TextureFont improvements and language-specific font overrides

Includes #1713.

* Adds DejaVu as a fallback font.
* IniConfig is extended to support sections in ini files.
* TextureFormat/ImageFormat are extended to support LUMINANCE_ALPHA, INTENSITY and ALPHA formats. **Warning:** This needs checking on OS X, since it is a deprecated part of OpenGL which might be unavailable there.
* TextureFont now uses the correct blend mode (ALPHA_PREMULT). This makes fonts appear bolder than before.
* TextureFont now uses a LUMINANCE_ALPHA texture for outline fonts, and an INTENSITY texture for non-outline fonts. This should reduce the amount of texture memory required.
* TextureFont now uses a texture up to 1024x1024 pixels large. It has a fixed width, and selects the smallest power-of-two height (up to 1024) that can hold all the glyphs.
* FontDescriptor::Load now looks for a language-specific section in the font configuration. If present, this section overrides the default values.
* Partial Russian translation, from @HeadHunterEG.
* The DejaVu fonts are used for the Russian translation, because they support cyrillic glyphs.
* The console font is no longer configured as an outline font, because with the blending mode fix this is no longer necessary.

Possible problems:
* GL_LUMINANCE_ALPHA and GL_INTENSITY may not work at all on recent versions of OS X. The quick fix for this is to revert to using a full RGBA texture. That would double or quadruple the amount of texture memory required for fonts though (and we actually generate several TextureFonts -- more than we need, I think)
* The default fonts or font configurations might need to be changed because with the fixed blending mode the text looks bolder than before.
* I had to thread the current language into various places to reach FontDescriptor::Load. I'm not sure I like this (though I'm not sure it's wrong, either).
* Perhaps DejaVu isn't the best fallback font to use.