summaryrefslogtreecommitdiffstats
path: root/src/gui/text
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/text')
-rw-r--r--src/gui/text/qfontdatabase.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp
index aae84dc988..f20f574bc6 100644
--- a/src/gui/text/qfontdatabase.cpp
+++ b/src/gui/text/qfontdatabase.cpp
@@ -945,9 +945,10 @@ QFontEngine *loadSingleEngine(int script,
// If the font data's native stretch matches the requested stretch we need to set stretch to 100
// to avoid the fontengine synthesizing stretch. If they didn't match exactly we need to calculate
// the new stretch factor. This only done if not matched by styleName.
- bool styleNameMatch = !request.styleName.isEmpty() && request.styleName == style->styleName;
- if (!styleNameMatch && style->key.stretch != 0 && request.stretch != 0)
+ if (style->key.stretch != 0 && request.stretch != 0
+ && (request.styleName.isEmpty() || request.styleName != style->styleName)) {
def.stretch = (request.stretch * 100 + 50) / style->key.stretch;
+ }
engine = pfdb->fontEngine(def, size->handle);
if (engine) {