diff --git a/src/hb-font.cc b/src/hb-font.cc index 40c7c90f1..cb74e59a9 100644 --- a/src/hb-font.cc +++ b/src/hb-font.cc @@ -170,6 +170,41 @@ hb_font_funcs_set_kerning_func (hb_font_funcs_t *ffuncs, } +hb_codepoint_t +hb_font_get_glyph (hb_font_t *font, hb_face_t *face, + hb_codepoint_t unicode, hb_codepoint_t variation_selector) +{ + return font->klass->get_glyph (font, face, font->user_data, + unicode, variation_selector); +} + +hb_bool_t +hb_font_get_contour_point (hb_font_t *font, hb_face_t *face, + unsigned int point_index, + hb_codepoint_t glyph, hb_position_t *x, hb_position_t *y) +{ + return font->klass->get_contour_point (font, face, font->user_data, + point_index, + glyph, x, y); +} + +void +hb_font_get_glyph_metrics (hb_font_t *font, hb_face_t *face, + hb_codepoint_t glyph, hb_glyph_metrics_t *metrics) +{ + /* TODO Zero metrics here? */ + return font->klass->get_glyph_metrics (font, face, font->user_data, + glyph, metrics); +} + +hb_position_t +hb_font_get_kerning (hb_font_t *font, hb_face_t *face, + hb_codepoint_t first_glyph, hb_codepoint_t second_glyph) +{ + return font->klass->get_kerning (font, face, font->user_data, + first_glyph, second_glyph); +} + /* * hb_face_t */ diff --git a/src/hb-font.h b/src/hb-font.h index a47b6017d..532d3f52e 100644 --- a/src/hb-font.h +++ b/src/hb-font.h @@ -130,6 +130,24 @@ hb_font_funcs_set_kerning_func (hb_font_funcs_t *ffuncs, hb_font_get_kerning_func_t kerning_func); +hb_codepoint_t +hb_font_get_glyph (hb_font_t *font, hb_face_t *face, + hb_codepoint_t unicode, hb_codepoint_t variation_selector); + +hb_bool_t +hb_font_get_contour_point (hb_font_t *font, hb_face_t *face, + unsigned int point_index, + hb_codepoint_t glyph, hb_position_t *x, hb_position_t *y); + +void +hb_font_get_glyph_metrics (hb_font_t *font, hb_face_t *face, + hb_codepoint_t glyph, hb_glyph_metrics_t *metrics); + +hb_position_t +hb_font_get_kerning (hb_font_t *font, hb_face_t *face, + hb_codepoint_t first_glyph, hb_codepoint_t second_glyph); + + /* * hb_font_t */ diff --git a/src/hb-shape.c b/src/hb-shape.c index 23391f9bb..58045ca6b 100644 --- a/src/hb-shape.c +++ b/src/hb-shape.c @@ -70,7 +70,7 @@ hb_shape (hb_font_t *font, /* natural direction analysis */ /* OT preprocess */ - map_glyphs (face, font, buffer); + map_glyphs (font, face, buffer); /* GSUB */ /* Default positioning */