diff --git a/docs/harfbuzz-sections.txt b/docs/harfbuzz-sections.txt index f012fbdbb..16b662777 100644 --- a/docs/harfbuzz-sections.txt +++ b/docs/harfbuzz-sections.txt @@ -225,6 +225,7 @@ hb_font_get_face hb_font_get_glyph hb_font_get_glyph_advance_for_direction hb_font_get_glyph_advance_func_t +hb_font_get_glyph_advances_for_direction hb_font_get_glyph_contour_point hb_font_get_glyph_contour_point_for_origin hb_font_get_glyph_contour_point_func_t diff --git a/src/hb-font-private.hh b/src/hb-font-private.hh index c1981dda5..d3a413802 100644 --- a/src/hb-font-private.hh +++ b/src/hb-font-private.hh @@ -376,6 +376,18 @@ struct hb_font_t else *y = get_glyph_v_advance (glyph); } + inline void get_glyph_advances_for_direction (hb_direction_t direction, + unsigned count, + hb_codepoint_t *first_glyph, + unsigned glyph_stride, + hb_position_t *first_advance, + unsigned advance_stride) + { + if (likely (HB_DIRECTION_IS_HORIZONTAL (direction))) + get_glyph_h_advances (count, first_glyph, glyph_stride, first_advance, advance_stride); + else + get_glyph_v_advances (count, first_glyph, glyph_stride, first_advance, advance_stride); + } inline void guess_v_origin_minus_h_origin (hb_codepoint_t glyph, hb_position_t *x, hb_position_t *y) diff --git a/src/hb-font.cc b/src/hb-font.cc index 6b6ace849..77c0617a1 100644 --- a/src/hb-font.cc +++ b/src/hb-font.cc @@ -1024,6 +1024,26 @@ hb_font_get_glyph_advance_for_direction (hb_font_t *font, { return font->get_glyph_advance_for_direction (glyph, direction, x, y); } +/** + * hb_font_get_glyph_advances_for_direction: + * @font: a font. + * @direction: + * + * + * + * Since: REPLACEME + **/ +HB_EXTERN void +hb_font_get_glyph_advances_for_direction (hb_font_t* font, + hb_direction_t direction, + unsigned count, + hb_codepoint_t *first_glyph, + unsigned glyph_stride, + hb_position_t *first_advance, + unsigned advance_stride) +{ + font->get_glyph_advances_for_direction (direction, count, first_glyph, glyph_stride, first_advance, advance_stride); +} /** * hb_font_get_glyph_origin_for_direction: diff --git a/src/hb-font.h b/src/hb-font.h index 37c9a6717..cd2115330 100644 --- a/src/hb-font.h +++ b/src/hb-font.h @@ -529,6 +529,14 @@ hb_font_get_glyph_advance_for_direction (hb_font_t *font, hb_direction_t direction, hb_position_t *x, hb_position_t *y); HB_EXTERN void +hb_font_get_glyph_advances_for_direction (hb_font_t* font, + hb_direction_t direction, + unsigned count, + hb_codepoint_t *first_glyph, + unsigned glyph_stride, + hb_position_t *first_advance, + unsigned advance_stride); +HB_EXTERN void hb_font_get_glyph_origin_for_direction (hb_font_t *font, hb_codepoint_t glyph, hb_direction_t direction,