Android: Also populate database with otf fonts

On Android 5, the Chinese fallback fonts are .otf format,
and these were ignored when we populated the font database.

Note that this also requires an upgrade of FreeType, otherwise
the Simplified Chinese font will not load.

[ChangeLog][Android] Fixed rendering Chinese text on Android 5.

Change-Id: I972d0fbc0b16458650a7b82ea82a0ddd5bdfa641
Task-number: QTBUG-44648
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
bb10
Eskil Abrahamsen Blomfeldt 2015-03-13 10:05:21 +01:00
parent aa645caec1
commit d0d107ffc8
1 changed files with 4 additions and 4 deletions

View File

@ -51,10 +51,10 @@ void QAndroidPlatformFontDatabase::populateFontDatabase()
qPrintable(fontpath));
}
QDir dir(fontpath, QLatin1String("*.ttf"));
for (int i = 0; i < int(dir.count()); ++i) {
const QByteArray file = QFile::encodeName(dir.absoluteFilePath(dir[i]));
QDir dir(fontpath);
QList<QFileInfo> entries = dir.entryInfoList(QStringList() << QStringLiteral("*.ttf") << QStringLiteral("*.otf"), QDir::Files);
for (int i = 0; i < int(entries.count()); ++i) {
const QByteArray file = QFile::encodeName(entries.at(i).absoluteFilePath());
QSupportedWritingSystems supportedWritingSystems;
QStringList families = addTTFile(QByteArray(), file, &supportedWritingSystems);