From 2c372b80f6befad69e216e3f218b38640b8cc044 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 20 Jul 2012 13:37:48 -0400 Subject: [PATCH] [Indic] Better check for applying 'init' Specifically, don't apply 'init' if previous char is a joiner. Fixes some more of Bengali. --- src/hb-ot-shape-complex-indic.cc | 9 +-------- src/hb-private.hh | 3 ++- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/hb-ot-shape-complex-indic.cc b/src/hb-ot-shape-complex-indic.cc index bbb881e..42a7e8d 100644 --- a/src/hb-ot-shape-complex-indic.cc +++ b/src/hb-ot-shape-complex-indic.cc @@ -1101,14 +1101,7 @@ final_reordering_syllable (hb_buffer_t *buffer, if (info[start].indic_position () == POS_PRE_M && (!start || !(FLAG (_hb_glyph_info_get_general_category (&info[start - 1])) & - (FLAG (HB_UNICODE_GENERAL_CATEGORY_LOWERCASE_LETTER) | - FLAG (HB_UNICODE_GENERAL_CATEGORY_MODIFIER_LETTER) | - FLAG (HB_UNICODE_GENERAL_CATEGORY_OTHER_LETTER) | - FLAG (HB_UNICODE_GENERAL_CATEGORY_TITLECASE_LETTER) | - FLAG (HB_UNICODE_GENERAL_CATEGORY_UPPERCASE_LETTER) | - FLAG (HB_UNICODE_GENERAL_CATEGORY_SPACING_MARK) | - FLAG (HB_UNICODE_GENERAL_CATEGORY_ENCLOSING_MARK) | - FLAG (HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK))))) + FLAG_RANGE (HB_UNICODE_GENERAL_CATEGORY_FORMAT, HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK)))) info[start].mask |= init_mask; diff --git a/src/hb-private.hh b/src/hb-private.hh index 7b778b7..bdfd3f5 100644 --- a/src/hb-private.hh +++ b/src/hb-private.hh @@ -734,7 +734,8 @@ hb_in_range (T u, T lo, T hi) * For example, for testing "x ∈ {x1, x2, x3}" use: * (FLAG(x) & (FLAG(x1) | FLAG(x2) | FLAG(x3))) */ -#define FLAG(x) (1<<(x)) +#define FLAG(x) (ASSERT_STATIC_EXPR_ZERO((x) < 8 * sizeof(int)) + (1<<(x))) +#define FLAG_RANGE(x,y) (ASSERT_STATIC_EXPR_ZERO ((x) < (y)) + FLAG(y+1) - FLAG(x)) template inline void -- 2.7.4