summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui/text
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2022-06-29 08:39:07 +0200
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2022-08-15 18:23:43 +0200
commit360f1547f70fd5752a3a44892bfe5009a4357f3c (patch)
tree504e729fc03427ea58ac96ab0264fdbd33ec8c5d /tests/auto/gui/text
parent47fded488ec15078409af8a828e7223bf2e428f0 (diff)
Fix QFontDatabase::hasFamily() for ambiguous families
If a font family has several instances from different foundries, we disambiguate this by adding the foundry name in brackets behind the family. But QFontDatabase::hasFamily() would only check for families().contains(familyName). So if the database contains e.g. Foo [Bar] and Foo [Baz] then a check for hasFamily("Foo") would fail. So we need to actually check for the family name instead. In doing this, we also skip the extra step of building the list and then searching it, but just go directly to the source. This removes the BLACKLISTing of Ubuntu and also introduces a QSKIP on Unix-based platforms without fontconfig, since there is no way to know which default fonts are acceptable on those platforms. Pick-to: 6.4 Fixes: QTBUG-86967 Change-Id: Id8ad80a1671daf1c14fbad8bb8f4c51ee1c59709 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'tests/auto/gui/text')
-rw-r--r--tests/auto/gui/text/qfont/BLACKLIST4
-rw-r--r--tests/auto/gui/text/qfont/tst_qfont.cpp5
2 files changed, 5 insertions, 4 deletions
diff --git a/tests/auto/gui/text/qfont/BLACKLIST b/tests/auto/gui/text/qfont/BLACKLIST
index e914a7e533..f85d8ceebb 100644
--- a/tests/auto/gui/text/qfont/BLACKLIST
+++ b/tests/auto/gui/text/qfont/BLACKLIST
@@ -1,12 +1,8 @@
[defaultFamily:cursive]
-ubuntu-20.04
-ubuntu-22.04
centos
b2qt
rhel
[defaultFamily:fantasy]
-ubuntu-20.04
-ubuntu-22.04
centos
b2qt
rhel
diff --git a/tests/auto/gui/text/qfont/tst_qfont.cpp b/tests/auto/gui/text/qfont/tst_qfont.cpp
index a663468d0f..4b3d4bfddb 100644
--- a/tests/auto/gui/text/qfont/tst_qfont.cpp
+++ b/tests/auto/gui/text/qfont/tst_qfont.cpp
@@ -589,6 +589,11 @@ void tst_QFont::defaultFamily()
break;
}
}
+
+#if defined(Q_OS_UNIX) && defined(QT_NO_FONTCONFIG)
+ QSKIP("This platform does not support checking for default font acceptability");
+#endif
+
#ifdef Q_PROCESSOR_ARM_32
if (QTestPrivate::isRunningArmOnX86())
QEXPECT_FAIL("", "Fails on ARMv7 QEMU (QTQAINFRA-4127)", Continue);