Respect NoSubpixelAntialias in QCoreTextFontEngine::imageForGlyph

Adding handling of the new QFont enum NoSubpixelAntialias in
QCoreTextFontEngine::imageForGlyph.

Task-number: QTBUG-40396
Change-Id: I421c38554360f5e2f822a18117190456c4d04b25
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
This commit is contained in:
Allan Sandfeld Jensen 2014-10-21 10:50:28 +02:00 committed by Allan Sandfeld Jensen
parent 624740cdcd
commit 3272ef4aaf

View File

@ -577,9 +577,10 @@ QImage QCoreTextFontEngine::imageForGlyph(glyph_t glyph, QFixed subPixelPosition
cgflags); cgflags);
Q_ASSERT(ctx); Q_ASSERT(ctx);
CGContextSetFontSize(ctx, fontDef.pixelSize); CGContextSetFontSize(ctx, fontDef.pixelSize);
CGContextSetShouldAntialias(ctx, (aa || fontDef.pointSize > antialiasingThreshold) const bool antialias = (aa || fontDef.pointSize > antialiasingThreshold) && !(fontDef.styleStrategy & QFont::NoAntialias);
&& !(fontDef.styleStrategy & QFont::NoAntialias)); CGContextSetShouldAntialias(ctx, antialias);
CGContextSetShouldSmoothFonts(ctx, aa); const bool smoothing = antialias && !(fontDef.styleStrategy & QFont::NoSubpixelAntialias);
CGContextSetShouldSmoothFonts(ctx, smoothing);
CGAffineTransform cgMatrix = CGAffineTransformIdentity; CGAffineTransform cgMatrix = CGAffineTransformIdentity;