From 96f17a061a73bdd19e2c5df221a191968d777123 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Wed, 21 Nov 2012 09:58:12 +0100 Subject: Fix transformed text on Mac OS X MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In change 1582407fc782c0befd0760633324dd5c206524a1, the Q_WS_MAC code path which disabled drawing cached glyphs for any transform was removed, as was the comment that scaling and rotation wasn't supported by the Mac font engines. This obviously broke transformed text on Mac, so we need to put it back. I put it into the font engine itself where it belongs, and I kept the somewhat confusing naming convention which is used in the paint engine to minimize this patch. I'll clean up these function names in a future commit. Task-number: QTBUG-27362 Change-Id: I4fc6a503eedd4b1ebaf3ee659d948f997f433338 Reviewed-by: Samuel Rødal --- src/gui/text/qfontengine.cpp | 4 ++++ src/gui/text/qfontengine_p.h | 2 ++ 2 files changed, 6 insertions(+) (limited to 'src/gui/text') diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp index fa4e7a75bc..400ce8366f 100644 --- a/src/gui/text/qfontengine.cpp +++ b/src/gui/text/qfontengine.cpp @@ -268,6 +268,10 @@ QFixed QFontEngine::averageCharWidth() const return bb.xoff; } +bool QFontEngine::supportsTransformations(const QTransform &transform) const +{ + return (transform.type() >= QTransform::TxProject); +} void QFontEngine::getGlyphPositions(const QGlyphLayout &glyphs, const QTransform &matrix, QTextItem::RenderFlags flags, QVarLengthArray &glyphs_out, QVarLengthArray &positions) diff --git a/src/gui/text/qfontengine_p.h b/src/gui/text/qfontengine_p.h index 745e39ecf5..3321ca3b93 100644 --- a/src/gui/text/qfontengine_p.h +++ b/src/gui/text/qfontengine_p.h @@ -241,6 +241,8 @@ public: return canRender(utf16, utf16len); } + virtual bool supportsTransformations(const QTransform &transform) const; + virtual Type type() const = 0; virtual int glyphCount() const; -- cgit v1.2.3