texlive[51269] Build/source/texk/web2c/xetexdir: Do not use hb-icu if

commits+kakuto at tug.org commits+kakuto at tug.org
Thu May 30 05:42:55 CEST 2019


Revision: 51269
          http://tug.org/svn/texlive?view=revision&revision=51269
Author:   kakuto
Date:     2019-05-30 05:42:54 +0200 (Thu, 30 May 2019)
Log Message:
-----------
Do not use hb-icu if HarfBuzz version is 2.5.0 or newer. (Khaled).

Modified Paths:
--------------
    trunk/Build/source/texk/web2c/xetexdir/ChangeLog
    trunk/Build/source/texk/web2c/xetexdir/XeTeXLayoutInterface.cpp

Modified: trunk/Build/source/texk/web2c/xetexdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/xetexdir/ChangeLog	2019-05-29 23:38:33 UTC (rev 51268)
+++ trunk/Build/source/texk/web2c/xetexdir/ChangeLog	2019-05-30 03:42:54 UTC (rev 51269)
@@ -1,3 +1,8 @@
+2019-05-30  Khaled Hosny  <dr.khaled.hosny at gmail.com>
+
+	* XeTeXLayoutInterface.cpp: Do not use hb-icu if HarfBuzz
+	version is 2.5.0 or newer.
+
 2019-01-03  Akira Kakuto  <kakuto at fuk.kindai.ac.jp>
 
 	* NEWS, xetex_version.h, xetex.web: Sync with the upstream.

Modified: trunk/Build/source/texk/web2c/xetexdir/XeTeXLayoutInterface.cpp
===================================================================
--- trunk/Build/source/texk/web2c/xetexdir/XeTeXLayoutInterface.cpp	2019-05-29 23:38:33 UTC (rev 51268)
+++ trunk/Build/source/texk/web2c/xetexdir/XeTeXLayoutInterface.cpp	2019-05-30 03:42:54 UTC (rev 51269)
@@ -39,8 +39,11 @@
 
 #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 @@
     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,9 +681,8 @@
     hb_unicode_funcs_set_decompose_compatibility_func(ufuncs, _decompose_compat, NULL, NULL);
     return ufuncs;
 }
+#endif
 
-static hb_unicode_funcs_t* hbUnicodeFuncs = NULL;
-
 int
 layoutChars(XeTeXLayoutEngine engine, uint16_t chars[], int32_t offset, int32_t count, int32_t max,
                         bool rightToLeft)
@@ -699,11 +702,15 @@
 
     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_set_unicode_funcs(engine->hbBuffer, hbUnicodeFuncs);
+#endif
 
-    hb_buffer_reset(engine->hbBuffer);
-    hb_buffer_set_unicode_funcs(engine->hbBuffer, hbUnicodeFuncs);
     hb_buffer_add_utf16(engine->hbBuffer, chars, max, offset, count);
     hb_buffer_set_direction(engine->hbBuffer, direction);
     hb_buffer_set_script(engine->hbBuffer, script);



More information about the tex-live-commits mailing list