From 1971250de5729386d2ac4ebb1b99c4b84d195a6a Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Mon, 23 Aug 2021 12:22:14 +0200 Subject: Fix default line thickness for fonts When we are unable to get the line thickness from a font, we fall back to calculating this based on pixel size and weight. But the font weight scale has changed in Qt 6, causing the calculated font weight to be 10x as thick as it should. This happened e.g. for Titillium Web, but only when using 100% UI scaling, because the GDI engine was unable to get the correct line thickness from the font, whereas the DirectWrite engine succeeded. [ChangeLog][Windows] Fixes an issue where underlines and other decorations would be too thick for some fonts. Pick-to: 6.1 6.2 Fixes: QTBUG-94529 Change-Id: Id2c88f0a145776151be0399ee646f28b3bdf9072 Reviewed-by: Thomas Hartmann Reviewed-by: Lars Knoll --- src/gui/text/qfontengine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp index 2dbed7383f..72f90ae53b 100644 --- a/src/gui/text/qfontengine.cpp +++ b/src/gui/text/qfontengine.cpp @@ -180,7 +180,7 @@ QFontEngine::~QFontEngine() QFixed QFontEngine::lineThickness() const { // ad hoc algorithm - int score = fontDef.weight * fontDef.pixelSize; + int score = fontDef.weight * fontDef.pixelSize / 10; int lw = score / 700; // looks better with thicker line for small pointsizes -- cgit v1.2.3