summaryrefslogtreecommitdiffstats
path: root/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2022-03-30 12:32:05 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2022-04-07 15:20:50 +0200
commitdb8a3a63e60d7c8287d6f7c085d529f4c2887b47 (patch)
tree452274c6a2feabbaf2f6efb9ae070c58acf3aaf8 /src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
parentc097386a94ca0452da28deb8d74dc2529adcdaea (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: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm')
-rw-r--r--src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
index ea7e3542ba..1a82dd7045 100644
--- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
+++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
@@ -143,6 +143,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;