From 1b8196c98638ba05ae0ebcb8ba7aa99ed9c08e0a Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 9 Aug 2011 11:37:46 +0200 Subject: [PATCH] Add fallback shaper --- src/hb-fallback-shape.cc | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/hb-fallback-shape.cc b/src/hb-fallback-shape.cc index 6c3200d07..0462400b3 100644 --- a/src/hb-fallback-shape.cc +++ b/src/hb-fallback-shape.cc @@ -37,7 +37,26 @@ hb_fallback_shape (hb_font_t *font, { buffer->guess_properties (); + unsigned int count = buffer->len; + + for (unsigned int i = 0; i < count; i++) + hb_font_get_glyph (font, buffer->info[i].codepoint, 0, &buffer->info[i].codepoint); + + buffer->clear_positions (); + + for (unsigned int i = 0; i < count; i++) { + hb_font_get_glyph_advance_for_direction (font, buffer->info[i].codepoint, + buffer->props.direction, + &buffer->pos[i].x_advance, + &buffer->pos[i].y_advance); + hb_font_subtract_glyph_origin_for_direction (font, buffer->info[i].codepoint, + buffer->props.direction, + &buffer->pos[i].x_offset, + &buffer->pos[i].y_offset); + } + + if (HB_DIRECTION_IS_BACKWARD (buffer->props.direction)) + hb_buffer_reverse (buffer); + return TRUE; } - -