I've started working with this ttf implementation. It really is a lot faster than the other implemenation which I used so far (because this one does put characters on pages while the other used one character per texture).
I modified it somewhat to adapt it to my needs (and getting it a little closer to Irrlicht).
Changes I made are:
- No dependency on ustring (I don't think string-conversions should happen inside the font-class itself)
- Reworked that allocation stuff. That had some memory leaks. SGUITTGlyph uses now the rule of three (destructor, operator=, copy constructor are all needed when one is needed) and so I could get rid of the custom allocator. Also set_free_when_destroyed isn't about pointers of elements but about array-memory itself (yeah confusing stuff).
- remove textscenenodes. I get that they are useful, I just don't think they belong in that class.
- Font should probably not grab()/drop() the driver (we have no weak pointers unfortunately). I rewrote that stuff some more to pass the exact types needed.
- Avoid a few memory allocations in draw (not a good place to use a map as allocations are more expensive than linearly going over a small array).
- Minor stuff tidying up I changed on the way while hunting some independent bug (font-textures sometimes had been complete white, but that turned out to be an opengl-texture bug in svn trunk which will be fixed soon).
My version is here:https://code.google.com/p/irr-playgroun ... TTFont.cpphttps://code.google.com/p/irr-playgroun ... UITTFont.hhttps://code.google.com/p/irr-playgroun ... se/ttf.cpp
(an example how to use it)
Will still need some work probably until it can be added to Irrlicht directly. Especially have to think about handling the freetype face management (might move that to an own class so we can get the font constructor back into public).
But all in all a very nice implementation, thanks for it!