diff options
author | Jiang Jiang <jiang.jiang@nokia.com> | 2011-07-06 15:08:41 (GMT) |
---|---|---|
committer | Jiang Jiang <jiang.jiang@nokia.com> | 2011-07-07 07:22:13 (GMT) |
commit | ba65e2741c47912a800132b90f7dbaf2551b04c4 (patch) | |
tree | 326ae278e9cb35e12bf424a37807657bc37e08fd /src/gui/text | |
parent | b2799a705b6d7655bb23ec4121fd76ce8a94b344 (diff) | |
download | Qt-ba65e2741c47912a800132b90f7dbaf2551b04c4.zip Qt-ba65e2741c47912a800132b90f7dbaf2551b04c4.tar.gz Qt-ba65e2741c47912a800132b90f7dbaf2551b04c4.tar.bz2 |
Fix raster subpixel positioning in Lion
In Lion, the x position returned by CTFontGetBoundingRectsForGlyphs
can be fractional, we need to round().truncate() it as we did in
QTextureGlyphCache to save the baseLineX.
Reviewed-by: Eskil
Diffstat (limited to 'src/gui/text')
-rw-r--r-- | src/gui/text/qfontengine_coretext.mm | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/text/qfontengine_coretext.mm b/src/gui/text/qfontengine_coretext.mm index 07711a3..afeb0a0 100644 --- a/src/gui/text/qfontengine_coretext.mm +++ b/src/gui/text/qfontengine_coretext.mm @@ -750,7 +750,7 @@ QImage QCoreTextFontEngine::imageForGlyph(glyph_t glyph, QFixed subPixelPosition CGContextSetFont(ctx, cgFont); - qreal pos_x = -br.x.toReal() + subPixelPosition.toReal() + margin; + qreal pos_x = -br.x.round().truncate() + subPixelPosition.toReal() + margin; qreal pos_y = im.height() + br.y.toReal() - margin; CGContextSetTextPosition(ctx, pos_x, pos_y); |