[HarfBuzz] harfbuzz-ng: Branch 'master' - 8 commits

Behdad Esfahbod behdad at kemper.freedesktop.org
Wed May 11 20:26:40 PDT 2011


 src/hb-font.cc      |   24 ++---
 src/hb-font.h       |   24 ++---
 src/hb-ft.cc        |   22 ++--
 src/test.cc         |    2 
 test/Makefile.am    |    1 
 test/test-buffer.c  |    2 
 test/test-font.c    |  237 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 test/test-object.c  |    4 
 test/test-unicode.c |    1 
 9 files changed, 278 insertions(+), 39 deletions(-)

New commits:
commit b46782780690e26a8221e2d63dd224159aebe413
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Wed May 11 23:25:28 2011 -0400

    [API] Remove const from font user_data

diff --git a/src/hb-font.cc b/src/hb-font.cc
index c289f14..a0485a5 100644
--- a/src/hb-font.cc
+++ b/src/hb-font.cc
@@ -43,12 +43,12 @@ HB_BEGIN_DECLS
 
 static hb_bool_t
 hb_font_get_contour_point_nil (hb_font_t *font HB_UNUSED,
-			       const void *font_data HB_UNUSED,
+			       void *font_data HB_UNUSED,
 			       hb_codepoint_t glyph,
 			       unsigned int point_index,
 			       hb_position_t *x,
 			       hb_position_t *y,
-			       const void *user_data HB_UNUSED)
+			       void *user_data HB_UNUSED)
 {
   if (font->parent) {
     hb_bool_t ret;
@@ -66,11 +66,11 @@ hb_font_get_contour_point_nil (hb_font_t *font HB_UNUSED,
 
 static void
 hb_font_get_glyph_advance_nil (hb_font_t *font HB_UNUSED,
-			       const void *font_data HB_UNUSED,
+			       void *font_data HB_UNUSED,
 			       hb_codepoint_t glyph,
 			       hb_position_t *x_advance,
 			       hb_position_t *y_advance,
-			       const void *user_data HB_UNUSED)
+			       void *user_data HB_UNUSED)
 {
   if (font->parent) {
     hb_font_get_glyph_advance (font->parent, glyph, x_advance, y_advance);
@@ -83,10 +83,10 @@ hb_font_get_glyph_advance_nil (hb_font_t *font HB_UNUSED,
 
 static void
 hb_font_get_glyph_extents_nil (hb_font_t *font HB_UNUSED,
-			       const void *font_data HB_UNUSED,
+			       void *font_data HB_UNUSED,
 			       hb_codepoint_t glyph,
 			       hb_glyph_extents_t *extents,
-			       const void *user_data HB_UNUSED)
+			       void *user_data HB_UNUSED)
 {
   if (font->parent) {
     hb_font_get_glyph_extents (font->parent, glyph, extents);
@@ -101,10 +101,10 @@ hb_font_get_glyph_extents_nil (hb_font_t *font HB_UNUSED,
 
 static hb_codepoint_t
 hb_font_get_glyph_nil (hb_font_t *font HB_UNUSED,
-		       const void *font_data HB_UNUSED,
+		       void *font_data HB_UNUSED,
 		       hb_codepoint_t unicode,
 		       hb_codepoint_t variation_selector,
-		       const void *user_data HB_UNUSED)
+		       void *user_data HB_UNUSED)
 {
   if (font->parent)
     return hb_font_get_glyph (font->parent, unicode, variation_selector);
@@ -114,12 +114,12 @@ hb_font_get_glyph_nil (hb_font_t *font HB_UNUSED,
 
 static void
 hb_font_get_kerning_nil (hb_font_t *font HB_UNUSED,
-			 const void *font_data HB_UNUSED,
+			 void *font_data HB_UNUSED,
 			 hb_codepoint_t first_glyph,
 			 hb_codepoint_t second_glyph,
 			 hb_position_t *x_kern,
 			 hb_position_t *y_kern,
-			 const void *user_data HB_UNUSED)
+			 void *user_data HB_UNUSED)
 {
   if (font->parent) {
     hb_font_get_kerning (font->parent, first_glyph, second_glyph, x_kern, y_kern);
diff --git a/src/hb-font.h b/src/hb-font.h
index 17e7f91..bb53f8f 100644
--- a/src/hb-font.h
+++ b/src/hb-font.h
@@ -128,25 +128,25 @@ typedef struct _hb_glyph_extents_t
 } hb_glyph_extents_t;
 
 
-typedef hb_bool_t (*hb_font_get_contour_point_func_t) (hb_font_t *font, const void *font_data,
+typedef hb_bool_t (*hb_font_get_contour_point_func_t) (hb_font_t *font, void *font_data,
 						       hb_codepoint_t glyph, unsigned int point_index,
 						       hb_position_t *x, hb_position_t *y,
-						       const void *user_data);
-typedef void (*hb_font_get_glyph_advance_func_t) (hb_font_t *font, const void *font_data,
+						       void *user_data);
+typedef void (*hb_font_get_glyph_advance_func_t) (hb_font_t *font, void *font_data,
 						  hb_codepoint_t glyph,
 						  hb_position_t *x_advance, hb_position_t *y_advance,
-						  const void *user_data);
-typedef void (*hb_font_get_glyph_extents_func_t) (hb_font_t *font, const void *font_data,
+						  void *user_data);
+typedef void (*hb_font_get_glyph_extents_func_t) (hb_font_t *font, void *font_data,
 						  hb_codepoint_t glyph,
 						  hb_glyph_extents_t *extents,
-						  const void *user_data);
-typedef hb_codepoint_t (*hb_font_get_glyph_func_t) (hb_font_t *font, const void *font_data,
+						  void *user_data);
+typedef hb_codepoint_t (*hb_font_get_glyph_func_t) (hb_font_t *font, void *font_data,
 						    hb_codepoint_t unicode, hb_codepoint_t variation_selector,
-						    const void *user_data);
-typedef void (*hb_font_get_kerning_func_t) (hb_font_t *font, const void *font_data,
+						    void *user_data);
+typedef void (*hb_font_get_kerning_func_t) (hb_font_t *font, void *font_data,
 					    hb_codepoint_t first_glyph, hb_codepoint_t second_glyph,
 					    hb_position_t *x_kern, hb_position_t *y_kern,
-					    const void *user_data);
+					    void *user_data);
 
 
 void
diff --git a/src/hb-ft.cc b/src/hb-ft.cc
index 3fe2365..a0c7521 100644
--- a/src/hb-ft.cc
+++ b/src/hb-ft.cc
@@ -38,12 +38,12 @@ HB_BEGIN_DECLS
 
 static hb_bool_t
 hb_ft_get_contour_point (hb_font_t *font HB_UNUSED,
-			 const void *font_data,
+			 void *font_data,
 			 hb_codepoint_t glyph,
 			 unsigned int point_index,
 			 hb_position_t *x,
 			 hb_position_t *y,
-			 const void *user_data HB_UNUSED)
+			 void *user_data HB_UNUSED)
 {
   FT_Face ft_face = (FT_Face) font_data;
   int load_flags = FT_LOAD_DEFAULT;
@@ -67,11 +67,11 @@ hb_ft_get_contour_point (hb_font_t *font HB_UNUSED,
 
 static void
 hb_ft_get_glyph_advance (hb_font_t *font HB_UNUSED,
-			 const void *font_data,
+			 void *font_data,
 			 hb_codepoint_t glyph,
 			 hb_position_t *x_advance,
 			 hb_position_t *y_advance,
-			 const void *user_data HB_UNUSED)
+			 void *user_data HB_UNUSED)
 {
   FT_Face ft_face = (FT_Face) font_data;
   int load_flags = FT_LOAD_DEFAULT;
@@ -87,10 +87,10 @@ hb_ft_get_glyph_advance (hb_font_t *font HB_UNUSED,
 
 static void
 hb_ft_get_glyph_extents (hb_font_t *font HB_UNUSED,
-			 const void *font_data,
+			 void *font_data,
 			 hb_codepoint_t glyph,
 			 hb_glyph_extents_t *extents,
-			 const void *user_data HB_UNUSED)
+			 void *user_data HB_UNUSED)
 {
   FT_Face ft_face = (FT_Face) font_data;
   int load_flags = FT_LOAD_DEFAULT;
@@ -109,10 +109,10 @@ hb_ft_get_glyph_extents (hb_font_t *font HB_UNUSED,
 
 static hb_codepoint_t
 hb_ft_get_glyph (hb_font_t *font HB_UNUSED,
-		 const void *font_data,
+		 void *font_data,
 		 hb_codepoint_t unicode,
 		 hb_codepoint_t variation_selector,
-		 const void *user_data HB_UNUSED)
+		 void *user_data HB_UNUSED)
 
 {
   FT_Face ft_face = (FT_Face) font_data;
@@ -130,12 +130,12 @@ hb_ft_get_glyph (hb_font_t *font HB_UNUSED,
 
 static void
 hb_ft_get_kerning (hb_font_t *font HB_UNUSED,
-		   const void *font_data,
+		   void *font_data,
 		   hb_codepoint_t first_glyph,
 		   hb_codepoint_t second_glyph,
 		   hb_position_t *x_kern,
 		   hb_position_t *y_kern,
-		   const void *user_data HB_UNUSED)
+		   void *user_data HB_UNUSED)
 {
   FT_Face ft_face = (FT_Face) font_data;
   FT_Vector kerning;
commit ea93e7b27ca04a1655d62bd1d18a32805994af44
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Wed May 11 23:22:55 2011 -0400

    [test/font] More tests

diff --git a/test/test-font.c b/test/test-font.c
index cfd299e..6063736 100644
--- a/test/test-font.c
+++ b/test/test-font.c
@@ -40,7 +40,37 @@ test_face_empty (void)
 }
 
 static void
-test_font_funcs_empty (void)
+free_up (void *user_data)
+{
+  int *freed = (int *) user_data;
+
+  g_assert (!*freed);
+
+  (*freed)++;
+}
+
+static hb_blob_t *
+get_table (hb_tag_t tag, void *user_data)
+{
+  return hb_blob_get_empty ();
+}
+
+static void
+test_face_fortables (void)
+{
+  hb_face_t *face;
+  int freed = 0;
+
+  face = hb_face_create_for_tables (get_table, &freed, free_up);
+  g_assert (!freed);
+
+  hb_face_destroy (face);
+  g_assert (freed);
+}
+
+
+static void
+test_fontfuncs_empty (void)
 {
   g_assert (hb_font_funcs_get_empty ());
   g_assert (hb_font_funcs_is_immutable (hb_font_funcs_get_empty ()));
@@ -191,8 +221,9 @@ main (int argc, char **argv)
   hb_test_init (&argc, &argv);
 
   hb_test_add (test_face_empty);
+  hb_test_add (test_face_fortables);
 
-  hb_test_add (test_font_funcs_empty);
+  hb_test_add (test_fontfuncs_empty);
 
   hb_test_add (test_font_empty);
   hb_test_add (test_font_properties);
@@ -200,7 +231,6 @@ main (int argc, char **argv)
   /*
    * hb_font_set_funcs
    * hb_font_funcs
-   * hb_face_create_for_tables
    */
 
   return hb_test_run();
commit cdb153175f8a1521cde112c65b173f548ca6ee5c
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Wed May 11 23:12:58 2011 -0400

    [test/font] More tests

diff --git a/test/test-font.c b/test/test-font.c
index e888838..cfd299e 100644
--- a/test/test-font.c
+++ b/test/test-font.c
@@ -67,6 +67,7 @@ test_font_properties (void)
   hb_blob_t *blob;
   hb_face_t *face;
   hb_font_t *font;
+  hb_font_t *subfont;
   int x_scale, y_scale;
   unsigned int x_ppem, y_ppem;
 
@@ -144,7 +145,44 @@ test_font_properties (void)
   g_assert_cmpint (y_ppem, ==, 19);
 
 
+  /* sub_font now */
+  subfont = hb_font_create_sub_font (font);
   hb_font_destroy (font);
+
+  g_assert (hb_font_get_parent (subfont) == font);
+  g_assert (hb_font_get_face (subfont) == face);
+
+  /* scale */
+  x_scale = y_scale = 13;
+  hb_font_get_scale (subfont, &x_scale, &y_scale);
+  g_assert_cmpint (x_scale, ==, 17);
+  g_assert_cmpint (y_scale, ==, 19);
+  hb_font_set_scale (subfont, 10, 12);
+  x_scale = y_scale = 13;
+  hb_font_get_scale (subfont, &x_scale, &y_scale);
+  g_assert_cmpint (x_scale, ==, 10);
+  g_assert_cmpint (y_scale, ==, 12);
+  x_scale = y_scale = 13;
+  hb_font_get_scale (font, &x_scale, &y_scale);
+  g_assert_cmpint (x_scale, ==, 17);
+  g_assert_cmpint (y_scale, ==, 19);
+
+  /* ppem */
+  x_ppem = y_ppem = 13;
+  hb_font_get_ppem (subfont, &x_ppem, &y_ppem);
+  g_assert_cmpint (x_ppem, ==, 17);
+  g_assert_cmpint (y_ppem, ==, 19);
+  hb_font_set_ppem (subfont, 10, 12);
+  x_ppem = y_ppem = 13;
+  hb_font_get_ppem (subfont, &x_ppem, &y_ppem);
+  g_assert_cmpint (x_ppem, ==, 10);
+  g_assert_cmpint (y_ppem, ==, 12);
+  x_ppem = y_ppem = 13;
+  hb_font_get_ppem (font, &x_ppem, &y_ppem);
+  g_assert_cmpint (x_ppem, ==, 17);
+  g_assert_cmpint (y_ppem, ==, 19);
+
+  hb_font_destroy (subfont);
 }
 
 int
@@ -159,5 +197,11 @@ main (int argc, char **argv)
   hb_test_add (test_font_empty);
   hb_test_add (test_font_properties);
 
+  /*
+   * hb_font_set_funcs
+   * hb_font_funcs
+   * hb_face_create_for_tables
+   */
+
   return hb_test_run();
 }
commit 74d9fa3d9ac226ed72702884e721ef94ecc48e22
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Wed May 11 23:07:47 2011 -0400

    [test/font] More get_empty() tests

diff --git a/test/test-font.c b/test/test-font.c
index bd2655b..e888838 100644
--- a/test/test-font.c
+++ b/test/test-font.c
@@ -35,6 +35,8 @@ test_face_empty (void)
   g_assert (hb_face_get_empty ());
   g_assert (hb_face_get_empty () == hb_face_create (hb_blob_get_empty (), 0));
   g_assert (hb_face_get_empty () == hb_face_create (NULL, 0));
+
+  g_assert (hb_face_reference_table (hb_face_get_empty (), HB_TAG('h','e','a','d')) == hb_blob_get_empty ());
 }
 
 static void
@@ -52,6 +54,9 @@ test_font_empty (void)
   g_assert (hb_font_get_empty () == hb_font_create (NULL));
   g_assert (hb_font_get_empty () == hb_font_create_sub_font (NULL));
   g_assert (hb_font_is_immutable (hb_font_get_empty ()));
+
+  g_assert (hb_font_get_face (hb_font_get_empty ()) == hb_face_get_empty ());
+  g_assert (hb_font_get_parent (hb_font_get_empty ()) == NULL);
 }
 
 static const char test_data[] = "test\0data";
commit db9f4eb4e004fadae9d540522d1d21c3bbe659b0
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Wed May 11 23:06:02 2011 -0400

    [test/font] Test get_face() / get_parent()

diff --git a/test/test-font.c b/test/test-font.c
index d75ae99..bd2655b 100644
--- a/test/test-font.c
+++ b/test/test-font.c
@@ -72,6 +72,10 @@ test_font_properties (void)
   hb_face_destroy (face);
 
 
+  g_assert (hb_font_get_face (font) == face);
+  g_assert (hb_font_get_parent (font) == NULL);
+
+
   /* Check scale */
 
   hb_font_get_scale (font, NULL, NULL);
commit 606923bb4304d5b9cf164745d657cba58949a80a
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Wed May 11 23:05:02 2011 -0400

    [test/font] Add test_font_properties()

diff --git a/test/test-font.c b/test/test-font.c
index 58a4493..d75ae99 100644
--- a/test/test-font.c
+++ b/test/test-font.c
@@ -54,6 +54,90 @@ test_font_empty (void)
   g_assert (hb_font_is_immutable (hb_font_get_empty ()));
 }
 
+static const char test_data[] = "test\0data";
+
+static void
+test_font_properties (void)
+{
+  hb_blob_t *blob;
+  hb_face_t *face;
+  hb_font_t *font;
+  int x_scale, y_scale;
+  unsigned int x_ppem, y_ppem;
+
+  blob = hb_blob_create (test_data, sizeof (test_data), HB_MEMORY_MODE_READONLY, NULL, NULL);
+  face = hb_face_create (blob, 0);
+  hb_blob_destroy (blob);
+  font = hb_font_create (face);
+  hb_face_destroy (face);
+
+
+  /* Check scale */
+
+  hb_font_get_scale (font, NULL, NULL);
+  x_scale = y_scale = 13;
+  hb_font_get_scale (font, &x_scale, NULL);
+  g_assert_cmpint (x_scale, ==, 0);
+  x_scale = y_scale = 13;
+  hb_font_get_scale (font, NULL, &y_scale);
+  g_assert_cmpint (y_scale, ==, 0);
+  x_scale = y_scale = 13;
+  hb_font_get_scale (font, &x_scale, &y_scale);
+  g_assert_cmpint (x_scale, ==, 0);
+  g_assert_cmpint (y_scale, ==, 0);
+
+  hb_font_set_scale (font, 17, 19);
+
+  x_scale = y_scale = 13;
+  hb_font_get_scale (font, &x_scale, &y_scale);
+  g_assert_cmpint (x_scale, ==, 17);
+  g_assert_cmpint (y_scale, ==, 19);
+
+
+  /* Check ppem */
+
+  hb_font_get_ppem (font, NULL, NULL);
+  x_ppem = y_ppem = 13;
+  hb_font_get_ppem (font, &x_ppem, NULL);
+  g_assert_cmpint (x_ppem, ==, 0);
+  x_ppem = y_ppem = 13;
+  hb_font_get_ppem (font, NULL, &y_ppem);
+  g_assert_cmpint (y_ppem, ==, 0);
+  x_ppem = y_ppem = 13;
+  hb_font_get_ppem (font, &x_ppem, &y_ppem);
+  g_assert_cmpint (x_ppem, ==, 0);
+  g_assert_cmpint (y_ppem, ==, 0);
+
+  hb_font_set_ppem (font, 17, 19);
+
+  x_ppem = y_ppem = 13;
+  hb_font_get_ppem (font, &x_ppem, &y_ppem);
+  g_assert_cmpint (x_ppem, ==, 17);
+  g_assert_cmpint (y_ppem, ==, 19);
+
+
+  /* Check immutable */
+
+  g_assert (!hb_font_is_immutable (font));
+  hb_font_make_immutable (font);
+  g_assert (hb_font_is_immutable (font));
+
+  hb_font_set_scale (font, 10, 12);
+  x_scale = y_scale = 13;
+  hb_font_get_scale (font, &x_scale, &y_scale);
+  g_assert_cmpint (x_scale, ==, 17);
+  g_assert_cmpint (y_scale, ==, 19);
+
+  hb_font_set_ppem (font, 10, 12);
+  x_ppem = y_ppem = 13;
+  hb_font_get_ppem (font, &x_ppem, &y_ppem);
+  g_assert_cmpint (x_ppem, ==, 17);
+  g_assert_cmpint (y_ppem, ==, 19);
+
+
+  hb_font_destroy (font);
+}
+
 int
 main (int argc, char **argv)
 {
@@ -64,6 +148,7 @@ main (int argc, char **argv)
   hb_test_add (test_font_funcs_empty);
 
   hb_test_add (test_font_empty);
+  hb_test_add (test_font_properties);
 
   return hb_test_run();
 }
commit da603e80386b41b360acb070a862b6ed87da57b8
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Wed May 11 22:52:35 2011 -0400

    [test/font] Start adding tests for hb-font.h

diff --git a/test/Makefile.am b/test/Makefile.am
index e58a91a..6956bba 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -15,6 +15,7 @@ TEST_PROGS += \
 	test-blob \
 	test-buffer \
 	test-common \
+	test-font \
 	test-object \
 	test-unicode \
 	$(NULL)
diff --git a/test/test-buffer.c b/test/test-buffer.c
index 0cbb8e0..6fba9e2 100644
--- a/test/test-buffer.c
+++ b/test/test-buffer.c
@@ -715,7 +715,7 @@ static void
 test_buffer_empty (void)
 {
   g_assert (hb_buffer_get_empty ());
-  g_assert (hb_buffer_create (-1) == hb_buffer_get_empty ());
+  g_assert (hb_buffer_get_empty () == hb_buffer_create (-1));
 }
 
 int
diff --git a/test/test-font.c b/test/test-font.c
new file mode 100644
index 0000000..58a4493
--- /dev/null
+++ b/test/test-font.c
@@ -0,0 +1,69 @@
+/*
+ * Copyright © 2011  Google, Inc.
+ *
+ *  This is part of HarfBuzz, a text shaping library.
+ *
+ * Permission is hereby granted, without written agreement and without
+ * license or royalty fees, to use, copy, modify, and distribute this
+ * software and its documentation for any purpose, provided that the
+ * above copyright notice and the following two paragraphs appear in
+ * all copies of this software.
+ *
+ * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
+ * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
+ * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
+ * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ *
+ * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
+ * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
+ * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
+ * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+ *
+ * Google Author(s): Behdad Esfahbod
+ */
+
+#include "hb-test.h"
+
+/* Unit tests for hb-font.h */
+
+
+static void
+test_face_empty (void)
+{
+  g_assert (hb_face_get_empty ());
+  g_assert (hb_face_get_empty () == hb_face_create (hb_blob_get_empty (), 0));
+  g_assert (hb_face_get_empty () == hb_face_create (NULL, 0));
+}
+
+static void
+test_font_funcs_empty (void)
+{
+  g_assert (hb_font_funcs_get_empty ());
+  g_assert (hb_font_funcs_is_immutable (hb_font_funcs_get_empty ()));
+}
+
+static void
+test_font_empty (void)
+{
+  g_assert (hb_font_get_empty ());
+  g_assert (hb_font_get_empty () == hb_font_create (hb_face_get_empty ()));
+  g_assert (hb_font_get_empty () == hb_font_create (NULL));
+  g_assert (hb_font_get_empty () == hb_font_create_sub_font (NULL));
+  g_assert (hb_font_is_immutable (hb_font_get_empty ()));
+}
+
+int
+main (int argc, char **argv)
+{
+  hb_test_init (&argc, &argv);
+
+  hb_test_add (test_face_empty);
+
+  hb_test_add (test_font_funcs_empty);
+
+  hb_test_add (test_font_empty);
+
+  return hb_test_run();
+}
diff --git a/test/test-unicode.c b/test/test-unicode.c
index 2e15e95..e163aba 100644
--- a/test/test-unicode.c
+++ b/test/test-unicode.c
@@ -555,6 +555,7 @@ test_unicode_properties_empty (void)
 {
   hb_unicode_funcs_t *uf = hb_unicode_funcs_get_empty ();
 
+  g_assert (uf);
   g_assert (hb_unicode_funcs_is_immutable (uf));
   _test_unicode_properties_nil (uf);
 }
commit 9a14688e40e926b9453fcb75891f27bff1e45c49
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Wed May 11 22:49:29 2011 -0400

    [API] Rename hb_face_create_for_data() to hb_face_create()

diff --git a/src/hb-font.cc b/src/hb-font.cc
index bb8f84c..c289f14 100644
--- a/src/hb-font.cc
+++ b/src/hb-font.cc
@@ -394,8 +394,8 @@ _hb_face_for_data_get_table (hb_tag_t tag, void *user_data)
 }
 
 hb_face_t *
-hb_face_create_for_data (hb_blob_t    *blob,
-			 unsigned int  index)
+hb_face_create (hb_blob_t    *blob,
+		unsigned int  index)
 {
   if (unlikely (!blob || !hb_blob_get_length (blob)))
     return &_hb_face_nil;
diff --git a/src/hb-font.h b/src/hb-font.h
index 7f05144..17e7f91 100644
--- a/src/hb-font.h
+++ b/src/hb-font.h
@@ -41,8 +41,8 @@ typedef struct _hb_font_t hb_font_t;
  */
 
 hb_face_t *
-hb_face_create_for_data (hb_blob_t    *blob,
-			 unsigned int  index);
+hb_face_create (hb_blob_t    *blob,
+		unsigned int  index);
 
 typedef hb_blob_t * (*hb_get_table_func_t)  (hb_tag_t tag, void *user_data);
 
diff --git a/src/hb-ft.cc b/src/hb-ft.cc
index 2566c05..3fe2365 100644
--- a/src/hb-ft.cc
+++ b/src/hb-ft.cc
@@ -212,7 +212,7 @@ hb_ft_face_create (FT_Face           ft_face,
 			   /* TODO: Check FT_FACE_FLAG_EXTERNAL_STREAM? */
 			   HB_MEMORY_MODE_READONLY_MAY_MAKE_WRITABLE,
 			   ft_face, destroy);
-    face = hb_face_create_for_data (blob, ft_face->face_index);
+    face = hb_face_create (blob, ft_face->face_index);
     hb_blob_destroy (blob);
   } else {
     face = hb_face_create_for_tables (get_table, ft_face, destroy);
diff --git a/src/test.cc b/src/test.cc
index 79d7841..e3747ce 100644
--- a/src/test.cc
+++ b/src/test.cc
@@ -86,7 +86,7 @@ main (int argc, char **argv)
   printf ("Opened font file %s: %u bytes long\n", argv[1], hb_blob_get_length (blob));
 
   /* Create the face */
-  face = hb_face_create_for_data (blob, 0 /* first face */);
+  face = hb_face_create (blob, 0 /* first face */);
 
   /* So, what now? */
 
diff --git a/test/test-object.c b/test/test-object.c
index 1ad3b88..ccd0cab 100644
--- a/test/test-object.c
+++ b/test/test-object.c
@@ -61,14 +61,14 @@ static void *
 create_face (void)
 {
   hb_blob_t *blob = (hb_blob_t *) create_blob ();
-  hb_face_t *face = hb_face_create_for_data (blob, 0);
+  hb_face_t *face = hb_face_create (blob, 0);
   hb_blob_destroy (blob);
   return face;
 }
 static void *
 create_face_inert (void)
 {
-  return hb_face_create_for_data (hb_blob_get_empty (), 0);
+  return hb_face_create (hb_blob_get_empty (), 0);
 }
 
 static void *



More information about the HarfBuzz mailing list