From b70021f7c81a0ed08475b14b07291f662cd9f905 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 23 Jul 2012 20:18:17 -0400 Subject: [PATCH] When removing zero-width marks, don't remove ligatures If a mark ligated, it probably should NOT be removed. --- src/hb-ot-shape.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hb-ot-shape.cc b/src/hb-ot-shape.cc index b5485bd8a..3b1c1d7d2 100644 --- a/src/hb-ot-shape.cc +++ b/src/hb-ot-shape.cc @@ -29,6 +29,7 @@ #include "hb-ot-shape-private.hh" #include "hb-ot-shape-normalize-private.hh" +#include "hb-ot-layout-private.hh" #include "hb-font-private.hh" #include "hb-set-private.hh" @@ -378,15 +379,14 @@ hb_position_complex_fallback_visual (hb_ot_shape_context_t *c) static void hb_hide_zerowidth (hb_ot_shape_context_t *c) { - /* TODO Save the space character in the font? */ hb_codepoint_t space; if (!hb_font_get_glyph (c->font, ' ', 0, &space)) return; /* No point! */ unsigned int count = c->buffer->len; for (unsigned int i = 0; i < count; i++) - /* TODO Do this if no ligature was formed? */ - if (unlikely (_hb_glyph_info_is_zero_width (&c->buffer->info[i]))) { + if (unlikely (!is_a_ligature (c->buffer->info[i]) && + _hb_glyph_info_is_zero_width (&c->buffer->info[i]))) { c->buffer->info[i].codepoint = space; c->buffer->pos[i].x_advance = 0; c->buffer->pos[i].y_advance = 0;