diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2022-03-30 12:32:05 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2022-03-31 17:42:47 +0200 |
commit | 64dd5a8183eb0d80f31b8ac0c2a59066e769ae79 (patch) | |
tree | 87dca554a6b1c1c6f7c2a8eb03edd20be28c7401 | |
parent | b01ee1d44c17038f72e746248af3a9d6492723d9 (diff) |
CoreText: Avoid populating font family aliases if family was populated
When trying to match a font request to fonts in the database we might
end up with a mismatch due to the style not being available, but the
font family itself was.
If that's the case there's no point in trying to populate font aliases.
Fixes: QTBUG-98369
Fixes: QTBUG-99216
Pick-to: 6.3 6.2 5.15
Change-Id: I8776e5b89588a13749c9c7e414c5bfac86feab58
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
-rw-r--r-- | src/gui/text/coretext/qcoretextfontdatabase.mm | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gui/text/coretext/qcoretextfontdatabase.mm b/src/gui/text/coretext/qcoretextfontdatabase.mm index 88316850e1..8665faca83 100644 --- a/src/gui/text/coretext/qcoretextfontdatabase.mm +++ b/src/gui/text/coretext/qcoretextfontdatabase.mm @@ -151,6 +151,12 @@ void QCoreTextFontDatabase::populateFontDatabase() bool QCoreTextFontDatabase::populateFamilyAliases(const QString &missingFamily) { #if defined(Q_OS_MACOS) + if (isFamilyPopulated(missingFamily)) { + // We got here because one of the other properties of the font mismatched, + // for example the style, so there's no point in populating font aliases. + return false; + } + if (m_hasPopulatedAliases) return false; |