Don't use the fallback list to decide if the CoreText font db was populated
In some situation (such as iOS currently) we may end up with an empty fallback list, and we don't want to re-populate the font database on every call to fallbacksForFamily(). We do not guard populateFontDatabase(), since it's called both initially and every time the font database has been invalidated. Change-Id: Ief1342c40f75e5d393e054e9a20bc94bc357d482 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>bb10
parent
23b11e792c
commit
183e04a439
|
|
@ -381,8 +381,12 @@ QStringList QCoreTextFontDatabase::fallbacksForFamily(const QString &family, QFo
|
|||
Q_UNUSED(family);
|
||||
Q_UNUSED(style);
|
||||
Q_UNUSED(script);
|
||||
if (fallbackLists.isEmpty())
|
||||
|
||||
static bool didPopulateFallbackList = false;
|
||||
if (!didPopulateFallbackList) {
|
||||
const_cast<QCoreTextFontDatabase*>(this)->populateFontDatabase();
|
||||
didPopulateFallbackList = true;
|
||||
}
|
||||
return fallbackLists[styleHint];
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue