summaryrefslogtreecommitdiffstats
path: root/src/gui/text
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2021-08-23 12:22:14 +0200
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2021-08-23 16:35:36 +0200
commit1971250de5729386d2ac4ebb1b99c4b84d195a6a (patch)
treea82f018e3e4f860cfe5e0e1c6f064849776f90f6 /src/gui/text
parentec497d5e6587ac247a326fb9a0a11c37bb197786 (diff)
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 <thomas.hartmann@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/gui/text')
-rw-r--r--src/gui/text/qfontengine.cpp2
1 files changed, 1 insertions, 1 deletions
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