summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/qwindowsfontengine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/windows/qwindowsfontengine.cpp')
-rw-r--r--src/plugins/platforms/windows/qwindowsfontengine.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/plugins/platforms/windows/qwindowsfontengine.cpp b/src/plugins/platforms/windows/qwindowsfontengine.cpp
index 376b1bdc37..6b13d93259 100644
--- a/src/plugins/platforms/windows/qwindowsfontengine.cpp
+++ b/src/plugins/platforms/windows/qwindowsfontengine.cpp
@@ -289,14 +289,15 @@ QWindowsFontEngine::QWindowsFontEngine(const QString &name,
qCDebug(lcQpaFonts) << __FUNCTION__ << name << lf.lfHeight;
HDC hdc = m_fontEngineData->hdc;
SelectObject(hdc, hfont);
- fontDef.pixelSize = -lf.lfHeight;
const BOOL res = GetTextMetrics(hdc, &tm);
- fontDef.fixedPitch = !(tm.tmPitchAndFamily & TMPF_FIXED_PITCH);
if (!res) {
qErrnoWarning("%s: GetTextMetrics failed", __FUNCTION__);
ZeroMemory(&tm, sizeof(TEXTMETRIC));
}
+ fontDef.pixelSize = -lf.lfHeight;
+ fontDef.fixedPitch = !(tm.tmPitchAndFamily & TMPF_FIXED_PITCH);
+
cache_cost = tm.tmHeight * tm.tmAveCharWidth * 2000;
getCMap();