diff options
author | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2012-03-23 14:17:23 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-27 17:06:59 +0200 |
commit | 4f1820e3a77b3fdda32a1b935502b187e73059cf (patch) | |
tree | b4547ee03c9ba6257ad51134f689ad466eebae30 /src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp | |
parent | d41e0564f5f6a002ca2cdb0d745de8e75247ea99 (diff) |
Implement application font loading for Windows
For FreeType Windows font database, use the application font loading
implementation of the parent class.
For native Windows font database, the implementation was adapted from
Qt 4.8.
Also fixed a bug in font database population, where old data was not
destroyed before population, resulting in fonts not getting properly
repopulated when a new font was added.
Task-number: QTBUG-24193
Task-number: QTBUG-24195
Task-number: QTBUG-24196
Change-Id: Ie224a87baf7500b9867aaafa807f62dd4503dee8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp')
-rw-r--r-- | src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp b/src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp index f90a880cd3..500a1eeccb 100644 --- a/src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp +++ b/src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp @@ -273,14 +273,13 @@ static int CALLBACK storeFont(ENUMLOGFONTEX* f, NEWTEXTMETRICEX *textmetric, void QWindowsFontDatabaseFT::populateFontDatabase() { - if (m_families.isEmpty()) { - QPlatformFontDatabase::populateFontDatabase(); - populate(); // Called multiple times. - // Work around EnumFontFamiliesEx() not listing the system font, see below. - const QString sysFontFamily = QGuiApplication::font().family(); - if (!m_families.contains(sysFontFamily)) - populate(sysFontFamily); - } + m_families.clear(); + QPlatformFontDatabase::populateFontDatabase(); + populate(); // Called multiple times. + // Work around EnumFontFamiliesEx() not listing the system font, see below. + const QString sysFontFamily = QGuiApplication::font().family(); + if (!m_families.contains(sysFontFamily)) + populate(sysFontFamily); } /*! @@ -426,14 +425,6 @@ QStringList QWindowsFontDatabaseFT::fallbacksForFamily(const QString family, con << script << result << m_families; return result; } - -QStringList QWindowsFontDatabaseFT::addApplicationFont(const QByteArray &fontData, const QString &fileName) -{ - const QStringList result = QPlatformFontDatabase::addApplicationFont(fontData, fileName); - Q_UNIMPLEMENTED(); - return result; -} - QString QWindowsFontDatabaseFT::fontDir() const { const QString result = QLatin1String(qgetenv("windir")) + QLatin1String("/Fonts");//QPlatformFontDatabase::fontDir(); |