summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2019-09-12 15:52:06 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2019-09-16 11:26:07 +0200
commit7f0faddf9fe25adc0a3e0827e21c030d6a7a1035 (patch)
tree76e656f60357eeed9c567bca9263abbf47a98659 /tests/auto/gui
parentd20bacbb4cedf012566ce0020f9e53a7c1ecbe5f (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>
Diffstat (limited to 'tests/auto/gui')
-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 96f3b1c1d7..1ee9105cd2 100644
--- a/tests/auto/gui/text/qfont/tst_qfont.cpp
+++ b/tests/auto/gui/text/qfont/tst_qfont.cpp
@@ -539,10 +539,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()