From cde562cf6d65a3ad64fa6afd6014be74febdf912 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Thu, 11 Nov 2021 13:43:08 +0100 Subject: [PATCH] Properly fix QFontDatabase test on Freetype Amends 4dd5020fbdfdd34f1e4ec54521217e472942a4b4. I messed up the fix for the XFAIL condition, since the font engine type we get from a normal QFont will be QFontEngine::Multi regardless of whether the actual font engines are Freetype or not. Use NoFontMerging to avoid this. Pick-to: 6.2 Task-number: QTBUG-97995 Change-Id: I2298c997e6826e667dbb8e3d004821f296625ef7 Reviewed-by: Allan Sandfeld Jensen --- tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp b/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp index 2ce98be935..6b6ad201bf 100644 --- a/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp +++ b/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp @@ -431,7 +431,9 @@ void tst_QFontDatabase::condensedFontMatching() tfcByStyleName.setStyleName("Condensed"); #ifdef Q_OS_WIN - QFontPrivate *font_d = QFontPrivate::get(tfcByStretch); + QFont f; + f.setStyleStrategy(QFont::NoFontMerging); + QFontPrivate *font_d = QFontPrivate::get(f); if (font_d->engineForScript(QChar::Script_Common)->type() != QFontEngine::Freetype) QEXPECT_FAIL("","No matching of sub-family by stretch on Windows", Continue); #endif