summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJiang Jiang <jiang.jiang@nokia.com>2011-06-28 13:53:28 (GMT)
committerJiang Jiang <jiang.jiang@nokia.com>2011-06-28 14:13:05 (GMT)
commit9088661c63f61fbfa02e2e11aefe32cfa0f52171 (patch)
treedaa4cc0b3ae8607c41e3747fc6761f4a68e6eee2 /src
parentb88e225da2cd471e7a3985793f114ee5d142d64e (diff)
downloadQt-9088661c63f61fbfa02e2e11aefe32cfa0f52171.zip
Qt-9088661c63f61fbfa02e2e11aefe32cfa0f52171.tar.gz
Qt-9088661c63f61fbfa02e2e11aefe32cfa0f52171.tar.bz2
Fix vertical positioning of glyphs in raster engine with FreeType
Reviewed-by: aavit
Diffstat (limited to 'src')
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index 30553b5..9ba4592 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -2774,10 +2774,12 @@ bool QRasterPaintEngine::drawCachedGlyphs(int numGlyphs, const glyph_t *glyphs,
{
Q_D(QRasterPaintEngine);
QRasterPaintEngineState *s = state();
+ const QFixed offs = QFixed::fromReal(aliasedCoordinateDelta);
#if !defined(QT_NO_FREETYPE)
if (fontEngine->type() == QFontEngine::Freetype) {
QFontEngineFT *fe = static_cast<QFontEngineFT *>(fontEngine);
+ const QFixed xOffs = fe->supportsSubPixelPositions() ? 0 : offs;
QFontEngineFT::GlyphFormat neededFormat =
painter()->device()->devType() == QInternal::Widget
? fe->defaultGlyphFormat()
@@ -2851,8 +2853,8 @@ bool QRasterPaintEngine::drawCachedGlyphs(int numGlyphs, const glyph_t *glyphs,
};
alphaPenBlt(glyph->data, pitch, depth,
- qFloor(positions[i].x) + glyph->x,
- qFloor(positions[i].y) - glyph->y,
+ qFloor(positions[i].x + xOffs) + glyph->x,
+ qFloor(positions[i].y + offs) - glyph->y,
glyph->width, glyph->height);
}
if (lockedFace)
@@ -2892,7 +2894,6 @@ bool QRasterPaintEngine::drawCachedGlyphs(int numGlyphs, const glyph_t *glyphs,
rightShift = 3; // divide by 8
int margin = cache->glyphMargin();
- const QFixed offs = QFixed::fromReal(aliasedCoordinateDelta);
const uchar *bits = image.bits();
for (int i=0; i<numGlyphs; ++i) {