summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qfontenginedirectwrite_p.h
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2011-06-30 11:57:09 +0200
committerQt by Nokia <qt-info@nokia.com>2011-07-01 07:17:15 +0200
commit0fc1e852aef7d97f41d32fd575d7ee3b94c11f80 (patch)
tree4b739cc8a6dc1c8056e12facac64e9d139a3ee47 /src/gui/text/qfontenginedirectwrite_p.h
parent7a9c5eea815dbc124503180d91eb835ede3f3e50 (diff)
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>
Diffstat (limited to 'src/gui/text/qfontenginedirectwrite_p.h')
-rw-r--r--src/gui/text/qfontenginedirectwrite_p.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gui/text/qfontenginedirectwrite_p.h b/src/gui/text/qfontenginedirectwrite_p.h
index d0086fc49b..edf1e6a182 100644
--- a/src/gui/text/qfontenginedirectwrite_p.h
+++ b/src/gui/text/qfontenginedirectwrite_p.h
@@ -86,6 +86,10 @@ public:
glyph_metrics_t boundingBox(const QGlyphLayout &glyphs);
glyph_metrics_t boundingBox(glyph_t g);
+ glyph_metrics_t alphaMapBoundingBox(glyph_t glyph,
+ QFixed subPixelPosition,
+ const QTransform &matrix,
+ GlyphFormat format);
QFixed ascent() const;
QFixed descent() const;
@@ -97,7 +101,7 @@ public:
bool supportsSubPixelPositions() const;
- QImage alphaMapForGlyph(glyph_t glyph, QFixed subPixelPosition);
+ QImage alphaMapForGlyph(glyph_t, QFixed subPixelPosition, const QTransform &t);
QImage alphaRGBMapForGlyph(glyph_t t, QFixed subPixelPosition, int margin,
const QTransform &xform);