[HarfBuzz] harfbuzz: Branch 'master' - 6 commits

Behdad Esfahbod behdad at kemper.freedesktop.org
Sun Feb 4 17:37:00 UTC 2018


 CMakeLists.txt                      |   18 +++++++++---------
 configure.ac                        |    2 +-
 src/hb-aat-layout-common-private.hh |    2 +-
 src/hb-aat-layout-morx-table.hh     |   22 ++++++++++++----------
 src/hb-buffer-deserialize-json.rl   |    4 ++--
 src/hb-buffer-deserialize-text.rl   |    4 ++--
 src/hb-private.hh                   |    6 ++++++
 7 files changed, 33 insertions(+), 25 deletions(-)

New commits:
commit aed32589af6d5fce3e68fe41865e258ea7eb2413
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Fri Feb 2 16:08:50 2018 -0500

    [aat] In ContextualSubtable, mark mark after substituting mark
    
    Fixes MORX-21.

diff --git a/src/hb-aat-layout-morx-table.hh b/src/hb-aat-layout-morx-table.hh
index 7a45a24e..ffe4d03a 100644
--- a/src/hb-aat-layout-morx-table.hh
+++ b/src/hb-aat-layout-morx-table.hh
@@ -207,13 +207,7 @@ struct ContextualSubtable
     {
       hb_buffer_t *buffer = driver->buffer;
 
-      if (entry->flags & SetMark)
-      {
-	mark = buffer->idx;
-	last_zero_before_mark = driver->last_zero;
-      }
-
-      if (entry->data.markIndex != 0xFFFF)
+      if (entry->data.markIndex != 0xFFFF && mark < buffer->len)
       {
 	const Lookup<GlyphID> &lookup = subs[entry->data.markIndex];
 	hb_glyph_info_t *info = buffer->info;
@@ -225,7 +219,7 @@ struct ContextualSubtable
 	  ret = true;
 	}
       }
-      if (entry->data.currentIndex != 0xFFFF)
+      if (entry->data.currentIndex != 0xFFFF && buffer->idx < buffer->len)
       {
 	const Lookup<GlyphID> &lookup = subs[entry->data.currentIndex];
 	hb_glyph_info_t *info = buffer->info;
@@ -238,6 +232,12 @@ struct ContextualSubtable
 	}
       }
 
+      if (entry->flags & SetMark)
+      {
+	mark = buffer->idx;
+	last_zero_before_mark = driver->last_zero;
+      }
+
       return true;
     }
 
commit fe5f9b1ae318939eaa23d0175a5eb7e1739177ac
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Fri Feb 2 15:53:25 2018 -0500

    [aat] Fix ContextualSubtable sanitization
    
    Fixes MORX-18, MORX-19, and MORX-22.

diff --git a/src/hb-aat-layout-morx-table.hh b/src/hb-aat-layout-morx-table.hh
index c64dca06..7a45a24e 100644
--- a/src/hb-aat-layout-morx-table.hh
+++ b/src/hb-aat-layout-morx-table.hh
@@ -275,8 +275,10 @@ struct ContextualSubtable
     {
       const EntryData &data = entries[i].data;
 
-      num_lookups = MAX<unsigned int> (num_lookups, 1 + data.markIndex);
-      num_lookups = MAX<unsigned int> (num_lookups, 1 + data.currentIndex);
+      if (data.markIndex != 0xFFFF)
+	num_lookups = MAX<unsigned int> (num_lookups, 1 + data.markIndex);
+      if (data.currentIndex != 0xFFFF)
+	num_lookups = MAX<unsigned int> (num_lookups, 1 + data.currentIndex);
     }
 
     return_trace (substitutionTables.sanitize (c, this, num_lookups));
commit cf943f682bcdd73e3ad1f6108c1a1870b991d5e4
Author: Khaled Hosny <khaledhosny at eglug.org>
Date:   Sun Feb 4 12:05:12 2018 +0200

    Correctly show documentation build status
    
    Correctly show if building documentation is enabled or not in configure
    summary.
    
    Fixes https://github.com/harfbuzz/harfbuzz/issues/741

diff --git a/configure.ac b/configure.ac
index d799cab0..c2257eec 100644
--- a/configure.ac
+++ b/configure.ac
@@ -531,7 +531,7 @@ Platform shapers (not normally needed):
 	DirectWrite:		${have_directwrite}
 
 Other features:
-	Documentation:		${have_gtk_doc}
+	Documentation:		${enable_gtk_doc}
 	GObject bindings:	${have_gobject}
 	Introspection:		${have_introspection}
 ])
commit e8859fca3eafb5aab6d029563b31219ccca0d673
Author: Bruce Mitchener <bruce.mitchener at gmail.com>
Date:   Sun Feb 4 01:26:57 2018 +0700

    Enable use of atexit() on macOS and related platforms.
    
    The atexit() man page indicates that this is expected to behave
    in the expected way on unloading of shared libraries.

diff --git a/src/hb-private.hh b/src/hb-private.hh
index 62c9fb27..eba797cf 100644
--- a/src/hb-private.hh
+++ b/src/hb-private.hh
@@ -221,6 +221,12 @@ static int errno = 0; /* Use something better? */
  * https://developer.android.com/tools/sdk/ndk/index.html
  */
 #    define HB_USE_ATEXIT 1
