From fa53c624729ad5554b3698b700543fcf9c58166f Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Thu, 9 Sep 2021 11:34:46 +0200 Subject: 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 --- src/gui/text/freetype/qfontengine_ft.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/gui') 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(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 -- cgit v1.2.3