cinder/Cinder — pull request #165 by safetydank (2012-04-18 16:29:22+00:00)
Title: Textengine contrib

I'm opening this to get feedback on the current state of the refactor and track associated issues. This branch is based on master.

It introduces one breaking change - the Font class has been replaced by FontRef, constructed by Font::create methods and accessed by ->. All other public interfaces have been kept the same.

The TextEngine class holds the backend specific code for rendering TextureFont and TextBox classes. TextLayout does not use TextEngine for now I'm not sure the best way to implements the platform specific parts of Run / Line while keeping the internals hidden as they are now.

TextureFont uses a new class gl::TextureFontAtlas to tightly pack glyphs onto multiple textures, and enable multiple TextureFonts to share a GL texture. This is an optional interface, the existing create methods still work as expected.

A FreeType TextEngine implementation is provided. It adds a third-party library "UTF8-CPP" for handling UTF-8 conversions (necessary on Android, which has minimal wstring support). This supports rendering via TextureFont methods only, and will return empty Surfaces for other render calls. It doesn't handle Shape2D conversion, returning an empty shape.

I've modified and tested samples to use the new Font class, on Windows, OS X and Android so far.