From dd89d958c139d85efb776fffaf314eead3952c78 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 21 Jul 2011 00:28:57 -0400 Subject: [PATCH] Fix cluster calculation for non-LTR text --- TODO | 6 ------ src/hb-buffer.cc | 5 +++++ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/TODO b/TODO index e15e295f5..04852c695 100644 --- a/TODO +++ b/TODO @@ -1,12 +1,6 @@ General fixes: ============= -- Instead of forming clusters immediately, only do it if we are reversing - the text. We'd need a separate bit to indicate cluster start then. - -- Right now, BTW, for non-native direction runs, we get the cluster wrong... - Should do min(input-glyphs.cluster) - - Fix TT 'kern' on/off and GPOS interaction (move kerning before GPOS) - Do proper rounding when scaling from font space? diff --git a/src/hb-buffer.cc b/src/hb-buffer.cc index 0c16303ee..b65ddbb4c 100644 --- a/src/hb-buffer.cc +++ b/src/hb-buffer.cc @@ -386,6 +386,11 @@ _hb_buffer_replace_glyphs_be16 (hb_buffer_t *buffer, } hb_glyph_info_t orig_info = buffer->info[buffer->i]; + for (unsigned int i = 1; i < num_in; i++) + { + hb_glyph_info_t *info = &buffer->info[buffer->i + i]; + orig_info.cluster = MIN (orig_info.cluster, info->cluster); + } for (unsigned int i = 0; i < num_out; i++) {