summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Build/source/texk/web2c/xetexdir/ChangeLog5
-rw-r--r--Build/source/texk/web2c/xetexdir/XeTeXLayoutInterface.cpp15
2 files changed, 16 insertions, 4 deletions
diff --git a/Build/source/texk/web2c/xetexdir/ChangeLog b/Build/source/texk/web2c/xetexdir/ChangeLog
index 0dc1913e6d3..c347291d65f 100644
--- a/Build/source/texk/web2c/xetexdir/ChangeLog
+++ b/Build/source/texk/web2c/xetexdir/ChangeLog
@@ -1,3 +1,8 @@
+2019-05-30 Khaled Hosny <dr.khaled.hosny@gmail.com>
+
+ * XeTeXLayoutInterface.cpp: Do not use hb-icu if HarfBuzz
+ version is 2.5.0 or newer.
+
2019-01-03 Akira Kakuto <kakuto@fuk.kindai.ac.jp>
* NEWS, xetex_version.h, xetex.web: Sync with the upstream.
diff --git a/Build/source/texk/web2c/xetexdir/XeTeXLayoutInterface.cpp b/Build/source/texk/web2c/xetexdir/XeTeXLayoutInterface.cpp
index 5b2d2b53933..dc24f3a93ff 100644
--- a/Build/source/texk/web2c/xetexdir/XeTeXLayoutInterface.cpp
+++ b/Build/source/texk/web2c/xetexdir/XeTeXLayoutInterface.cpp
@@ -39,8 +39,11 @@ authorization from the copyright holders.
#include <graphite2/Font.h>
#include <graphite2/Segment.h>
+#include <hb.h>
#include <hb-graphite2.h>
+#if !HB_VERSION_ATLEAST(2,5,0)
#include <hb-icu.h>
+#endif
#include <hb-ot.h>
#include "XeTeX_web.h"
@@ -661,6 +664,7 @@ deleteLayoutEngine(XeTeXLayoutEngine engine)
free(engine->shaper);
}
+#if !HB_VERSION_ATLEAST(2,5,0)
static unsigned int
_decompose_compat(hb_unicode_funcs_t* ufuncs,
hb_codepoint_t u,
@@ -677,8 +681,7 @@ _get_unicode_funcs(void)
hb_unicode_funcs_set_decompose_compatibility_func(ufuncs, _decompose_compat, NULL, NULL);
return ufuncs;
}
-
-static hb_unicode_funcs_t* hbUnicodeFuncs = NULL;
+#endif
int
layoutChars(XeTeXLayoutEngine engine, uint16_t chars[], int32_t offset, int32_t count, int32_t max,
@@ -699,11 +702,15 @@ layoutChars(XeTeXLayoutEngine engine, uint16_t chars[], int32_t offset, int32_t
script = hb_ot_tag_to_script (engine->script);
+ hb_buffer_reset(engine->hbBuffer);
+
+#if !HB_VERSION_ATLEAST(2,5,0)
+ static hb_unicode_funcs_t* hbUnicodeFuncs = NULL;
if (hbUnicodeFuncs == NULL)
hbUnicodeFuncs = _get_unicode_funcs();
-
- hb_buffer_reset(engine->hbBuffer);
hb_buffer_set_unicode_funcs(engine->hbBuffer, hbUnicodeFuncs);
+#endif
+
hb_buffer_add_utf16(engine->hbBuffer, chars, max, offset, count);
hb_buffer_set_direction(engine->hbBuffer, direction);
hb_buffer_set_script(engine->hbBuffer, script);