From 8d83abfaf7ce7529d19c9d936e5717da1a7bfbfb Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Thu, 24 Oct 2024 08:51:12 +0200 Subject: [PATCH] Replace "OpenType missing" warnings with qCInfo() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Back when this code was written, the font matching algorithm would also match the script of the font, but for multi-font engines, this no longer happens after this change: c003a18ee332abf2387172eb0856a176a32a6c8f. Since that change, we will always prefer the requested font, even if it does not claim to support the writing system in question. The normal fallback mechanism in the platform plugin will be used instead of having a secondary, cross-platform fallback mechanism like before. With this change, it is quite possible to get a main font engine which does not support the given script, since this will essentially always just be the font the user asked for. Therefore, warning that it does not is really redundant and just adds noise to the console output. This turns the warnings into qCInfo() instead, so it is still possible to get the information if we need to, but by default it will not be visible. Pick-to: 6.5 Fixes: QTBUG-129092 Change-Id: I0584ce3d1e37790368cf616c99df077fc07b80a6 Reviewed-by: Tor Arne Vestbø (cherry picked from commit cd6608e887066db2d9150bf6ea9111e8bd5b8fec) Reviewed-by: Qt Cherry-pick Bot --- src/gui/text/qfontdatabase.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp index 5706def9a1e..2853997764f 100644 --- a/src/gui/text/qfontdatabase.cpp +++ b/src/gui/text/qfontdatabase.cpp @@ -733,8 +733,8 @@ QFontEngine *QFontDatabasePrivate::loadSingleEngine(int script, if (engine) { // Also check for OpenType tables when using complex scripts if (Q_UNLIKELY(!engine->supportsScript(QChar::Script(script)))) { - qCWarning(lcFontDb, "OpenType support missing for \"%ls\", script %d", - qUtf16Printable(def.families.constFirst()), script); + qCInfo(lcFontDb, "OpenType support missing for \"%ls\", script %d", + qUtf16Printable(def.families.constFirst()), script); return nullptr; } @@ -758,8 +758,8 @@ QFontEngine *QFontDatabasePrivate::loadSingleEngine(int script, if (engine) { // Also check for OpenType tables when using complex scripts if (!engine->supportsScript(QChar::Script(script))) { - qCWarning(lcFontDb, "OpenType support missing for \"%ls\", script %d", - qUtf16Printable(def.families.constFirst()), script); + qCInfo(lcFontDb, "OpenType support missing for \"%ls\", script %d", + qUtf16Printable(def.families.constFirst()), script); if (engine->ref.loadRelaxed() == 0) delete engine; return nullptr;