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 09:57:09 (GMT)
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2011-06-30 10:34:48 (GMT)
commitf54c5d9133d7aa7636988db36fa6cc51d26434b6 (patch)
treebc8455d00bc1c2537ef27632a3803e78c9b09aff /src/gui/text/qfontenginedirectwrite_p.h
parent2dc710f52926b5a343daa0e99fe5dc521a8a8042 (diff)
downloadQt-f54c5d9133d7aa7636988db36fa6cc51d26434b6.zip
Qt-f54c5d9133d7aa7636988db36fa6cc51d26434b6.tar.gz
Qt-f54c5d9133d7aa7636988db36fa6cc51d26434b6.tar.bz2
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
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 d0086fc..edf1e6a 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);