summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/winrt/qwinrtfontdatabase.h
diff options
context:
space:
mode:
authorAndrew Knight <andrew.knight@digia.com>2014-03-15 16:49:22 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-18 21:37:55 +0100
commit9827f6d19817d2653ea4fbf5df30d7bb2fb6f787 (patch)
tree000b1e993b5e352a4b0bc726a3e05eda4b1cd1a6 /src/plugins/platforms/winrt/qwinrtfontdatabase.h
parent336cb75d8f1de45215ed6e871cc5121a3e12c111 (diff)
WinRT: Load system fonts using DirectWrite
System-installed TrueType fonts can be read into memory and loaded into the FreeType font engine. This allows the application to be packaged without fonts, but does not work on Windows Phone where DirectWrite is not supported. Every single-file TrueType font is registered with the font database, and then loaded into memory at the point that the font is actually used. Task-number: QTBUG-37230 Change-Id: I804116e37a874cd146a0653ba4cc018f8b1cd6a4 Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Diffstat (limited to 'src/plugins/platforms/winrt/qwinrtfontdatabase.h')
-rw-r--r--src/plugins/platforms/winrt/qwinrtfontdatabase.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/plugins/platforms/winrt/qwinrtfontdatabase.h b/src/plugins/platforms/winrt/qwinrtfontdatabase.h
index 49e32470c2..6f194a10cc 100644
--- a/src/plugins/platforms/winrt/qwinrtfontdatabase.h
+++ b/src/plugins/platforms/winrt/qwinrtfontdatabase.h
@@ -46,10 +46,29 @@
QT_BEGIN_NAMESPACE
+#ifndef Q_OS_WINPHONE
+struct IDWriteFontFile;
+
+struct FontDescription
+{
+ quint32 index;
+ QByteArray uuid;
+};
+#endif
+
class QWinRTFontDatabase : public QBasicFontDatabase
{
public:
QString fontDir() const;
+#ifndef Q_OS_WINPHONE
+ ~QWinRTFontDatabase();
+ QFont defaultFont() const Q_DECL_OVERRIDE;
+ void populateFontDatabase() Q_DECL_OVERRIDE;
+ QFontEngine *fontEngine(const QFontDef &fontDef, void *handle) Q_DECL_OVERRIDE;
+ void releaseHandle(void *handle) Q_DECL_OVERRIDE;
+private:
+ QHash<IDWriteFontFile *, FontDescription> m_fonts;
+#endif // !Q_OS_WINPHONE
};
QT_END_NAMESPACE