From bd476c6e4b238290a92cfd4693c709e9010b282b Mon Sep 17 00:00:00 2001 From: Jiang Jiang Date: Thu, 7 Jul 2011 13:08:10 +0200 Subject: Revert 344a4dcfe and part of 93bce787 Due to subpixel grid change, these changes are no longer needed. Reviewed-by: Eskil --- src/gui/text/qfontengine_coretext.mm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/gui/text/qfontengine_coretext.mm') diff --git a/src/gui/text/qfontengine_coretext.mm b/src/gui/text/qfontengine_coretext.mm index afeb0a0e51..6a9201dd4c 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; -- cgit v1.2.3