diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2016-05-11 15:10:50 +0300 |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2016-05-12 10:13:42 +0000 |
commit | 78eeb6b066113c678fe15531ca10e70964f6b9a4 (patch) | |
tree | bd76de7a6f17ecdf1c0fedff393c5ec091f7bb0c /tests/auto/gui/text/qfont | |
parent | 9ef59b586d6c65404835c5003a0f486ef9e162c3 (diff) |
QFont::exactMatch() should return false for aliases
This is a partial revert of 992f233c in Qt 4 repo. The rest of the
change cannot be reverted, since it added public API, but that
API might be useful anyway.
The patch was wrong, basically. QFont::exactMatch() should not claim
that you can get an exact match for a typeface alias. It also introduced
some weird inconsistencies: For instance, if the first font the alias
resolved to in FontConfig did not exist, then exactMatch() would return
false, even if it then resolved to the next one which existed. This
caused a test failure on OpenSuse, where the preferred font for "sans"
is Arial, which doesn't exist, so Roboto will be used instead.
[ChangeLog][QtGui][Important Behavior Changes] QFont::exactMatch() now
returns false when the provided typeface is an alias.
Task-number: QTBUG-46054
Change-Id: I7532d2879b492544620aa0d1d87dd493a4923af9
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'tests/auto/gui/text/qfont')
-rw-r--r-- | tests/auto/gui/text/qfont/tst_qfont.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/tests/auto/gui/text/qfont/tst_qfont.cpp b/tests/auto/gui/text/qfont/tst_qfont.cpp index 57530653c1..da1e4aa225 100644 --- a/tests/auto/gui/text/qfont/tst_qfont.cpp +++ b/tests/auto/gui/text/qfont/tst_qfont.cpp @@ -115,13 +115,10 @@ void tst_QFont::exactMatch() QSKIP("Exact matching on windows misses a lot because of the sample chars"); #endif - - if (!QGuiApplication::platformName().compare("xcb", Qt::CaseInsensitive)) { - QVERIFY(QFont("sans").exactMatch()); - QVERIFY(QFont("sans-serif").exactMatch()); - QVERIFY(QFont("serif").exactMatch()); - QVERIFY(QFont("monospace").exactMatch()); - } + QVERIFY(!QFont("sans").exactMatch()); + QVERIFY(!QFont("sans-serif").exactMatch()); + QVERIFY(!QFont("serif").exactMatch()); + QVERIFY(!QFont("monospace").exactMatch()); QSKIP("This test is bogus on Unix with support for font aliases in fontconfig"); |