From 1883af3796459cafe2d194064403b6b1152c584d Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 16 May 2011 15:18:16 -0400 Subject: [PATCH] [hb-view] Start work on vertical support --- src/hb-view.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/hb-view.cc b/src/hb-view.cc index 76ee4d9..35d8a5f 100644 --- a/src/hb-view.cc +++ b/src/hb-view.cc @@ -350,7 +350,7 @@ _hb_cr_text_glyphs (cairo_t *cr, hb_glyph_info_t *hb_glyph; hb_glyph_position_t *hb_position; unsigned int num_glyphs, i; - hb_position_t x; + hb_position_t x, y; hb_buffer = hb_buffer_create (0); @@ -372,12 +372,14 @@ _hb_cr_text_glyphs (cairo_t *cr, hb_position = hb_buffer_get_glyph_positions (hb_buffer, NULL); cairo_glyphs = cairo_glyph_allocate (num_glyphs); x = 0; + y = 0; for (i = 0; i < num_glyphs; i++) { cairo_glyphs[i].index = hb_glyph->codepoint; - cairo_glyphs[i].x = (hb_position->x_offset + x) * (1./64); - cairo_glyphs[i].y = -(hb_position->y_offset) * (1./64); - x += hb_position->x_advance; + cairo_glyphs[i].x = ( hb_position->x_offset + x) * (1./64); + cairo_glyphs[i].y = (-hb_position->y_offset + y) * (1./64); + x += hb_position->x_advance; + y += -hb_position->y_advance; hb_glyph++; hb_position++; -- 2.7.4