summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>2014-08-06 13:40:46 +0200
committerKonstantin Ritt <ritt.ks@gmail.com>2014-08-06 17:17:09 +0200
commit8306dee38f4e315399a465b028819b0777746c55 (patch)
treea27cb4059f6c75f50833ba4dfd8211e56221b784 /src/plugins
parent1671dacb521e92986ff2d274d009e3e60a026045 (diff)
Windows: Fix stored family name of fallback fonts
When we create fallback fonts, we copy the fontdef of the main font, but we need to update the family name to match reality, otherwise a QRawFont created with the font engine will have the wrong family name. This is already done in the default implementation of loadEngine(), but was missing from the Windows implementation. One large consequence of this was that when the distance field renderer cloned the font engine (to change its size), it would clone it with the wrong family name. When it later painted its glyph indexes, they would of course refer to the wrong font (the fallback) so random characters would appear. [ChangeLog][Windows] Fixed using QRawFont with fallback fonts, e.g. in the case of text rendering in Qt Quick. Task-number: QTBUG-39172 Change-Id: Ic8fcd9dfc20ec7aadf0b47d4a80417f401f355fd Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/windows/qwindowsfontengine.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/plugins/platforms/windows/qwindowsfontengine.cpp b/src/plugins/platforms/windows/qwindowsfontengine.cpp
index 6f97c8584b..4efedb7bc7 100644
--- a/src/plugins/platforms/windows/qwindowsfontengine.cpp
+++ b/src/plugins/platforms/windows/qwindowsfontengine.cpp
@@ -1350,6 +1350,7 @@ void QWindowsMultiFontEngine::loadEngine(int at)
fontEngine->fontDef.pixelSize,
data);
fedw->fontDef = fontDef;
+ fedw->fontDef.family = fam;
fedw->ref.ref();
engines[at] = fedw;
@@ -1375,6 +1376,7 @@ void QWindowsMultiFontEngine::loadEngine(int at)
engines[at] = new QWindowsFontEngine(fam, hfont, stockFont, lf, data);
engines[at]->ref.ref();
engines[at]->fontDef = fontDef;
+ engines[at]->fontDef.family = fam;
qCDebug(lcQpaFonts) << __FUNCTION__ << at << fam;
// TODO: increase cost in QFontCache for the font engine loaded here