diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2022-08-08 09:23:09 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-08-08 17:48:02 +0000 |
commit | fed79f48027de50924f830abafcd86d01d5b46cc (patch) | |
tree | 9aa72f2664dfe9be74a448bd9ad20f462646bc36 | |
parent | 2ebdf562b948647580bdce38b9e06a6e244da6fc (diff) | |
download | qtbase-fed79f48027de50924f830abafcd86d01d5b46cc.tar.gz |
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.
Fixes: QTBUG-105010
Change-Id: I108baed495048783b14afca6bd4c67dc83816c17
Reviewed-by: Jonas Karlsson <jonas.karlsson@qt.io>
(cherry picked from commit 6fa2ce92af914d8fd6ab1fc32316b14bbae0bed0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/gui/text/freetype/qfontengine_ft.cpp | 2 |
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; |