Skip to content

Commit

Permalink
QFontDatabase: use categorized logging more
Browse files Browse the repository at this point in the history
Use "qt.text.font.db" logging category to print OpenType related
warnings during loading a font engine. Also, as a drive-by change,
use qUtf16Printable() to avoid unneeded allocations.

Task-number: QTBUG-129092
Pick-to: 6.8
Change-Id: If603aa1251c0073aec7bb0ba75d3e5e9e0385ac1
Reviewed-by: Eskil Abrahamsen Blomfeldt <[email protected]>
  • Loading branch information
VladimirBelyavsky committed Sep 19, 2024
1 parent 2addfa6 commit 0c7a89f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/gui/text/qfontdatabase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)))) {
qWarning(" OpenType support missing for \"%s\", script %d",
qPrintable(def.families.constFirst()), script);
qCWarning(lcFontDb, "OpenType support missing for \"%ls\", script %d",
qUtf16Printable(def.families.constFirst()), script);
return nullptr;
}

Expand All @@ -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))) {
qWarning(" OpenType support missing for \"%s\", script %d",
+qPrintable(def.families.constFirst()), script);
qCWarning(lcFontDb, "OpenType support missing for \"%ls\", script %d",
qUtf16Printable(def.families.constFirst()), script);
if (engine->ref.loadRelaxed() == 0)
delete engine;
return nullptr;
Expand Down

0 comments on commit 0c7a89f

Please sign in to comment.