summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp b/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp
index c53792da99..8c26f8a91f 100644
--- a/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp
+++ b/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp
@@ -67,6 +67,9 @@ private slots:
void condensedFontWidth();
void condensedFontMatching();
+ void rasterFonts();
+ void smoothFonts();
+
private:
QString m_ledFont;
QString m_testFont;
@@ -334,5 +337,30 @@ void tst_QFontDatabase::condensedFontMatching()
QFontMetrics(tfcBySubfamilyName).width(testString()));
}
+void tst_QFontDatabase::rasterFonts()
+{
+ QFont font(QLatin1String("Fixedsys"), 1000);
+ QFontInfo fontInfo(font);
+
+ if (fontInfo.family() != font.family())
+ QSKIP("Fixedsys font not available.");
+
+ QVERIFY(!QFontDatabase().isSmoothlyScalable(font.family()));
+ QVERIFY(fontInfo.pointSize() != font.pointSize());
+}
+
+void tst_QFontDatabase::smoothFonts()
+{
+ QFont font(QLatin1String("Arial"), 1000);
+ QFontInfo fontInfo(font);
+
+ if (fontInfo.family() != font.family())
+ QSKIP("Arial font not available.");
+
+ // Smooth and bitmap scaling are mutually exclusive
+ QVERIFY(QFontDatabase().isSmoothlyScalable(font.family()));
+ QVERIFY(!QFontDatabase().isBitmapScalable(font.family()));
+}
+
QTEST_MAIN(tst_QFontDatabase)
#include "tst_qfontdatabase.moc"