WinRT: fix default font when DirectWrite is disabled

Instead of loading the default font "Helvetica", which is likely not
part of the package, load the first font found.

Change-Id: I225979986883a26c3fec72858cf32c3d1e45d902
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
This commit is contained in:
Andrew Knight 2014-05-22 17:08:45 +03:00 committed by The Qt Project
parent c6b8779172
commit 05e8b54d23
2 changed files with 9 additions and 2 deletions

View File

@ -398,6 +398,13 @@ void QWinRTFontDatabase::releaseHandle(void *handle)
QBasicFontDatabase::releaseHandle(handle);
}
#endif // QT_WINRT_USE_DWRITE
#else // QT_WINRT_USE_DWRITE
QFont QWinRTFontDatabase::defaultFont() const
{
return QFont(QFontDatabase().families().value(0));
}
#endif // !QT_WINRT_USE_DWRITE
QT_END_NAMESPACE

View File

@ -61,9 +61,9 @@ class QWinRTFontDatabase : public QBasicFontDatabase
{
public:
QString fontDir() const;
QFont defaultFont() const Q_DECL_OVERRIDE;
#ifdef QT_WINRT_USE_DWRITE
~QWinRTFontDatabase();
QFont defaultFont() const Q_DECL_OVERRIDE;
void populateFontDatabase() Q_DECL_OVERRIDE;
void populateFamily(const QString &familyName) Q_DECL_OVERRIDE;
QFontEngine *fontEngine(const QFontDef &fontDef, void *handle) Q_DECL_OVERRIDE;