diff options
author | Konstantin Ritt <ritt.ks@gmail.com> | 2013-03-09 21:39:21 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-03-13 14:46:26 +0100 |
commit | cfa663d62b147c4050359e036f17a6b1b6a8b4fe (patch) | |
tree | 1ae4bbde87ccee0f00878c29f292c99ab2eb32d5 /src/gui/text/qfontengine_p.h | |
parent | 74494ea29ebc6e152348ed6a6c1e2c9399ddb204 (diff) |
Avoid using HB types in QFontEngine API
This affects HB_Font and HB_Face.
As of now, the Hurfbuzz API usage is concentrated in qfontengine(|_ft).cpp
and qtextengine.cpp, thus it is a lot easier to switch to Hurfbuzz-NG.
Change-Id: Ie06959efd5d6080fe44c407d9f5de0a07dd1c210
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Josh Faust <jfaust@suitabletech.com>
Diffstat (limited to 'src/gui/text/qfontengine_p.h')
-rw-r--r-- | src/gui/text/qfontengine_p.h | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/src/gui/text/qfontengine_p.h b/src/gui/text/qfontengine_p.h index 4f29aff9d7..3c7746b3c9 100644 --- a/src/gui/text/qfontengine_p.h +++ b/src/gui/text/qfontengine_p.h @@ -60,8 +60,6 @@ #include "private/qtextengine_p.h" #include "private/qfont_p.h" -#include "private/qharfbuzz_copy_p.h" - #include <private/qfontengineglyphcache_p.h> QT_BEGIN_NAMESPACE @@ -77,6 +75,7 @@ struct QGlyphLayout; ((quint32)(ch4)) \ ) +typedef void (*qt_destroy_func_t) (void *user_data); class Q_GUI_EXPORT QFontEngine : public QObject { @@ -162,11 +161,6 @@ public: /* returns 0 as glyph index for non existent glyphs */ virtual bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, ShaperFlags flags) const = 0; - - /** - * This is a callback from harfbuzz. The font engine uses the font-system in use to find out the - * advances of each glyph and set it on the layout. - */ virtual void recalcAdvances(QGlyphLayout *, ShaperFlags) const {} virtual void doKerning(QGlyphLayout *, ShaperFlags) const; @@ -248,9 +242,8 @@ public: virtual QFontEngine *cloneWithSize(qreal /*pixelSize*/) const { return 0; } - HB_Font harfbuzzFont() const; - HB_Face harfbuzzFace() const; - HB_Face initializedHarfbuzzFace() const; + void *harfbuzzFont() const; + void *harfbuzzFace() const; bool supportsScript(QChar::Script script) const; virtual int getPointInOutline(glyph_t glyph, int flags, quint32 point, QFixed *xpos, QFixed *ypos, quint32 *nPoints); @@ -273,12 +266,16 @@ public: QAtomicInt ref; QFontDef fontDef; + + mutable void *font_; + mutable qt_destroy_func_t font_destroy_func; + mutable void *face_; + mutable qt_destroy_func_t face_destroy_func; + uint cache_cost; // amount of mem used in kb by the font int cache_count; uint fsType : 16; bool symbol; - mutable HB_FontRec hbFont; - mutable HB_Face hbFace; struct KernPair { uint left_right; QFixed adjust; |