From 6da9dbff21b47fb10794b8d6cb747393c9eab7dd Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 8 Jun 2012 10:53:35 -0400 Subject: [PATCH] Remove zero-width chars in the fallback shaper too --- src/hb-fallback-shape.cc | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/hb-fallback-shape.cc b/src/hb-fallback-shape.cc index 593988792..b9480e6a4 100644 --- a/src/hb-fallback-shape.cc +++ b/src/hb-fallback-shape.cc @@ -34,16 +34,24 @@ _hb_fallback_shape (hb_font_t *font, const hb_feature_t *features HB_UNUSED, unsigned int num_features HB_UNUSED) { + /* TODO Save the space character in the font? */ + hb_codepoint_t space; + hb_font_get_glyph (font, ' ', 0, &space); + buffer->guess_properties (); + buffer->clear_positions (); unsigned int count = buffer->len; for (unsigned int i = 0; i < count; i++) + { + if (_hb_unicode_is_zero_width (buffer->info[i].codepoint)) { + buffer->info[i].codepoint = space; + buffer->pos[i].x_advance = 0; + buffer->pos[i].y_advance = 0; + continue; + } 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,