diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2010-05-03 07:55:44 (GMT) |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2010-06-04 06:59:59 (GMT) |
commit | cad70d64d0bbada72a072ac7fdf461839db9d72a (patch) | |
tree | d90c97fdc9561d6108820126e8c7e6d46683f88f /src/gui/text/qfontengine_p.h | |
parent | a64791bdf663fb1d7595f11fbe7e44a62acd4126 (diff) | |
download | Qt-cad70d64d0bbada72a072ac7fdf461839db9d72a.zip Qt-cad70d64d0bbada72a072ac7fdf461839db9d72a.tar.gz Qt-cad70d64d0bbada72a072ac7fdf461839db9d72a.tar.bz2 |
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/qfontengine_p.h')
-rw-r--r-- | src/gui/text/qfontengine_p.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/gui/text/qfontengine_p.h b/src/gui/text/qfontengine_p.h index 922acfb..d29ef45 100644 --- a/src/gui/text/qfontengine_p.h +++ b/src/gui/text/qfontengine_p.h @@ -173,6 +173,10 @@ public: #endif virtual void addGlyphsToPath(glyph_t *glyphs, QFixedPoint *positions, int nglyphs, QPainterPath *path, QTextItem::RenderFlags flags); + + /* Creates a QFont object to represent this particular QFontEngine */ + virtual QFont createExplicitFont() const; + void getGlyphPositions(const QGlyphLayout &glyphs, const QTransform &matrix, QTextItem::RenderFlags flags, QVarLengthArray<glyph_t> &glyphs_out, QVarLengthArray<QFixedPoint> &positions); @@ -252,6 +256,7 @@ public: int glyphFormat; protected: + QFont createExplicitFontWithName(const QString &familyName) const; static const QVector<QRgb> &grayPalette(); private: @@ -454,7 +459,7 @@ public: virtual QImage alphaRGBMapForGlyph(glyph_t, int margin, const QTransform &t); virtual qreal minRightBearing() const; virtual qreal minLeftBearing() const; - + virtual QFont createExplicitFont() const; private: QImage imageForGlyph(glyph_t glyph, int margin, bool colorful); @@ -520,6 +525,8 @@ public: virtual qreal maxCharWidth() const; virtual QFixed averageCharWidth() const; + virtual QFont createExplicitFont() const; + virtual void addGlyphsToPath(glyph_t *glyphs, QFixedPoint *positions, int numGlyphs, QPainterPath *path, QTextItem::RenderFlags); |