QWindowsFontEnginge uses GetGlyphOutline which seems to fail
authorJørgen Lind <jorgen.lind@digia.com>
Wed, 30 Apr 2014 08:44:55 +0000 (10:44 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Wed, 7 May 2014 08:57:34 +0000 (10:57 +0200)
for fonts containing embedded bitmaps.

Change-Id: I035df24d16f1c9707fff54b0920c8139fda3ddec
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
src/quick/items/qquicktextnode.cpp

index 1133636..da0d9cd 100644 (file)
@@ -144,8 +144,15 @@ QSGGlyphNode *QQuickTextNode::addGlyphs(const QPointF &position, const QGlyphRun
 {
     QSGRenderContext *sg = QQuickItemPrivate::get(m_ownerElement)->sceneGraphRenderContext();
     QRawFont font = glyphs.rawFont();
-    bool smoothScalable = QFontDatabase().isSmoothlyScalable(font.familyName(), font.styleName());
-    bool preferNativeGlyphNode = m_useNativeRenderer || !smoothScalable;
+    bool preferNativeGlyphNode = m_useNativeRenderer;
+    if (!preferNativeGlyphNode) {
+        QRawFontPrivate *fontPriv = QRawFontPrivate::get(font);
+        if (fontPriv->fontEngine->hasUnreliableGlyphOutline())
+            preferNativeGlyphNode = true;
+        else
+            preferNativeGlyphNode = !QFontDatabase().isSmoothlyScalable(font.familyName(), font.styleName());
+    }
+
     QSGGlyphNode *node = sg->sceneGraphContext()->createGlyphNode(sg, preferNativeGlyphNode);
 
     node->setOwnerElement(m_ownerElement);