summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAndreas Holzammer <andreas.holzammer@kdab.com>2012-08-20 11:25:41 +0200
committerQt by Nokia <qt-info@nokia.com>2012-08-20 12:25:03 +0200
commitf2fabf77f9bc18448aed0e99a6d7d1d6c5c9c736 (patch)
treeaaacf638df625932228c72ace6111a69a46abebb /tests
parent806dda08d685bc5f9ed71dfe8b61f21848d48066 (diff)
Fix freetype font rendering for Windows CE
Windows CE does not have support for GetGlyphOutline. So addGlyphToPath will not work. QML uses it for their distance field rendering. One option to bypass this issue is to use freetype as rendering backend. Change-Id: I965254344945cbdad771a5d505fb61c1cc2087df Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/gui/text/qfontdatabase/qfontdatabase.pro1
-rw-r--r--tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp15
2 files changed, 16 insertions, 0 deletions
diff --git a/tests/auto/gui/text/qfontdatabase/qfontdatabase.pro b/tests/auto/gui/text/qfontdatabase/qfontdatabase.pro
index 0a99e84ed4..3111f515ec 100644
--- a/tests/auto/gui/text/qfontdatabase/qfontdatabase.pro
+++ b/tests/auto/gui/text/qfontdatabase/qfontdatabase.pro
@@ -4,6 +4,7 @@ TARGET = tst_qfontdatabase
SOURCES += tst_qfontdatabase.cpp
DEFINES += SRCDIR=\\\"$$PWD\\\"
QT += testlib
+!mac: QT += core-private gui-private platformsupport-private
wince* {
additionalFiles.files = FreeMono.ttf
diff --git a/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp b/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp
index ef37b53430..a87513e8eb 100644
--- a/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp
+++ b/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp
@@ -44,6 +44,9 @@
#include <qfontdatabase.h>
#include <qfontinfo.h>
#include <qfontmetrics.h>
+#ifndef Q_OS_MAC
+#include <QtPlatformSupport/private/qbasicfontdatabase_p.h>
+#endif
class tst_QFontDatabase : public QObject
{
@@ -73,6 +76,10 @@ private slots:
void addAppFont_data();
void addAppFont();
+
+#ifndef Q_OS_MAC
+ void fontName();
+#endif
};
tst_QFontDatabase::tst_QFontDatabase()
@@ -268,5 +275,13 @@ void tst_QFontDatabase::addAppFont()
QCOMPARE(db.families(), oldFamilies);
}
+#ifndef Q_OS_MAC
+void tst_QFontDatabase::fontName()
+{
+ QString fontName = QBasicFontDatabase::fontNameFromTTFile(QStringLiteral("FreeMono.ttf"));
+ QCOMPARE(fontName, QStringLiteral("FreeMono"));
+}
+#endif
+
QTEST_MAIN(tst_QFontDatabase)
#include "tst_qfontdatabase.moc"