diff options
author | Jørgen Lind <jorgen.lind@nokia.com> | 2010-09-30 11:29:28 (GMT) |
---|---|---|
committer | Jørgen Lind <jorgen.lind@nokia.com> | 2010-09-30 11:29:28 (GMT) |
commit | 534d22fd647f79b9fde08329a6b9e355c6611132 (patch) | |
tree | 30cdb6e32f284a114fd5a9b4f3af40c1283ee59f /src/gui/text | |
parent | e28b1810ba5979dcf2146f9389007b4cfd67a31c (diff) | |
download | Qt-534d22fd647f79b9fde08329a6b9e355c6611132.zip Qt-534d22fd647f79b9fde08329a6b9e355c6611132.tar.gz Qt-534d22fd647f79b9fde08329a6b9e355c6611132.tar.bz2 |
Lighthouse: Make application fonts work
Reviewed-by:paul
Diffstat (limited to 'src/gui/text')
-rw-r--r-- | src/gui/text/qfontdatabase_qpa.cpp | 3 | ||||
-rw-r--r-- | src/gui/text/qplatformfontdatabase_qpa.cpp | 7 | ||||
-rw-r--r-- | src/gui/text/qplatformfontdatabase_qpa.h | 2 |
3 files changed, 9 insertions, 3 deletions
diff --git a/src/gui/text/qfontdatabase_qpa.cpp b/src/gui/text/qfontdatabase_qpa.cpp index 53594aa..19ce1be 100644 --- a/src/gui/text/qfontdatabase_qpa.cpp +++ b/src/gui/text/qfontdatabase_qpa.cpp @@ -199,7 +199,8 @@ static void registerFont(QFontDatabasePrivate::ApplicationFont *fnt) { QFontDatabasePrivate *db = privateDb(); - QApplicationPrivate::platformIntegration()->fontDatabase()->addApplicationFont(fnt->data,fnt->fileName); + fnt->families = QApplicationPrivate::platformIntegration()->fontDatabase()->addApplicationFont(fnt->data,fnt->fileName); + db->reregisterAppFonts = true; } diff --git a/src/gui/text/qplatformfontdatabase_qpa.cpp b/src/gui/text/qplatformfontdatabase_qpa.cpp index 7bb1f9a..26f4faa 100644 --- a/src/gui/text/qplatformfontdatabase_qpa.cpp +++ b/src/gui/text/qplatformfontdatabase_qpa.cpp @@ -165,12 +165,17 @@ QStringList QPlatformFontDatabase::fallbacksForFamily(const QString family, cons return QStringList(); } -void QPlatformFontDatabase::addApplicationFont(const QByteArray &fontData, const QString &fileName) +/*! + Adds an application font. Returns a list of family names, or an empty list if the font could + not be added +*/ +QStringList QPlatformFontDatabase::addApplicationFont(const QByteArray &fontData, const QString &fileName) { Q_UNUSED(fontData); Q_UNUSED(fileName); qWarning("This plugin does not support application fonts"); + return QStringList(); } void QPlatformFontDatabase::releaseHandle(void *handle) diff --git a/src/gui/text/qplatformfontdatabase_qpa.h b/src/gui/text/qplatformfontdatabase_qpa.h index a34033f..adaa4cb 100644 --- a/src/gui/text/qplatformfontdatabase_qpa.h +++ b/src/gui/text/qplatformfontdatabase_qpa.h @@ -46,7 +46,7 @@ public: virtual void populateFontDatabase(); virtual QFontEngine *fontEngine(const QFontDef &fontDef, QUnicodeTables::Script script, void *handle); virtual QStringList fallbacksForFamily(const QString family, const QFont::Style &style, const QUnicodeTables::Script &script) const; - virtual void addApplicationFont(const QByteArray &fontData, const QString &fileName); + virtual QStringList addApplicationFont(const QByteArray &fontData, const QString &fileName); virtual void releaseHandle(void *handle); virtual QString fontDir() const; |