summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qfontengine_ft.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2016-04-04 08:59:11 +0200
committerLiang Qi <liang.qi@theqtcompany.com>2016-04-04 08:59:18 +0200
commit216f57ef8682f74b72ae4e39cf1fd23abddf6a51 (patch)
tree9d1dc12e0944ec0252dac843fbadaf1dc4693888 /src/gui/text/qfontengine_ft.cpp
parent36bc2477753d19a14c587b97d4ec4f263e9e16c0 (diff)
parent8ce657d0279566ef327af1b88339534041ddc012 (diff)
Merge remote-tracking branch 'origin/5.6' into 5.7
Diffstat (limited to 'src/gui/text/qfontengine_ft.cpp')
-rw-r--r--src/gui/text/qfontengine_ft.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp
index 9d62a03f4c..86fb0e8ae4 100644
--- a/src/gui/text/qfontengine_ft.cpp
+++ b/src/gui/text/qfontengine_ft.cpp
@@ -1782,6 +1782,12 @@ void QFontEngineFT::unlockAlphaMapForGlyph()
QFontEngine::unlockAlphaMapForGlyph();
}
+static inline bool is2dRotation(const QTransform &t)
+{
+ return qFuzzyCompare(t.m11(), t.m22()) && qFuzzyCompare(t.m12(), -t.m21())
+ && qFuzzyCompare(t.m11()*t.m22() - t.m12()*t.m21(), 1.0);
+}
+
QFontEngineFT::Glyph *QFontEngineFT::loadGlyphFor(glyph_t g,
QFixed subPixelPosition,
GlyphFormat format,
@@ -1795,7 +1801,7 @@ QFontEngineFT::Glyph *QFontEngineFT::loadGlyphFor(glyph_t g,
Glyph *glyph = glyphSet != 0 ? glyphSet->getGlyph(g, subPixelPosition) : 0;
if (!glyph || glyph->format != format || (!fetchBoundingBox && !glyph->data)) {
QScopedValueRollback<HintStyle> saved_default_hint_style(default_hint_style);
- if (t.type() >= QTransform::TxScale)
+ if (t.type() >= QTransform::TxScale && !is2dRotation(t))
default_hint_style = HintNone; // disable hinting if the glyphs are transformed
lockFace();
@@ -2007,6 +2013,11 @@ QFontEngine *QFontEngineFT::cloneWithSize(qreal pixelSize) const
}
}
+Qt::HANDLE QFontEngineFT::handle() const
+{
+ return non_locked_face();
+}
+
QT_END_NAMESPACE
#endif // QT_NO_FREETYPE