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

Behdad Esfahbod behdad at kemper.freedesktop.org
Tue Oct 16 20:01:35 UTC 2018


 src/hb-aat-layout-kerx-table.hh |    1 
 src/hb-vector.hh                |   11 ++-----
 test/api/CMakeLists.txt         |    2 -
 test/api/Makefile.am            |    2 -
 test/api/test-multithread.c     |    6 ++--
 test/api/test-ot-name.c         |   58 ++++++++++++++++++++--------------------
 6 files changed, 39 insertions(+), 41 deletions(-)

New commits:
commit de0b9a466490c2c13d6ec6f59d5122b0a87d3180
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Mon Oct 15 22:20:26 2018 -0700

    [vector] More of the same

diff --git a/src/hb-vector.hh b/src/hb-vector.hh
index 38d08cb7..9c2f7249 100644
--- a/src/hb-vector.hh
+++ b/src/hb-vector.hh
@@ -184,9 +184,9 @@ struct hb_vector_t
     ::qsort (arrayZ(), len, sizeof (Type), cmp);
   }
 
-  inline void qsort (unsigned int start, unsigned int end)
+  inline void qsort (unsigned int start, unsigned int end, int (*cmp)(const void*, const void*) = Type::cmp)
   {
-    ::qsort (arrayZ() + start, end - start, sizeof (Type), Type::cmp);
+    ::qsort (arrayZ() + start, end - start, sizeof (Type), cmp);
   }
 
   template <typename T>
commit 921f0e6ec722940a1e37660e1291aa69f9f39db8
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Mon Oct 15 22:19:17 2018 -0700

    [vector] Simplify sort
    
    Hopefully this fits fine with SFINAE with all our compilers.

diff --git a/src/hb-vector.hh b/src/hb-vector.hh
index 766e5fb8..38d08cb7 100644
--- a/src/hb-vector.hh
+++ b/src/hb-vector.hh
@@ -179,16 +179,11 @@ struct hb_vector_t
     return nullptr;
   }
 
-  inline void qsort (int (*cmp)(const void*, const void*))
+  inline void qsort (int (*cmp)(const void*, const void*) = Type::cmp)
   {
     ::qsort (arrayZ(), len, sizeof (Type), cmp);
   }
 
