diff options
author | Trond Kjernåsen <trond@trolltech.com> | 2009-05-22 09:17:29 (GMT) |
---|---|---|
committer | Trond Kjernåsen <trond@trolltech.com> | 2009-05-22 09:17:29 (GMT) |
commit | 815a8c4a297cde2b8f778c4afa36958e324f8ead (patch) | |
tree | 8572801c4330e94f92dba07b517400a79786c64c /src | |
parent | 308a105bf6ae6eb5702440728428a96b5806b085 (diff) | |
download | Qt-815a8c4a297cde2b8f778c4afa36958e324f8ead.zip Qt-815a8c4a297cde2b8f778c4afa36958e324f8ead.tar.gz Qt-815a8c4a297cde2b8f778c4afa36958e324f8ead.tar.bz2 |
Fixed an issue with text drawing to QImages on Mac/Cocoa.
We currently don't support subpixel hinting when drawing text to a
QImage on Mac. The alpha map that is returned by the font engine
is a plain 8 bit gray mask, which means we have to switch off subpixel
hinting when we draw the glyph for caching.
Task-number: 249178
Reviewed-by: Samuel
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/text/qfontengine_mac.mm | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/text/qfontengine_mac.mm b/src/gui/text/qfontengine_mac.mm index 425cab2..d397e4a 100644 --- a/src/gui/text/qfontengine_mac.mm +++ b/src/gui/text/qfontengine_mac.mm @@ -553,7 +553,9 @@ QImage QCoreTextFontEngine::alphaMapForGlyph(glyph_t glyph) 8, im.bytesPerLine(), colorspace, cgflags); CGContextSetFontSize(ctx, fontDef.pixelSize); - CGContextSetShouldAntialias(ctx, fontDef.pointSize > qt_antialiasing_threshold && !(fontDef.styleStrategy & QFont::NoAntialias)); + CGContextSetShouldAntialias(ctx, fontDef.pointSize > qt_antialiasing_threshold + && !(fontDef.styleStrategy & QFont::NoAntialias)); + CGContextSetShouldSmoothFonts(ctx, false); CGAffineTransform oldTextMatrix = CGContextGetTextMatrix(ctx); CGAffineTransform cgMatrix = CGAffineTransformMake(1, 0, 0, 1, 0, 0); |