Replace "OpenType missing" warnings with qCInfo()

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 6.8
Fixes: QTBUG-129092
Change-Id: I0584ce3d1e37790368cf616c99df077fc07b80a6
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
Eskil Abrahamsen Blomfeldt 2024-10-24 08:51:12 +02:00
parent 1db1a3bb1e
commit cd6608e887

View File

@ -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;