diff options
author | Andy Shaw <andy.shaw@qt.io> | 2021-09-09 11:34:46 +0200 |
---|---|---|
committer | Andy Shaw <andy.shaw@qt.io> | 2022-01-17 13:46:33 +0100 |
commit | 7d9329d8c4f1b04917224ebdb7b8317a397c984a (patch) | |
tree | 6457cd573dc90bf94743b78db838340240e97699 /src/platformsupport | |
parent | 90ad5aed4c3376a06ef1fa584415e5bffac9bf04 (diff) |
FreeType: allow falling back to synthesized bold if desired
Some users still prefer the fake bold look even if in some cases it does
not look good. So add an environment variable -
QT_NO_SYNTHESIZED_BOLD_LIMIT - to allow that fallback to stay in place.
Change-Id: I8212c1fa36edb4730b187dc4a23ea45f94981154
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit fa53c624729ad5554b3698b700543fcf9c58166f)
Reviewed-by: Tuomas Vaarala <tuomas.vaarala@qt.io>
Diffstat (limited to 'src/platformsupport')
-rw-r--r-- | src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp b/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp index 36527d0e42..fb35510bb5 100644 --- a/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp +++ b/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp @@ -750,8 +750,10 @@ 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) && !qEnvironmentVariableIsSet("QT_NO_SYNTHESIZED_BOLD")) { if (const TT_OS2 *os2 = reinterpret_cast<const TT_OS2 *>(FT_Get_Sfnt_Table(face, ft_sfnt_os2))) { - if (os2->usWeightClass < 700 && fontDef.pixelSize < 64) + if (os2->usWeightClass < 700 && + (fontDef.pixelSize < 64 || qEnvironmentVariableIsSet("QT_NO_SYNTHESIZED_BOLD_LIMIT"))) { embolden = true; + } } } // underline metrics |