From b8d76dd74e50d295918cc015e9d2a55e2bf6a461 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 17 May 2011 23:31:00 -0400 Subject: [PATCH] Vertical: Adjust origin in glyph_extents() and glyph_contour_point() The base for vertical is almost ready now. --- src/hb-font.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/hb-font.cc b/src/hb-font.cc index 55b80ee19..c2fbb94af 100644 --- a/src/hb-font.cc +++ b/src/hb-font.cc @@ -503,9 +503,10 @@ hb_font_get_glyph_extents_for_direction (hb_font_t *font, hb_bool_t ret = hb_font_get_glyph_extents (font, glyph, extents); if (ret) { - /* XXX Adjust origin */ - } else { - /* TODO Simulate using get_h_advance and font_extents? */ + hb_position_t origin_x, origin_y; + hb_font_get_glyph_origin_for_direction (font, glyph, direction, &origin_x, &origin_y); + extents->x_bearing += origin_x; + extents->y_bearing += origin_y; } } @@ -518,7 +519,10 @@ hb_font_get_glyph_contour_point_for_direction (hb_font_t *font, hb_bool_t ret = hb_font_get_glyph_contour_point (font, glyph, point_index, x, y); if (ret) { - /* XXX Adjust origin */ + hb_position_t origin_x, origin_y; + hb_font_get_glyph_origin_for_direction (font, glyph, direction, &origin_x, &origin_y); + *x += origin_x; + *y += origin_y; } return ret;