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:
parent
02aeca985b
commit
3ca6c4ecc2
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue