summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qtextlayout.h
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2010-05-03 09:55:44 +0200
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2010-06-04 08:59:59 +0200
commitcad70d64d0bbada72a072ac7fdf461839db9d72a (patch)
treed90c97fdc9561d6108820126e8c7e6d46683f88f /src/gui/text/qtextlayout.h
parenta64791bdf663fb1d7595f11fbe7e44a62acd4126 (diff)
New class: QGlyphs
Introduce an API to access glyph indexes in a font directly. A bug was discovered during this work, where different hinting flags in loadGlyph() and loadGlyphMetrics() would make the metrics in the two functions different, thus causing drawCachedGlyphs() (which uses loadGlyphMetrics() indirectly) to use different metrics than the standard drawTextItem() code path (which uses loadGlyph()). The bug was visible in the tst_QGlyphs::drawExistingGlyphs() test. Reviewed-by: Simon Hausmann
Diffstat (limited to 'src/gui/text/qtextlayout.h')
-rw-r--r--src/gui/text/qtextlayout.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gui/text/qtextlayout.h b/src/gui/text/qtextlayout.h
index 8c93ed65b6..f6aaf22d0f 100644
--- a/src/gui/text/qtextlayout.h
+++ b/src/gui/text/qtextlayout.h
@@ -49,6 +49,7 @@
#include <QtCore/qobject.h>
#include <QtGui/qevent.h>
#include <QtGui/qtextformat.h>
+#include <QtGui/qglyphs.h>
QT_BEGIN_HEADER
@@ -166,6 +167,8 @@ public:
qreal minimumWidth() const;
qreal maximumWidth() const;
+ QList<QGlyphs> glyphs() const;
+
QTextEngine *engine() const { return d; }
void setFlags(int flags);
private:
@@ -236,6 +239,8 @@ public:
private:
QTextLine(int line, QTextEngine *e) : i(line), eng(e) {}
void layout_helper(int numGlyphs);
+ QList<QGlyphs> glyphs() const;
+
friend class QTextLayout;
int i;
QTextEngine *eng;