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:
parent
624740cdcd
commit
3272ef4aaf
@ -577,9 +577,10 @@ QImage QCoreTextFontEngine::imageForGlyph(glyph_t glyph, QFixed subPixelPosition
|
||||
cgflags);
|
||||
Q_ASSERT(ctx);
|
||||
CGContextSetFontSize(ctx, fontDef.pixelSize);
|
||||
CGContextSetShouldAntialias(ctx, (aa || fontDef.pointSize > antialiasingThreshold)
|
||||
&& !(fontDef.styleStrategy & QFont::NoAntialias));
|
||||
CGContextSetShouldSmoothFonts(ctx, aa);
|
||||
const bool antialias = (aa || fontDef.pointSize > antialiasingThreshold) && !(fontDef.styleStrategy & QFont::NoAntialias);
|
||||
CGContextSetShouldAntialias(ctx, antialias);
|
||||
const bool smoothing = antialias && !(fontDef.styleStrategy & QFont::NoSubpixelAntialias);
|
||||
CGContextSetShouldSmoothFonts(ctx, smoothing);
|
||||
|
||||
CGAffineTransform cgMatrix = CGAffineTransformIdentity;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user