summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/qwindowsfontengine.cpp
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@theqtcompany.com>2014-11-27 18:28:12 +0100
committerFrederik Gladhorn <frederik.gladhorn@theqtcompany.com>2014-11-27 18:28:12 +0100
commitce6990c3e742e0833df0561246554cf07a888efb (patch)
tree412380582040f5bb314eb90ae029b41a883aa439 /src/plugins/platforms/windows/qwindowsfontengine.cpp
parent09e674849a40f5eb7e9f95fd2a952c621aec86d1 (diff)
parentfa9bde7d3a12ede956339c570f7b32f95d231e57 (diff)
Merge remote-tracking branch 'origin/5.4' into dev
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();