From 28e2f467e1c7dd5e82d105efa8c4580dbfc93960 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 7 Aug 2018 09:47:00 -0700 Subject: [PATCH] Actually add hb_font_get_glyph_[hv]_advances New API: +hb_font_get_glyph_h_advances +hb_font_get_glyph_v_advances --- src/hb-font.cc | 37 +++++++++++++++++++++++++++++++++++++ src/hb-font.h | 15 +++++++++++++++ 2 files changed, 52 insertions(+) diff --git a/src/hb-font.cc b/src/hb-font.cc index e084de9b7..6b6ace849 100644 --- a/src/hb-font.cc +++ b/src/hb-font.cc @@ -783,6 +783,43 @@ hb_font_get_glyph_v_advance (hb_font_t *font, return font->get_glyph_v_advance (glyph); } +/** + * hb_font_get_glyph_h_advances: + * @font: a font. + * + * + * + * Since: REPLACEME + **/ +void +hb_font_get_glyph_h_advances (hb_font_t* font, + unsigned count, + hb_codepoint_t *first_glyph, + unsigned glyph_stride, + hb_position_t *first_advance, + unsigned advance_stride) +{ + font->get_glyph_h_advances (count, first_glyph, glyph_stride, first_advance, advance_stride); +} +/** + * hb_font_get_glyph_v_advances: + * @font: a font. + * + * + * + * Since: REPLACEME + **/ +void +hb_font_get_glyph_v_advances (hb_font_t* font, + unsigned count, + hb_codepoint_t *first_glyph, + unsigned glyph_stride, + hb_position_t *first_advance, + unsigned advance_stride) +{ + font->get_glyph_v_advances (count, first_glyph, glyph_stride, first_advance, advance_stride); +} + /** * hb_font_get_glyph_h_origin: * @font: a font. diff --git a/src/hb-font.h b/src/hb-font.h index 181d15ee3..37c9a6717 100644 --- a/src/hb-font.h +++ b/src/hb-font.h @@ -459,6 +459,21 @@ HB_EXTERN hb_position_t hb_font_get_glyph_v_advance (hb_font_t *font, hb_codepoint_t glyph); +HB_EXTERN void +hb_font_get_glyph_h_advances (hb_font_t* font, + 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_v_advances (hb_font_t* font, + unsigned count, + hb_codepoint_t *first_glyph, + unsigned glyph_stride, + hb_position_t *first_advance, + unsigned advance_stride); + HB_EXTERN hb_bool_t hb_font_get_glyph_h_origin (hb_font_t *font, hb_codepoint_t glyph,