aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYoann Lopes <yoann.lopes@digia.com>2013-11-22 18:52:22 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-25 17:33:03 +0100
commit87da2a2526aa03dd43254730a6e675e83c7c1342 (patch)
tree01b372fc795e29b24f4cb8eae76e0beaa80e5371
parent2331a5ef5765d1b99472cd05e1af4b84d59c0177 (diff)
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 <eskil.abrahamsen-blomfeldt@digia.com>
-rw-r--r--src/quick/items/qquicktextnode.cpp7
1 files changed, 5 insertions, 2 deletions
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);