diff options
author | Konstantin Ritt <ritt.ks@gmail.com> | 2020-03-18 05:36:49 +0300 |
---|---|---|
committer | Konstantin Ritt <ritt.ks@gmail.com> | 2020-03-25 02:22:14 +0300 |
commit | 5e213a41ce487ae306135993f8e136032decf7de (patch) | |
tree | 4b4c50a9a5e440231d49b1e059f129f68635cead | |
parent | 9fc9fefdc9f598f8d223dc6eab533be4d0abc762 (diff) |
HB-to-Qt: stop propagating helpers and types not used outside QtGui
Change-Id: I039efaeabc83bc0367bb3ab949057d2cbc6c2742
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
-rw-r--r-- | src/gui/text/qharfbuzzng.cpp | 7 | ||||
-rw-r--r-- | src/gui/text/qharfbuzzng_p.h | 21 |
2 files changed, 16 insertions, 12 deletions
diff --git a/src/gui/text/qharfbuzzng.cpp b/src/gui/text/qharfbuzzng.cpp index 4613aff9e8..695a190fd7 100644 --- a/src/gui/text/qharfbuzzng.cpp +++ b/src/gui/text/qharfbuzzng.cpp @@ -619,11 +619,6 @@ struct _hb_qt_font_funcs_t { Q_GLOBAL_STATIC(_hb_qt_font_funcs_t, qt_ffuncs) -hb_font_funcs_t *hb_qt_get_font_funcs() -{ - return qt_ffuncs()->funcs; -} - static hb_blob_t * _hb_qt_reference_table(hb_face_t * /*face*/, hb_tag_t tag, void *user_data) @@ -704,7 +699,7 @@ _hb_qt_font_create(QFontEngine *fe) const qreal y_ppem = fe->fontDef.pixelSize; const qreal x_ppem = (fe->fontDef.pixelSize * fe->fontDef.stretch) / 100.0; - hb_font_set_funcs(font, hb_qt_get_font_funcs(), (void *)fe, NULL); + hb_font_set_funcs(font, qt_ffuncs()->funcs, fe, nullptr); hb_font_set_scale(font, QFixed::fromReal(x_ppem).value(), -QFixed::fromReal(y_ppem).value()); hb_font_set_ppem(font, int(x_ppem), int(y_ppem)); diff --git a/src/gui/text/qharfbuzzng_p.h b/src/gui/text/qharfbuzzng_p.h index fabf222bae..4fb7e0aef7 100644 --- a/src/gui/text/qharfbuzzng_p.h +++ b/src/gui/text/qharfbuzzng_p.h @@ -58,24 +58,33 @@ QT_REQUIRE_CONFIG(harfbuzz); #include <QtCore/qchar.h> -#include <harfbuzz/hb.h> +#if defined(QT_BUILD_GUI_LIB) +# include <harfbuzz/hb.h> +#else +// a minimal set of HB types required for Qt libs other than Gui + +typedef struct hb_face_t hb_face_t; +typedef struct hb_font_t hb_font_t; + +#endif // QT_BUILD_GUI_LIB QT_BEGIN_NAMESPACE class QFontEngine; +#if defined(QT_BUILD_GUI_LIB) + // Unicode -Q_GUI_EXPORT hb_script_t hb_qt_script_to_script(QChar::Script script); -Q_GUI_EXPORT QChar::Script hb_qt_script_from_script(hb_script_t script); +hb_script_t hb_qt_script_to_script(QChar::Script script); +QChar::Script hb_qt_script_from_script(hb_script_t script); -Q_GUI_EXPORT hb_unicode_funcs_t *hb_qt_get_unicode_funcs(); +hb_unicode_funcs_t *hb_qt_get_unicode_funcs(); +#endif // QT_BUILD_GUI_LIB // Font -Q_GUI_EXPORT hb_font_funcs_t *hb_qt_get_font_funcs(); - Q_GUI_EXPORT hb_face_t *hb_qt_face_get_for_engine(QFontEngine *fe); Q_GUI_EXPORT hb_font_t *hb_qt_font_get_for_engine(QFontEngine *fe); |