Change hb_shape() API back to what it was, add hb_shape_full()

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.
This commit is contained in:
Behdad Esfahbod 2011-08-05 17:22:19 -04:00
parent 02aeca985b
commit 3ca6c4ecc2
4 changed files with 27 additions and 12 deletions

View 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);
}

View 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

View 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);

View 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);