summaryrefslogtreecommitdiffstats
path: root/src/gui/text/coretext
diff options
context:
space:
mode:
authorKyu Man Lim <kyuman.lim@lge.com>2017-02-10 10:21:33 +0900
committerDominik Holland <dominik.holland@qt.io>2020-06-18 12:07:36 +0200
commitf1beb28c461ba162d27e87bc7a23183989a5b9fd (patch)
tree9e0659a97bb4eb99808b687fda196fb4c9f1fae0 /src/gui/text/coretext
parent7b5d5faae19d1872faafaf05c9acf21b33d327fe (diff)
Add a way to disable syntethesized bold and italic support
Using the environment variables QT_NO_SYNTHESIZED_BOLD and QT_NO_SYNTHESIZED_ITALIC it is now possible to disable the support for synthesized bold and italic, which is used when the font doesn't support those variants. Change-Id: Ic1a6984858e1260f252662689705553073859df4 Task-number: QTBUG-83124 Pick-to: 5.15 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'src/gui/text/coretext')
-rw-r--r--src/gui/text/coretext/qfontengine_coretext.mm4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/text/coretext/qfontengine_coretext.mm b/src/gui/text/coretext/qfontengine_coretext.mm
index 7f9eb2d78d..398e8df32c 100644
--- a/src/gui/text/coretext/qfontengine_coretext.mm
+++ b/src/gui/text/coretext/qfontengine_coretext.mm
@@ -258,10 +258,10 @@ void QCoreTextFontEngine::init()
if (slant > 500 && !(traits & kCTFontItalicTrait))
fontDef.style = QFont::StyleOblique;
- if (fontDef.weight >= QFont::Bold && !(traits & kCTFontBoldTrait))
+ if (fontDef.weight >= QFont::Bold && !(traits & kCTFontBoldTrait) && !qEnvironmentVariableIsSet("QT_NO_SYNTHESIZED_BOLD"))
synthesisFlags |= SynthesizedBold;
// XXX: we probably don't need to synthesis italic for oblique font
- if (fontDef.style != QFont::StyleNormal && !(traits & kCTFontItalicTrait))
+ if (fontDef.style != QFont::StyleNormal && !(traits & kCTFontItalicTrait) && !qEnvironmentVariableIsSet("QT_NO_SYNTHESIZED_ITALIC"))
synthesisFlags |= SynthesizedItalic;
avgCharWidth = 0;