From 2e336692913405976392bf505028481a5caa53b4 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 5 Nov 2009 13:55:41 -0500 Subject: [PATCH] Add hb_font_get_* --- src/hb-font.cc | 35 +++++++++++++++++++++++++++++++++++ src/hb-font.h | 18 ++++++++++++++++++ src/hb-shape.c | 2 +- 3 files changed, 54 insertions(+), 1 deletion(-) diff --git a/src/hb-font.cc b/src/hb-font.cc index 40c7c90..cb74e59 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 a47b601..532d3f5 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 23391f9..58045ca 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 */ -- 2.7.4