Fix missing Windows native fonts in QML applications
authorMiikka Heikkinen <miikka.heikkinen@digia.com>
Fri, 20 Apr 2012 08:21:45 +0000 (11:21 +0300)
committerQt by Nokia <qt-info@nokia.com>
Fri, 20 Apr 2012 14:21:08 +0000 (16:21 +0200)
Windows native fonts were not getting rendered because the font engine
was cloned incorrectly for QRawFont, resulting in multi-engine instead
of the specific cloned engine.

Task-number: QTBUG-25410
Change-Id: I08f543e541739ac1b51f96f381ae1bb20b59399a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
src/plugins/platforms/windows/qwindowsfontengine.cpp

index 9407262..e074f79 100644 (file)
@@ -1133,6 +1133,9 @@ QFontEngine *QWindowsFontEngine::cloneWithSize(qreal pixelSize) const
     if (!uniqueFamilyName.isEmpty())
         request.family = uniqueFamilyName;
     request.pixelSize = pixelSize;
+    // Disable font merging, as otherwise createEngine will return a multi-engine
+    // instance instead of the specific engine we wish to clone.
+    request.styleStrategy |= QFont::NoFontMerging;
 
     QFontEngine *fontEngine =
         QWindowsFontDatabase::createEngine(QUnicodeTables::Common, request, 0,