diff options
author | Morten Sørvig <morten.sorvig@qt.io> | 2022-10-21 11:47:55 +0200 |
---|---|---|
committer | Morten Johan Sørvig <morten.sorvig@qt.io> | 2022-11-01 11:27:08 +0000 |
commit | edb00660e47a82ac24048841100d7d7e59a7805e (patch) | |
tree | 7f214c1c723f182c5bee2327f54434d701bdc9aa /src/gui/text/windows/qwindowsfontdatabasebase_p.h | |
parent | 18425c33292b4f11d2bf0b8cdd4e89fe51550f57 (diff) |
Port default font resolve to SystemParametersInfoForDpi
We were getting font metrics for the primary screen and then adjusting
for the screen DPI get a screen-independent font size.
This could fail in edge cases where the screen DPI was changed after
app startup, but before the first window was shown. See QTBUG-105857.
Use SystemParametersInfoForDpi() to query for font info at 96 DPI instead,
which removes the need for tracking primary screen DPI.
LOGFONT_to_QFont() still has one usage (qwizard_win.cpp) which provides
a custom DPI for scaling, so we keep that function as-is.
Fixes: QTBUG-105857
Pick-to: 6.4 6.2 5.15
Change-Id: I1adf0ab3bf2c309e8fcb58093e86214fa11a2da8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/gui/text/windows/qwindowsfontdatabasebase_p.h')
-rw-r--r-- | src/gui/text/windows/qwindowsfontdatabasebase_p.h | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/src/gui/text/windows/qwindowsfontdatabasebase_p.h b/src/gui/text/windows/qwindowsfontdatabasebase_p.h index 1451eed051..60acc5cb06 100644 --- a/src/gui/text/windows/qwindowsfontdatabasebase_p.h +++ b/src/gui/text/windows/qwindowsfontdatabasebase_p.h @@ -57,7 +57,6 @@ public: QFontEngine *fontEngine(const QByteArray &fontData, qreal pixelSize, QFont::HintingPreference hintingPreference) override; static int defaultVerticalDPI(); - static void setDefaultVerticalDPI(int d); static QSharedPointer<QWindowsFontEngineData> data(); #if QT_CONFIG(directwrite) |