Fix tst_qfontdatabase on Windows with Freetype

Since e05e3c776256d35798f451f31cd71e809786ed78, the advance test in
tst_QFontDatabase::condensedFontMatching() passes with the bundled
freetype engine, so the XFAIL causes a failure when running with this
configuration.

Change-Id: Ie6fbccfa0d9c79654563e9e3f19694f252e32fc6
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 518790af79df339143820cd9d34a74c00db1ed7e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Eskil Abrahamsen Blomfeldt 2021-11-10 08:32:01 +01:00 committed by Qt Cherry-pick Bot
parent 598a81937e
commit 87f0096c80

View File

@ -34,6 +34,8 @@
#include <qfontmetrics.h>
#include <qtextlayout.h>
#include <private/qrawfont_p.h>
#include <private/qfont_p.h>
#include <private/qfontengine_p.h>
#include <qpa/qplatformfontdatabase.h>
Q_LOGGING_CATEGORY(lcTests, "qt.text.tests")
@ -405,7 +407,9 @@ void tst_QFontDatabase::condensedFontMatching()
tfcByStyleName.setStyleName("Condensed");
#ifdef Q_OS_WIN
QEXPECT_FAIL("","No matching of sub-family by stretch on Windows", Continue);
QFontPrivate *font_d = QFontPrivate::get(tfcByStretch);
if (font_d->engineForScript(QChar::Script_Common)->type() != QFontEngine::Freetype)
QEXPECT_FAIL("","No matching of sub-family by stretch on Windows", Continue);
#endif
#ifdef Q_OS_ANDROID