From 5d130f9682fbd3dc8c469468e805854fd70a11ea Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Fri, 4 Jun 2010 19:51:59 +0200 Subject: Retrieve proper glyph outlines from Symbian^4 Up until Symbian^4, the Symbian font Api does not provide access to the vector data of glyphs. In order to make QPainterPath::addText() and transformed text rendering work, Qt falls back to a workaound: Tracing the bitmap of a rasterized glyph. That is neither performant nor is the result of good quality. Symbian^4 will add Api that returns glyph outlines encoded as SVG paths. The code in this commit essentially parses the SVG path and returns a QPainterPath. The parsing part took some ideas from QSvg, and is implemented in a very reduced way. Task-number: QT-809 Reviewed-by: Aleksandar Sasha Babic --- src/gui/text/qfontengine_s60_p.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/gui/text/qfontengine_s60_p.h') diff --git a/src/gui/text/qfontengine_s60_p.h b/src/gui/text/qfontengine_s60_p.h index dea32c489f..beeb4cc252 100644 --- a/src/gui/text/qfontengine_s60_p.h +++ b/src/gui/text/qfontengine_s60_p.h @@ -62,6 +62,10 @@ #define Q_SYMBIAN_HAS_FONTTABLE_API #endif +#ifdef Q_SYMBIAN_HAS_FONTTABLE_API +#define Q_SYMBIAN_HAS_GLYPHOUTLINE_API +#endif // Q_SYMBIAN_HAS_FONTTABLE_API + class CFont; QT_BEGIN_NAMESPACE @@ -97,6 +101,9 @@ public: bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, QTextEngine::ShaperFlags flags) const; void recalcAdvances(QGlyphLayout *glyphs, QTextEngine::ShaperFlags flags) const; + void addGlyphsToPath(glyph_t *glyphs, QFixedPoint *positions, int nglyphs, + QPainterPath *path, QTextItem::RenderFlags flags); + QImage alphaMapForGlyph(glyph_t glyph); glyph_metrics_t boundingBox(const QGlyphLayout &glyphs); -- cgit v1.2.3