From dcdc51cdc0ba9d9fb75f84dd5fa7a49aa0b24ea0 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 22 Jul 2011 17:14:46 -0400 Subject: [PATCH] Handle singleton decompositions --- src/hb-ot-shape-normalize.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/hb-ot-shape-normalize.cc b/src/hb-ot-shape-normalize.cc index 040371f..66afaa6 100644 --- a/src/hb-ot-shape-normalize.cc +++ b/src/hb-ot-shape-normalize.cc @@ -72,26 +72,28 @@ decompose (hb_ot_shape_context_t *c, hb_codepoint_t a, b, glyph; if (!hb_unicode_decompose (c->buffer->unicode, ab, &a, &b) || - !hb_font_get_glyph (c->font, b, 0, &glyph)) + (b && !hb_font_get_glyph (c->font, b, 0, &glyph))) return FALSE; - /* XXX handle singleton decompositions */ bool has_a = hb_font_get_glyph (c->font, a, 0, &glyph); if (shortest && has_a) { /* Output a and b */ c->buffer->output_glyph (a); - c->buffer->output_glyph (b); + if (b) + c->buffer->output_glyph (b); return TRUE; } if (decompose (c, shortest, a)) { - c->buffer->output_glyph (b); + if (b) + c->buffer->output_glyph (b); return TRUE; } if (has_a) { c->buffer->output_glyph (a); - c->buffer->output_glyph (b); + if (b) + c->buffer->output_glyph (b); return TRUE; } -- 2.7.4