diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com> | 2015-03-13 10:05:21 +0100 |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com> | 2015-03-13 12:12:10 +0000 |
commit | d0d107ffc88c5a4be34355e8bd32fe3d9826445a (patch) | |
tree | e866383b2af9b2c0934cc0c9cfd3bbae2fd26268 /src/plugins/platforms | |
parent | aa645caec178767e57da25f2a4566e1212c12b35 (diff) |
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>
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r-- | src/plugins/platforms/android/qandroidplatformfontdatabase.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/platforms/android/qandroidplatformfontdatabase.cpp b/src/plugins/platforms/android/qandroidplatformfontdatabase.cpp index 2dcc0399c0..47bf4754f1 100644 --- a/src/plugins/platforms/android/qandroidplatformfontdatabase.cpp +++ b/src/plugins/platforms/android/qandroidplatformfontdatabase.cpp @@ -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); |