From d5abda313dab0f83873d34b7c4ddbe8d8a06dacf Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Wed, 25 Sep 2019 15:11:29 +0200 Subject: iOS: Fix fallback fonts on iOS 13+ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since iOS 13, the cascade list for the default UI font contains meta-families for several writing systems, such as CJK. Since these font families were never populated to the database, we ignored them in Qt, and thus got missing glyphs for the characters in question. The fix is to make sure these fonts are populated in the database. It contains a partial backport of 922d195020d54d7e599d135f6a5e0338100e08f1, which adds the qt_isFamilyPopulated() accessor to allow us to check if the family has been populated in the font database. In Qt 5.14, there is public API for this in QPlatformFontDatabase, so this is a temporary resolution until then. Fixes: QTBUG-77467 Change-Id: Ia9ebb8a19ad2367eb764ae1496a52966b465336b Reviewed-by: Tor Arne Vestbø --- src/gui/text/qfontdatabase.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/gui/text') diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp index bc7d379157..fe7dd80e44 100644 --- a/src/gui/text/qfontdatabase.cpp +++ b/src/gui/text/qfontdatabase.cpp @@ -793,6 +793,13 @@ QString qt_resolveFontFamilyAlias(const QString &alias) return alias; } +Q_GUI_EXPORT bool qt_isFontFamilyPopulated(const QString &familyName) +{ + QFontDatabasePrivate *d = privateDb(); + QtFontFamily *f = d->family(familyName, QFontDatabasePrivate::RequestFamily); + return f != nullptr && f->populated; +} + /*! Returns a list of alternative fonts for the specified \a family and \a style and \a script using the \a styleHint given. -- cgit v1.2.3