summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2019-09-12 15:52:06 +0200
committerPeter Varga <pvarga@inf.u-szeged.hu>2019-11-27 11:38:27 +0000
commit1e6a680f8399ed3914a80da2f3a7cb3ef30e4a75 (patch)
treec787cd932da4ccecd60b01eda7ffeda171473fb9 /tests
parent89bd5a7e733a64b694abf16b8d227dbbdd2d3ef7 (diff)
CoreText: Modernize style hint fallback lookup
The DefaultFontFallbacks.plist system file that we used for looking up style fallbacks does not exists in macOS 10.15, nor did it ever exists on iOS. Instead of relying on this file, we hard-code a set of default families, that we then look up the fallbacks for. The result of QFont::defaultFamily() on macOS is now: QFont::Helvetica --> "Helvetica" QFont::Times --> "Times New Roman" QFont::Courier --> "American Typewriter" QFont::OldEnglish --> "" QFont::System --> "Lucida Grande" QFont::AnyStyle --> "Lucida Grande" QFont::Cursive --> "Apple Chancery" QFont::Monospace --> "Menlo" QFont::Fantasy --> "Zapfino" And on iOS: QFont::Helvetica --> "Helvetica" QFont::Times --> "Times New Roman" QFont::Courier --> "American Typewriter" QFont::OldEnglish --> "" QFont::System --> "Helvetica" QFont::AnyStyle --> "Helvetica" QFont::Cursive --> "" QFont::Monospace --> "Menlo" QFont::Fantasy --> "Zapfino" Fixes: QTBUG-78240 Change-Id: Ie9bc13c9c1031d89f024199e4736a046c568a48d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> (cherry picked from commit 7f0faddf9fe25adc0a3e0827e21c030d6a7a1035) Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/gui/text/qfont/tst_qfont.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/auto/gui/text/qfont/tst_qfont.cpp b/tests/auto/gui/text/qfont/tst_qfont.cpp
index 8090f38a2c..186f71302f 100644
--- a/tests/auto/gui/text/qfont/tst_qfont.cpp
+++ b/tests/auto/gui/text/qfont/tst_qfont.cpp
@@ -515,10 +515,10 @@ void tst_QFont::defaultFamily_data()
QTest::addColumn<QStringList>("acceptableFamilies");
QTest::newRow("serif") << QFont::Serif << (QStringList() << "Times New Roman" << "Times" << "Droid Serif" << getPlatformGenericFont("serif").split(","));
- QTest::newRow("monospace") << QFont::Monospace << (QStringList() << "Courier New" << "Monaco" << "Droid Sans Mono" << getPlatformGenericFont("monospace").split(","));
+ QTest::newRow("monospace") << QFont::Monospace << (QStringList() << "Courier New" << "Monaco" << "Menlo" << "Droid Sans Mono" << getPlatformGenericFont("monospace").split(","));
QTest::newRow("cursive") << QFont::Cursive << (QStringList() << "Comic Sans MS" << "Apple Chancery" << "Roboto" << "Droid Sans" << getPlatformGenericFont("cursive").split(","));
QTest::newRow("fantasy") << QFont::Fantasy << (QStringList() << "Impact" << "Zapfino" << "Roboto" << "Droid Sans" << getPlatformGenericFont("fantasy").split(","));
- QTest::newRow("sans-serif") << QFont::SansSerif << (QStringList() << "Arial" << "Lucida Grande" << "Roboto" << "Droid Sans" << "Segoe UI" << getPlatformGenericFont("sans-serif").split(","));
+ QTest::newRow("sans-serif") << QFont::SansSerif << (QStringList() << "Arial" << "Lucida Grande" << "Helvetica" << "Roboto" << "Droid Sans" << "Segoe UI" << getPlatformGenericFont("sans-serif").split(","));
}
void tst_QFont::defaultFamily()