diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2022-03-30 12:32:05 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-03-31 18:03:44 +0000 |
commit | 36427480dd005e39de0c95875f11f101d20d804d (patch) | |
tree | 4427862751cdb7a481c9e7da175dfdf6475ca899 /src/gui/text | |
parent | 204bbf5402fb088941a526c150efd17c74a36219 (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
Change-Id: I8776e5b89588a13749c9c7e414c5bfac86feab58
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit 64dd5a8183eb0d80f31b8ac0c2a59066e769ae79)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/gui/text')
-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 574f57047e..662165ef13 100644 --- a/src/gui/text/coretext/qcoretextfontdatabase.mm +++ b/src/gui/text/coretext/qcoretextfontdatabase.mm @@ -145,6 +145,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; |