pioneerspacesim/pioneer — pull request #981 by robn (2012-02-17 08:04:48+00:00)
Title: Font refactor

Started as a minor thing, ended a bit more than that. Oh well.

The initial motivation was to decouple the font stack (ie `TextureFont`, `Font`, `FontConfig`, `IniConfig`, `StringF` and `Texture`) from the rest of the core so I can use it in my GUI work without needing to link most of the core. As usual, that proved slightly more difficult than expected, so I've had to reshuffle a fair amount of stuff. The major bit is to stop `libs.h` including `utils.h` (`utils.cpp` ends up depending on just about everything for link) and then everything that goes on from that. The only completely hateful bit is `TextSupport`, but I need the multibyte conversion functions without needing `utils`. It needs to be put somewhere sane, but that can come later.

The other thing is done is to decouple the font classes themselves from the `FontCache` (previously known as `FontManager`). The major difference now is that each font carries its own `FT_Library` object. I have no idea how heavy these things are, but I figure we can get away with it for now because the number of fonts loaded is quite small. Again, something we can rectify in the future - we already know that the font classes aren't finished yet (remove `VectorFont`, whole string baking, demand-loading glyphs, etc).