scummvm/scummvm — pull request #500 by lordhoto (2014-09-03 20:58:18+00:00)
Title: Improve TTF Rendering (includes Font API changes).

Very similar to pull request #499 this tackles the issue of negative x offsets in glyphs in TTF fonts. Unlike the previously mentioned pull request, this extends the font API to ways of querying bounding boxes of gylphs/strings to get the actual draw area of characters/strings. It also makes the TTF renderer take advantage of it and now allows negative offsets.

This might make the font API a bit confusing to use, because you can, for example, specify a character to draw at (0,0) but in reality it is drawn at (-1,0) now. However, that's really how fonts work in practice... The bounding box quering gives the real draw area and can thus be used for dirty rects etc.

TTF client code should check whether it is needed to use the actual bounding box in practice. I think the GUI should be fine because it limits drawing to an area on its own. Wintermute and ZVision need to be checked by their own authors.

Has been slightly tested in the GUI.