diff options
author | Liang Qi <liang.qi@qt.io> | 2019-09-30 12:57:57 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2019-09-30 14:43:02 +0200 |
commit | 99cdd5fc67386fb3361299b9ec493e081043097d (patch) | |
tree | 2c1d41d3d71f671f104e93b87bf11bdd169ba746 /src/platformsupport/fontdatabases/mac | |
parent | 86876744f07cbaa01daca6869b896741878c39a3 (diff) | |
parent | 46201f0e82a7b1629adad196dfa8f7ff1cf4dffd (diff) |
Merge remote-tracking branch 'origin/5.13' into 5.14
Conflicts:
src/corelib/global/qrandom.cpp
src/corelib/io/qfileinfo.cpp
src/corelib/kernel/qeventdispatcher_win.cpp
src/corelib/kernel/qeventdispatcher_win_p.h
src/gui/text/qfontdatabase.cpp
src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
src/plugins/platforms/windows/qwindowsglcontext.cpp
src/testlib/qtestcase.cpp
Done-With: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Done-With: Edward Welbourne <edward.welbourne@qt.io>
Change-Id: I4893212471aa24be804c989a581810e2f714545c
Diffstat (limited to 'src/platformsupport/fontdatabases/mac')
-rw-r--r-- | src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm index a52e157768..ac4a8f35f8 100644 --- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm +++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm @@ -467,6 +467,14 @@ QStringList QCoreTextFontDatabase::fallbacksForFamily(const QString &family, QFo if (fallbackList.isEmpty()) return fallbackList; + // .Apple Symbols Fallback will be at the beginning of the list and we will + // detect that this has glyphs for Arabic and other writing systems. + // Since it is a symbol font, it should be the last resort, so that + // the proper fonts for these writing systems are preferred. + int symbolIndex = fallbackList.indexOf(QLatin1String(".Apple Symbols Fallback")); + if (symbolIndex >= 0) + fallbackList.move(symbolIndex, fallbackList.size() - 1); + #if defined(Q_OS_MACOS) // Since we are only returning a list of default fonts for the current language, we do not // cover all Unicode completely. This was especially an issue for some of the common script @@ -481,6 +489,15 @@ QStringList QCoreTextFontDatabase::fallbacksForFamily(const QString &family, QFo fallbackList.append(QStringLiteral("Apple Symbols")); #endif + // Since iOS 13, the cascade list may contain meta-fonts which have not been + // populated to the database, such as ".AppleJapaneseFont". It is important that we + // include this in the fallback list, in order to get fallback support for all + // languages + for (const QString &fallback : fallbackList) { + if (!QPlatformFontDatabase::isFamilyPopulated(fallback)) + const_cast<QCoreTextFontDatabase *>(this)->populateFamily(fallback); + } + extern QStringList qt_sort_families_by_writing_system(QChar::Script, const QStringList &); fallbackList = qt_sort_families_by_writing_system(script, fallbackList); |