diff options
author | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2022-05-16 18:16:04 +0300 |
---|---|---|
committer | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2022-05-16 18:16:04 +0300 |
commit | 231d3670981a33ec42b91ad1cb33c1fc50551066 (patch) | |
tree | b1ef1096f4e279baaa2ea0d2daf14b5c4185a82f /src/gui/text/qfontdatabase.cpp | |
parent | ffdd372c7bbda62e9d937f406319f38e3e982774 (diff) | |
parent | 8fc1a885d19a2dfb1a3a684aea1cfa41967e041f (diff) |
Merge remote-tracking branch 'origin/tqtc/lts-5.15.5' into tqtc/lts-5.15-opensourcev5.15.5-lts-lgpl
Change-Id: I0cdb390124e783dc9cd832a9954baa76a0e9eb6b
Diffstat (limited to 'src/gui/text/qfontdatabase.cpp')
-rw-r--r-- | src/gui/text/qfontdatabase.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp index 72dcac6904..bdbfcd7af4 100644 --- a/src/gui/text/qfontdatabase.cpp +++ b/src/gui/text/qfontdatabase.cpp @@ -1731,13 +1731,19 @@ bool QFontDatabase::isSmoothlyScalable(const QString &family, const QString &sty for (int j = 0; j < f->count; j++) { QtFontFoundry *foundry = f->foundries[j]; if (foundryName.isEmpty() || foundry->name.compare(foundryName, Qt::CaseInsensitive) == 0) { - for (int k = 0; k < foundry->count; k++) - if ((style.isEmpty() || - foundry->styles[k]->styleName == style || - foundry->styles[k]->key == styleKey) && foundry->styles[k]->smoothScalable) { - smoothScalable = true; + for (int k = 0; k < foundry->count; k++) { + QtFontStyle *fontStyle = foundry->styles[k]; + smoothScalable = + fontStyle->smoothScalable + && ((style.isEmpty() + || fontStyle->styleName == style + || fontStyle->key == styleKey) + || (fontStyle->styleName.isEmpty() + && style == styleStringHelper(fontStyle->key.weight, + QFont::Style(fontStyle->key.style)))); + if (smoothScalable) goto end; - } + } } } end: |