From 28b2232e7818f560bcd6c57f09ef42f2363e5338 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Thu, 20 Dec 2018 12:17:30 +0100 Subject: [PATCH] Don't dither antialiasing on glyphs when converting to mono When glyphs are converted to monochrome from an alpha map, it does not make sense to apply high quality dithering, because the result will be that some the subpixels along the edges that cover only part of a pixel are filled. This causes the glyphs to look jagged and ugly. Instead, we use ThresholdDither to fill all pixels that are >= 50% opacity. [ChangeLog][QtGui][Text] Improved appearance of monochrome text on some platforms. Fixes: QTBUG-69702 Change-Id: I0f44a8d73f6b9f1eb59f297d66438575f1e9db10 Reviewed-by: Allan Sandfeld Jensen --- src/gui/painting/qtextureglyphcache.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/painting/qtextureglyphcache.cpp b/src/gui/painting/qtextureglyphcache.cpp index 2a7e0eaa0c..99b04aaba6 100644 --- a/src/gui/painting/qtextureglyphcache.cpp +++ b/src/gui/painting/qtextureglyphcache.cpp @@ -335,7 +335,7 @@ void QImageTextureGlyphCache::fillTexture(const Coord &c, glyph_t g, QFixed subP // TODO optimize this mask = mask.alphaChannel(); mask.invertPixels(); - mask = mask.convertToFormat(QImage::Format_Mono); + mask = mask.convertToFormat(QImage::Format_Mono, Qt::ThresholdDither); } int mw = qMin(mask.width(), c.w);