summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gui/text/qharfbuzzng.cpp7
-rw-r--r--src/gui/text/qharfbuzzng_p.h21
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);