diff --git a/docs/harfbuzz-sections.txt b/docs/harfbuzz-sections.txt index fe9b89c05..ef1b88da1 100644 --- a/docs/harfbuzz-sections.txt +++ b/docs/harfbuzz-sections.txt @@ -80,6 +80,7 @@ hb_buffer_set_user_data hb_buffer_get_user_data hb_buffer_get_glyph_infos hb_buffer_get_glyph_positions +hb_buffer_has_positions hb_buffer_get_invisible_glyph hb_buffer_set_invisible_glyph hb_buffer_set_replacement_codepoint diff --git a/src/hb-buffer.cc b/src/hb-buffer.cc index 4fadbb78d..9557eccc7 100644 --- a/src/hb-buffer.cc +++ b/src/hb-buffer.cc @@ -50,7 +50,7 @@ * Checks the equality of two #hb_segment_properties_t's. * * Return value: - * %true if all properties of @a equal those of @b, false otherwise. + * %true if all properties of @a equal those of @b, %false otherwise. * * Since: 0.9.7 **/ @@ -1404,6 +1404,25 @@ hb_buffer_get_glyph_positions (hb_buffer_t *buffer, return (hb_glyph_position_t *) buffer->pos; } +/** + * hb_buffer_has_positions: + * @buffer: an #hb_buffer_t. + * + * Returns whether @buffer has glyph position data. + * A buffer gains position data when hb_buffer_get_glyph_positions() is called on it, + * and cleared of position data when hb_buffer_clear_contents() is called. + * + * Return value: + * %true if the @buffer has position array, %false otherwise. + * + * Since: REPLACEME + **/ +HB_EXTERN hb_bool_t +hb_buffer_has_positions (hb_buffer_t *buffer) +{ + return buffer->have_positions; +} + /** * hb_glyph_info_get_glyph_flags: * @info: a #hb_glyph_info_t. diff --git a/src/hb-buffer.h b/src/hb-buffer.h index e20c879d8..19a89bb61 100644 --- a/src/hb-buffer.h +++ b/src/hb-buffer.h @@ -447,6 +447,9 @@ HB_EXTERN hb_glyph_position_t * hb_buffer_get_glyph_positions (hb_buffer_t *buffer, unsigned int *length); +HB_EXTERN hb_bool_t +hb_buffer_has_positions (hb_buffer_t *buffer); + HB_EXTERN void hb_buffer_normalize_glyphs (hb_buffer_t *buffer);