From 7b2a7dadd6c616bbfe1d8358700cab9cee88e584 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sun, 22 Jul 2012 23:58:55 -0400 Subject: [PATCH] [Indic] Merge clusters before sorting This should fix any instabilities in cluster formation that we were speculating may happen with surrounding syllables. Or most of it perhaps. --- src/hb-ot-shape-complex-indic.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/hb-ot-shape-complex-indic.cc b/src/hb-ot-shape-complex-indic.cc index 47acbdb09..580c6d631 100644 --- a/src/hb-ot-shape-complex-indic.cc +++ b/src/hb-ot-shape-complex-indic.cc @@ -681,6 +681,10 @@ initial_reordering_consonant_syllable (const hb_ot_map_t *map, hb_buffer_t *buff /* We do bubble-sort, skip malicious clusters attempts */ if (end - start < 64) { + /* Things are out-of-control for post base positions, they may shuffle + * around like crazy, so merge clusters. For pre-base stuff, we handle + * cluster issues in final reordering. */ + buffer->merge_clusters (base, end); /* Sit tight, rock 'n roll! */ hb_bubble_sort (info + start, end - start, compare_indic_order); /* Find base again */