summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2011-10-17 15:51:55 +0200
committerQt by Nokia <qt-info@nokia.com>2011-10-17 16:04:33 +0200
commitfa607d6272f0b7e352d1a63522efebd2297ca126 (patch)
tree5708d868da89f66117b3d6149ad4ea8caa6fc67c /src/gui
parent44e3eff29dd71c499138c36e5eeec4dd11528ac2 (diff)
downloadqtbase-fa607d6272f0b7e352d1a63522efebd2297ca126.tar.gz
Fix scaled text rendering with the raster paint engine & FreeType
Before commit 070d9c00c488a5ee6811f04170cf488ead79bf80, the raster paint engine used to call loadGlyphs() on the FT engine, which ensures that the glyphs are loaded and (more importantly) that the correct transformation matrix is applied on the freetype face. After commit 070d9c0 lockedAlphaMapForGlyph is called for each glyph, which unfortunately doesn't respect the provided transformation matrix. Therefore when drawing scaled text, it was never actually scaled. This patch applies the combination of the fontengine transform and the requested transform on the freetype face actually used, similarly to loadGlyphs. Change-Id: I0956a9e71784582db6bb90475a001a63800773f4 Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/text/qfontengine_ft.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp
index ecb717ec56..c43ccd0608 100644
--- a/src/gui/text/qfontengine_ft.cpp
+++ b/src/gui/text/qfontengine_ft.cpp
@@ -1823,6 +1823,13 @@ QImage *QFontEngineFT::lockedAlphaMapForGlyph(glyph_t glyphIndex, QFixed subPixe
gset = 0;
}
+ if (gset) {
+ FT_Matrix m = matrix;
+ FT_Matrix_Multiply(&gset->transformationMatrix, &m);
+ FT_Set_Transform(freetype->face, &m, 0);
+ freetype->matrix = m;
+ }
+
if (!gset || gset->outline_drawing || !loadGlyph(gset, glyphIndex, subPixelPosition,
neededFormat)) {
unlockFace();