summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2020-01-02 08:34:38 +0100
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2020-01-03 08:59:24 +0100
commit947704cefe9e8723c8c9bb332268dcedb1ea1060 (patch)
tree91124f2d1a941520c130222ffd6aff6a23d27274 /src
parent2ced01cbdd10a9959db03406f74529cdcce544ca (diff)
Freetype: Don't embolden bold fonts
If a font does not set the "bold" flag in its OS/2 table, we check the weight from the same table to determine whether it is bold or if we have to embolden it synthetically. But the actual definition of bold in OS/2 is 700 (which is also what QFont::Bold is documented to correspond to in qfont.h). The result was that we would embolden fonts with bold weight if the bold flag was not set. An example of such a font was the CJK JP family of Noto Sans. [ChangeLog][Text] Fixed a problem where certain bold fonts would be synthetically emboldened by Qt when using the Freetype font engine. Fixes: QTBUG-80866 Change-Id: I2133d9c44a9e19c0f5f216a649ec64388245d34f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp b/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp
index 3e5939a5e4..64ceb69c23 100644
--- a/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp
+++ b/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp
@@ -749,7 +749,7 @@ bool QFontEngineFT::init(FaceId faceId, bool antialias, GlyphFormat format,
// fake bold
if ((fontDef.weight >= QFont::Bold) && !(face->style_flags & FT_STYLE_FLAG_BOLD) && !FT_IS_FIXED_WIDTH(face)) {
if (const TT_OS2 *os2 = reinterpret_cast<const TT_OS2 *>(FT_Get_Sfnt_Table(face, ft_sfnt_os2))) {
- if (os2->usWeightClass < 750)
+ if (os2->usWeightClass < 700)
embolden = true;
}
}