Fix transformations on DirectWrite rasterized text
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
Thu, 30 Jun 2011 09:57:09 +0000 (11:57 +0200)
committerQt by Nokia <qt-info@nokia.com>
Fri, 1 Jul 2011 05:17:15 +0000 (07:17 +0200)
commit0fc1e852aef7d97f41d32fd575d7ee3b94c11f80
tree4b739cc8a6dc1c8056e12facac64e9d139a3ee47
parent7a9c5eea815dbc124503180d91eb835ede3f3e50
Fix transformations on DirectWrite rasterized text

There were a few bugs in the DirectWrite font engine that caused
transformed text to break.

First of all, alphaMapForGlyph() ignored the transform, so no gray
antialiased text would be transformed.

Second of all, the imageForGlyph() function would use the wrong
bounding box for the rasterized glyph, causing its positioning to
become a little bit off when rotating. The fix is to get the bounding
box from the system and add a margin to this instead of trying to predict
how it will appear after the vertical hinting etc. has been applied.

So that the positioning metrics are in sync with the actual metrics used
by the alphaMap* functions, we also need to implement the
alphaMapBoundingBox() function.

Task-number: QTBUG-19829
Reviewed-by: Jiang Jiang
(cherry picked from commit f54c5d9133d7aa7636988db36fa6cc51d26434b6)

Change-Id: I3c3840b41e19fcacf926dbf454bdc2cba4bd5a99
Reviewed-on: http://codereview.qt.nokia.com/948
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
src/gui/text/qfontenginedirectwrite.cpp
src/gui/text/qfontenginedirectwrite_p.h