[buffer] Add hb_buffer_has_positions()

Fixes https://github.com/harfbuzz/harfbuzz/issues/2716
pull/2720/head
Behdad Esfahbod 4 years ago
parent 97a093c52f
commit 3232e6f2a9
  1. 1
      docs/harfbuzz-sections.txt
  2. 21
      src/hb-buffer.cc
  3. 3
      src/hb-buffer.h

@ -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

@ -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.

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

Loading…
Cancel
Save