summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qfontengine_coretext.mm
diff options
context:
space:
mode:
authorJiang Jiang <jiang.jiang@nokia.com>2011-05-24 11:50:16 +0200
committerJiang Jiang <jiang.jiang@nokia.com>2011-05-30 12:35:29 +0200
commit93bce7874721de905af0181da95c58fe13a2e015 (patch)
tree9244310abc3dd26c0555e5127a1f164accbbfbe2 /src/gui/text/qfontengine_coretext.mm
parent35421a9313a324ff63df6ba27e03b8090c964717 (diff)
Keep line consistency with text baseline
Also revert previous underline patch. Reviewed-by: Eskil
Diffstat (limited to 'src/gui/text/qfontengine_coretext.mm')
-rw-r--r--src/gui/text/qfontengine_coretext.mm8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gui/text/qfontengine_coretext.mm b/src/gui/text/qfontengine_coretext.mm
index d14db3abb8..982c271730 100644
--- a/src/gui/text/qfontengine_coretext.mm
+++ b/src/gui/text/qfontengine_coretext.mm
@@ -730,10 +730,10 @@ void QCoreTextFontEngine::addGlyphsToPath(glyph_t *glyphs, QFixedPoint *position
}
}
-QImage QCoreTextFontEngine::imageForGlyph(glyph_t glyph, QFixed subPixelPosition, int /*margin*/, bool aa)
+QImage QCoreTextFontEngine::imageForGlyph(glyph_t glyph, QFixed subPixelPosition, int margin, bool aa)
{
const glyph_metrics_t br = boundingBox(glyph);
- QImage im(qRound(br.width)+2, qRound(br.height)+2, QImage::Format_RGB32);
+ QImage im(qRound(br.width) + margin * 2, qRound(br.height) + margin * 2, QImage::Format_RGB32);
im.fill(0);
CGColorSpaceRef colorspace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB);
@@ -765,8 +765,8 @@ QImage QCoreTextFontEngine::imageForGlyph(glyph_t glyph, QFixed subPixelPosition
CGContextSetFont(ctx, cgFont);
- qreal pos_x = -br.x.toReal() + subPixelPosition.toReal();
- qreal pos_y = im.height() + br.y.toReal() - 1;
+ qreal pos_x = -br.x.toReal() + subPixelPosition.toReal() + margin;
+ qreal pos_y = im.height() + br.y.toReal() - margin;
CGContextSetTextPosition(ctx, pos_x, pos_y);
CGSize advance;