+#  elif defined(__APPLE__)
+/* For macOS and related platforms, the atexit man page indicates
+ * that it will be invoked when the library is unloaded, not only
+ * at application exit.
+ */
+#    define HB_USE_ATEXIT 1
 #  endif
 #endif
 
commit a89573770b4c0f9c444ad6499bec5dc022087a97
Author: Bruce Mitchener <bruce.mitchener at gmail.com>
Date:   Sun Feb 4 01:31:53 2018 +0700

    Use nullptr, not NULL.

diff --git a/src/hb-aat-layout-common-private.hh b/src/hb-aat-layout-common-private.hh
index b5395bba..1ea8318f 100644
--- a/src/hb-aat-layout-common-private.hh
+++ b/src/hb-aat-layout-common-private.hh
@@ -120,7 +120,7 @@ struct BinSearchArrayOf
       else
 	return p;
     }
-    return NULL;
+    return nullptr;
   }
 
   private:
diff --git a/src/hb-buffer-deserialize-json.rl b/src/hb-buffer-deserialize-json.rl
index 91b350f5..0f7d48ee 100644
--- a/src/hb-buffer-deserialize-json.rl
+++ b/src/hb-buffer-deserialize-json.rl
@@ -106,7 +106,7 @@ _hb_buffer_deserialize_glyphs_json (hb_buffer_t *buffer,
   const char *p = buf, *pe = buf + buf_len;
 
   /* Ensure we have positions. */
-  (void) hb_buffer_get_glyph_positions (buffer, NULL);
+  (void) hb_buffer_get_glyph_positions (buffer, nullptr);
 
   while (p < pe && ISSPACE (*p))
     p++;
@@ -115,7 +115,7 @@ _hb_buffer_deserialize_glyphs_json (hb_buffer_t *buffer,
     *end_ptr = ++p;
   }
 
-  const char *tok = NULL;
+  const char *tok = nullptr;
   int cs;
   hb_glyph_info_t info = {0};
   hb_glyph_position_t pos = {0};
diff --git a/src/hb-buffer-deserialize-text.rl b/src/hb-buffer-deserialize-text.rl
index 8a682f73..fd9be42d 100644
--- a/src/hb-buffer-deserialize-text.rl
+++ b/src/hb-buffer-deserialize-text.rl
@@ -100,7 +100,7 @@ _hb_buffer_deserialize_glyphs_text (hb_buffer_t *buffer,
   const char *p = buf, *pe = buf + buf_len;
 
   /* Ensure we have positions. */
-  (void) hb_buffer_get_glyph_positions (buffer, NULL);
+  (void) hb_buffer_get_glyph_positions (buffer, nullptr);
 
   while (p < pe && ISSPACE (*p))
     p++;
@@ -109,7 +109,7 @@ _hb_buffer_deserialize_glyphs_text (hb_buffer_t *buffer,
     *end_ptr = ++p;
   }
 
-  const char *eof = pe, *tok = NULL;
+  const char *eof = pe, *tok = nullptr;
   int cs;
   hb_glyph_info_t info = {0};
   hb_glyph_position_t pos = {0};
commit 07885e65adf1d3cb324de99501f9867f1a2553f8
Author: Ebrahim Byagowi <ebrahim at gnu.org>
Date:   Sat Feb 3 12:53:48 2018 +0330

    [cmake] unistd typo fix (#747)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3a593666..9e067edf 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -91,6 +91,7 @@ add_definitions(-DHAVE_OT)
 add_definitions(-DHAVE_FALLBACK)
 
 
+## Functions and headers
 include (CheckFunctionExists)
 include (CheckIncludeFile)
 macro (check_funcs) # Similar to AC_CHECK_FUNCS of autotools
@@ -102,16 +103,15 @@ macro (check_funcs) # Similar to AC_CHECK_FUNCS of autotools
     endif ()
   endforeach ()
 endmacro ()
-check_funcs(atexit mprotect sysconf mmap strtod_l) #TODO: getpagesize newlocale isatty
-
-check_include_file(unistd.h HAVE_UNIST_H)
-if (${HAVE_UNIST_H})
-  add_definitions(-DHAVE_UNIST_H)
+check_funcs(atexit mprotect sysconf getpagesize mmap isatty newlocale strtod_l)
+check_include_file(unistd.h HAVE_UNISTD_H)
+if (${HAVE_UNISTD_H})
+  add_definitions(-DHAVE_UNISTD_H)
+endif ()
+check_include_file(sys/mman.h HAVE_SYS_MMAN_H)
+if (${HAVE_SYS_MMAN_H})
+  add_definitions(-DHAVE_SYS_MMAN_H)
 endif ()
-#check_include_file(sys/mman.h HAVE_SYS_MMAN_H)
-#if (${HAVE_SYS_MMAN_H})
-#  add_definitions(-DHAVE_SYS_MMAN_H)
-#endif ()
 check_include_file(xlocale.h HAVE_XLOCALE_H)
 if (${HAVE_XLOCALE_H})
   add_definitions(-DHAVE_XLOCALE_H)


More information about the HarfBuzz mailing list