From 87da2a2526aa03dd43254730a6e675e83c7c1342 Mon Sep 17 00:00:00 2001 From: Yoann Lopes Date: Fri, 22 Nov 2013 18:52:22 +0100 Subject: Use QFontDatabase to check if a font is scalable. The flag set in QFontEngine was not always correctly set, use QFontDatabase instead which is slower but should always be correct. We fallback to native font rendering when the font is not scalable. Change-Id: Ie9a2397abd42890d0fb05bc2f9c46a60040296f2 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/quick/items/qquicktextnode.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/quick') diff --git a/src/quick/items/qquicktextnode.cpp b/src/quick/items/qquicktextnode.cpp index dd314c892d..18ee1a479d 100644 --- a/src/quick/items/qquicktextnode.cpp +++ b/src/quick/items/qquicktextnode.cpp @@ -143,10 +143,13 @@ QSGGlyphNode *QQuickTextNode::addGlyphs(const QPointF &position, const QGlyphRun QSGNode *parentNode) { QSGRenderContext *sg = QQuickItemPrivate::get(m_ownerElement)->sceneGraphRenderContext(); - QRawFontPrivate *fontP = QRawFontPrivate::get(glyphs.rawFont()); - QSGGlyphNode *node = m_useNativeRenderer || !fontP->fontEngine->smoothScalable + QRawFont font = glyphs.rawFont(); + bool smoothScalable = QFontDatabase().isSmoothlyScalable(font.familyName(), + font.styleName()); + QSGGlyphNode *node = m_useNativeRenderer || !smoothScalable ? sg->sceneGraphContext()->createNativeGlyphNode(sg) : sg->sceneGraphContext()->createGlyphNode(sg); + node->setOwnerElement(m_ownerElement); node->setGlyphs(position + QPointF(0, glyphs.rawFont().ascent()), glyphs); node->setStyle(style); -- cgit v1.2.3