summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJiang Jiang <jiang.jiang@nokia.com>2011-07-07 11:08:10 (GMT)
committerJiang Jiang <jiang.jiang@nokia.com>2011-07-07 11:15:10 (GMT)
commitbd476c6e4b238290a92cfd4693c709e9010b282b (patch)
tree1dc8ef3a0ca81740c51f017b26c66a1d5594c673 /src
parentba65e2741c47912a800132b90f7dbaf2551b04c4 (diff)
downloadQt-bd476c6e4b238290a92cfd4693c709e9010b282b.zip
Qt-bd476c6e4b238290a92cfd4693c709e9010b282b.tar.gz
Qt-bd476c6e4b238290a92cfd4693c709e9010b282b.tar.bz2
Revert 344a4dcfe and part of 93bce787
Due to subpixel grid change, these changes are no longer needed. Reviewed-by: Eskil
Diffstat (limited to 'src')
-rw-r--r--src/gui/painting/qtextureglyphcache.cpp4
-rw-r--r--src/gui/text/qfontengine_coretext.mm7
2 files changed, 5 insertions, 6 deletions
diff --git a/src/gui/painting/qtextureglyphcache.cpp b/src/gui/painting/qtextureglyphcache.cpp
index fdba9c9..abd0ed1 100644
--- a/src/gui/painting/qtextureglyphcache.cpp
+++ b/src/gui/painting/qtextureglyphcache.cpp
@@ -367,9 +367,7 @@ void QImageTextureGlyphCache::createTextureData(int width, int height)
int QImageTextureGlyphCache::glyphMargin() const
{
-#if (defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA))
- return 1;
-#elif defined(Q_WS_X11)
+#if (defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)) || defined(Q_WS_X11)
return 0;
#else
return m_type == QFontEngineGlyphCache::Raster_RGBMask ? 2 : 0;
diff --git a/src/gui/text/qfontengine_coretext.mm b/src/gui/text/qfontengine_coretext.mm
index afeb0a0..6a9201d 100644
--- a/src/gui/text/qfontengine_coretext.mm
+++ b/src/gui/text/qfontengine_coretext.mm
@@ -718,8 +718,9 @@ void QCoreTextFontEngine::addGlyphsToPath(glyph_t *glyphs, QFixedPoint *position
QImage QCoreTextFontEngine::imageForGlyph(glyph_t glyph, QFixed subPixelPosition, int margin, bool aa)
{
+ Q_UNUSED(margin);
const glyph_metrics_t br = boundingBox(glyph);
- QImage im(qRound(br.width) + margin * 2, qRound(br.height) + margin * 2, QImage::Format_RGB32);
+ QImage im(qRound(br.width) + 2, qRound(br.height) + 2, QImage::Format_RGB32);
im.fill(0);
CGColorSpaceRef colorspace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB);
@@ -750,8 +751,8 @@ QImage QCoreTextFontEngine::imageForGlyph(glyph_t glyph, QFixed subPixelPosition
CGContextSetFont(ctx, cgFont);
- qreal pos_x = -br.x.round().truncate() + subPixelPosition.toReal() + margin;
- qreal pos_y = im.height() + br.y.toReal() - margin;
+ qreal pos_x = -br.x.round().truncate() + subPixelPosition.toReal();
+ qreal pos_y = im.height() + br.y.toReal();
CGContextSetTextPosition(ctx, pos_x, pos_y);
CGSize advance;