diff options
author | Andy Shaw <andy.shaw@qt.io> | 2021-09-09 11:34:46 +0200 |
---|---|---|
committer | Andy Shaw <andy.shaw@qt.io> | 2021-11-03 16:23:47 +0200 |
commit | fa53c624729ad5554b3698b700543fcf9c58166f (patch) | |
tree | ae4c5d0fe7dd6806f918e57e95366056cdb3565f /src/gui | |
parent | 5175cd89efd1c34ef78445837d61c337f21996c3 (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.
Pick-to: 6.2 5.15
Change-Id: I8212c1fa36edb4730b187dc4a23ea45f94981154
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/text/freetype/qfontengine_ft.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/text/freetype/qfontengine_ft.cpp b/src/gui/text/freetype/qfontengine_ft.cpp index 863e81b8a2..848267a245 100644 --- a/src/gui/text/freetype/qfontengine_ft.cpp +++ b/src/gui/text/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 |