-  inline void qsort (void)
-  {
-    ::qsort (arrayZ(), len, sizeof (Type), Type::cmp);
-  }
-
   inline void qsort (unsigned int start, unsigned int end)
   {
     ::qsort (arrayZ() + start, end - start, sizeof (Type), Type::cmp);
commit 61510b63c15e91d80e36a497260db0e2d6d36c66
Author: Ebrahim Byagowi <ebrahim at gnu.org>
Date:   Tue Oct 16 14:17:21 2018 +0330

    [test] Minor cleanup in test-multithread and test-ot-name (#1256)

diff --git a/test/api/CMakeLists.txt b/test/api/CMakeLists.txt
index 77cb3577..0c7337cb 100644
--- a/test/api/CMakeLists.txt
+++ b/test/api/CMakeLists.txt
@@ -4,7 +4,7 @@ if (HB_HAVE_GLIB)
 
   list (APPEND TEST_PROGS
     test-ot-color
-    test-ot-nameid
+    test-ot-name
     test-ot-tag
     test-c
     test-cplusplus
diff --git a/test/api/Makefile.am b/test/api/Makefile.am
index 0e3f9a40..bae01d2c 100644
--- a/test/api/Makefile.am
+++ b/test/api/Makefile.am
@@ -71,7 +71,7 @@ endif
 
 TEST_PROGS += \
 	test-ot-color \
-	test-ot-nameid \
+	test-ot-name \
 	test-ot-tag \
 	$(NULL)
 
diff --git a/test/api/test-multithread.c b/test/api/test-multithread.c
index b651b399..7b62a029 100644
--- a/test/api/test-multithread.c
+++ b/test/api/test-multithread.c
@@ -154,13 +154,15 @@ main (int argc, char **argv)
   hb_face_t *face = hb_face_create (blob, 0);
   font = hb_font_create (face);
 
-  hb_ot_font_set_funcs (font);
-
+  /* Fill the reference */
   ref_buffer = hb_buffer_create ();
   fill_the_buffer (ref_buffer);
 
+  /* Unnecessary, since version 2 it is ot-font by default */
+  hb_ot_font_set_funcs (font);
   test_body ();
 
+  /* Test hb-ft in multithread */
   hb_ft_font_set_funcs (font);
   test_body ();
 
diff --git a/test/api/test-ot-nameid.c b/test/api/test-ot-name.c
similarity index 92%
rename from test/api/test-ot-nameid.c
rename to test/api/test-ot-name.c
index 1205190d..477e67f0 100644
--- a/test/api/test-ot-nameid.c
+++ b/test/api/test-ot-name.c
@@ -23,35 +23,16 @@
  *
  */
 
-#include <hb.h>
+#include "hb-test.h"
+
 #include <hb-ot.h>
-#include <glib.h>
 
 static const char *font_path = "fonts/cv01.otf";
+static hb_face_t *face;
 
-int
-main (int argc, char **argv)
+static void
+test_ot_layout_feature_get_name_ids_and_characters ()
 {
-  g_test_init (&argc, &argv, NULL);
-
-#if GLIB_CHECK_VERSION(2,37,2)
-  gchar *default_path = g_test_build_filename (G_TEST_DIST, font_path, NULL);
-#else
-  gchar *default_path = g_strdup (font_path);
-#endif
-
-  hb_blob_t *blob;
-  hb_face_t *face;
-  hb_font_t *font;
-
-  char *path = argc > 1 && *argv[1] ? argv[1] : (char *) default_path;
-  blob = hb_blob_create_from_file (path);
-  if (hb_blob_get_length (blob) == 0)
-    g_error ("Font not found.");
-
-  face = hb_face_create (blob, 0);
-  font = hb_font_create (face);
-
   hb_tag_t cv01 = HB_TAG ('c','v','0','1');
   unsigned int feature_index;
   if (!hb_ot_layout_language_find_feature (face,
@@ -89,12 +70,33 @@ main (int argc, char **argv)
   g_assert (char_count == 2);
   g_assert (characters[0] == 10);
   g_assert (characters[1] == 24030);
+}
+
+int
+main (int argc, char **argv)
+{
+  g_test_init (&argc, &argv, NULL);
+
+#if GLIB_CHECK_VERSION(2,37,2)
+  gchar *default_path = g_test_build_filename (G_TEST_DIST, font_path, NULL);
+#else
+  gchar *default_path = g_strdup (font_path);
+#endif
+
+  hb_blob_t *blob;
+
+  char *path = argc > 1 && *argv[1] ? argv[1] : (char *) default_path;
+  blob = hb_blob_create_from_file (path);
+  if (hb_blob_get_length (blob) == 0)
+    g_error ("Font not found.");
 
-  hb_font_destroy (font);
+  face = hb_face_create (blob, 0);
+
+  hb_test_add (test_ot_layout_feature_get_name_ids_and_characters);
+
+  unsigned int result = hb_test_run ();
   hb_face_destroy (face);
   hb_blob_destroy (blob);
-
   g_free (default_path);
-
-  return 0;
+  return result;
 }
commit 42b75dc3a701b13665115e2a234bfa5dedafef3f
Author: Ebrahim Byagowi <ebrahim at gnu.org>
Date:   Tue Oct 16 10:58:09 2018 +0330

    [kerx] Minor, remove debug bit

diff --git a/src/hb-aat-layout-kerx-table.hh b/src/hb-aat-layout-kerx-table.hh
index 83077878..9ab8e136 100644
--- a/src/hb-aat-layout-kerx-table.hh
+++ b/src/hb-aat-layout-kerx-table.hh
@@ -513,7 +513,6 @@ struct KerxSubTableFormat6
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    printf ("%d\n", c->check_struct (this));
     return_trace (likely (c->check_struct (this) &&
 			  (is_long () ?
 			   (


More information about the HarfBuzz mailing list