From cb65e4182fafcbb70e1351656f44eb4e9d8d6351 Mon Sep 17 00:00:00 2001 From: Niklas Wenzel Date: Fri, 4 Mar 2022 16:51:12 +0100 Subject: [PATCH] Add styleName to debug output This makes it easier to debug the font matching behavior. Task-number: QTBUG-101436 Pick-to: 6.3 Change-Id: Id682384e7d9d669b9e736e00ef22cadfd0b4bfec Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/text/qfontdatabase.cpp | 6 ++++-- src/gui/text/windows/qwindowsfontdatabase.cpp | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp index 56930bfdc6..7012ca0869 100644 --- a/src/gui/text/qfontdatabase.cpp +++ b/src/gui/text/qfontdatabase.cpp @@ -1074,13 +1074,15 @@ static int match(int script, qCDebug(lcFontMatch, "QFontDatabase::match\n" " request:\n" " family: %s [%s], script: %d\n" + " styleName: %s\n" " weight: %d, style: %d\n" " stretch: %d\n" " pixelSize: %g\n" " pitch: %c", family_name.isEmpty() ? "-- first in script --" : family_name.toLatin1().constData(), - foundry_name.isEmpty() ? "-- any --" : foundry_name.toLatin1().constData(), - script, request.weight, request.style, request.stretch, request.pixelSize, pitch); + foundry_name.isEmpty() ? "-- any --" : foundry_name.toLatin1().constData(), script, + request.styleName.isEmpty() ? "-- any --" : request.styleName.toLatin1().constData(), + request.weight, request.style, request.stretch, request.pixelSize, pitch); desc->family = nullptr; desc->foundry = nullptr; diff --git a/src/gui/text/windows/qwindowsfontdatabase.cpp b/src/gui/text/windows/qwindowsfontdatabase.cpp index 7e3c33921b..da196880f8 100644 --- a/src/gui/text/windows/qwindowsfontdatabase.cpp +++ b/src/gui/text/windows/qwindowsfontdatabase.cpp @@ -540,7 +540,7 @@ static bool addFontToDatabase(QString familyName, str << " TRUETYPE"; str << " scalable=" << scalable << " Size=" << size << " Style=" << style << " Weight=" << weight - << " stretch=" << stretch; + << " stretch=" << stretch << " styleName=" << styleName; qCDebug(lcQpaFonts) << message; } #endif