summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2022-08-08 09:23:09 +0200
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2022-08-08 16:30:35 +0200
commit6fa2ce92af914d8fd6ab1fc32316b14bbae0bed0 (patch)
tree5643fc0f7dd19684eea60f092e35105146d6a8d8 /src
parent5a76837a7f4134454de65547043b78d51e3d7bef (diff)
Freetype: Fix underline thickness for bitmap fonts
For non-scalable fonts, we calculate the underline thickness based on the font size. To make the lines slightly thicker for bold fonts, we also multiply a fraction of the weight of the font into it. In Qt 6, however, the weight scale was multiplied by 10, but the formula was not updated, hence all underlines for bitmap fonts would be 10x too thick. Pick-to: 6.2 6.3 6.4 Fixes: QTBUG-105010 Change-Id: I108baed495048783b14afca6bd4c67dc83816c17 Reviewed-by: Jonas Karlsson <jonas.karlsson@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/gui/text/freetype/qfontengine_ft.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/text/freetype/qfontengine_ft.cpp b/src/gui/text/freetype/qfontengine_ft.cpp
index a7892f95b6..07f5049ff6 100644
--- a/src/gui/text/freetype/qfontengine_ft.cpp
+++ b/src/gui/text/freetype/qfontengine_ft.cpp
@@ -799,7 +799,7 @@ bool QFontEngineFT::init(FaceId faceId, bool antialias, GlyphFormat format,
} else {
// ad hoc algorithm
int score = fontDef.weight * fontDef.pixelSize;
- line_thickness = score / 700;
+ line_thickness = score / 7000;
// looks better with thicker line for small pointsizes
if (line_thickness < 2 && score >= 1050)
line_thickness = 2;