Change hb_shape() API back to what it was, add hb_shape_full()
authorBehdad Esfahbod <behdad@behdad.org>
Fri, 5 Aug 2011 21:22:19 +0000 (17:22 -0400)
committerBehdad Esfahbod <behdad@behdad.org>
Fri, 5 Aug 2011 21:22:19 +0000 (17:22 -0400)
I disliked changing hb_shape() API, and disliked the fact that it was
returning a bool now.  So, reverted.  Added new API for the extra
functionality.

src/hb-shape.cc
src/hb-shape.h
src/test.cc
test/test-shape.c

index 9ebbd81..18dc6c1 100644 (file)
@@ -87,12 +87,12 @@ static class static_shaper_list_t {
 } env_shaper_list;
 
 hb_bool_t
-hb_shape (hb_font_t           *font,
-         hb_buffer_t         *buffer,
-         const hb_feature_t  *features,
-         unsigned int         num_features,
-         const char          *shaper_options,
-         const char         **shaper_list)
+hb_shape_full (hb_font_t           *font,
+              hb_buffer_t         *buffer,
+              const hb_feature_t  *features,
+              unsigned int         num_features,
+              const char          *shaper_options,
+              const char         **shaper_list)
 {
   if (likely (!shaper_list))
     shaper_list = env_shaper_list.shaper_list;
@@ -116,3 +116,12 @@ hb_shape (hb_font_t           *font,
   }
   return FALSE;
 }
+
+void
+hb_shape (hb_font_t           *font,
+         hb_buffer_t         *buffer,
+         const hb_feature_t  *features,
+         unsigned int         num_features)
+{
+  hb_shape_full (font, buffer, features, num_features, NULL, NULL);
+}
index b2193f7..75818dc 100644 (file)
@@ -42,13 +42,19 @@ typedef struct _hb_feature_t {
 } hb_feature_t;
 
 
-hb_bool_t
+void
 hb_shape (hb_font_t           *font,
          hb_buffer_t         *buffer,
          const hb_feature_t  *features,
-         unsigned int         num_features,
-         const char          *shaper_options,
-         const char         **shaper_list);
+         unsigned int         num_features);
+
+hb_bool_t
+hb_shape_full (hb_font_t           *font,
+              hb_buffer_t         *buffer,
+              const hb_feature_t  *features,
+              unsigned int         num_features,
+              const char          *shaper_options,
+              const char         **shaper_list);
 
 
 HB_END_DECLS
index 8679b33..860e4d2 100644 (file)
@@ -96,7 +96,7 @@ main (int argc, char **argv)
 
   hb_buffer_add_utf8 (buffer, "test", 4, 0, 4);
 
-  hb_shape (font, buffer, NULL, 0, NULL, NULL);
+  hb_shape (font, buffer, NULL, 0);
 
   unsigned int count = hb_buffer_get_length (buffer);
   hb_glyph_info_t *infos = hb_buffer_get_glyph_infos (buffer, NULL);
index a8b7f1d..5a41f0c 100644 (file)
@@ -110,7 +110,7 @@ test_shape (void)
   hb_buffer_set_direction (buffer, HB_DIRECTION_LTR);
   hb_buffer_add_utf8 (buffer, TesT, 4, 0, 4);
 
-  hb_shape (font, buffer, NULL, 0, NULL, NULL);
+  hb_shape (font, buffer, NULL, 0);
 
   len = hb_buffer_get_length (buffer);
   glyphs = hb_buffer_get_glyph_infos (buffer, NULL);