From a3e04bee2c2fa648759a87e460db6b4f1b685586 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 16 Jul 2012 13:47:19 -0400 Subject: [PATCH] [Indic] Reorder virama only for old Indic spec --- src/hb-ot-shape-complex-indic.cc | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/hb-ot-shape-complex-indic.cc b/src/hb-ot-shape-complex-indic.cc index 3ebd23a04..1bc3d4b90 100644 --- a/src/hb-ot-shape-complex-indic.cc +++ b/src/hb-ot-shape-complex-indic.cc @@ -27,6 +27,18 @@ #include "hb-ot-shape-complex-indic-private.hh" #include "hb-ot-shape-private.hh" +#define OLD_INDIC_TAG(script) (((hb_tag_t) script) | 0x20000000) +#define IS_OLD_INDIC_TAG(tag) ( \ + (tag) == OLD_INDIC_TAG (HB_SCRIPT_BENGALI) || \ + (tag) == OLD_INDIC_TAG (HB_SCRIPT_DEVANAGARI) || \ + (tag) == OLD_INDIC_TAG (HB_SCRIPT_GUJARATI) || \ + (tag) == OLD_INDIC_TAG (HB_SCRIPT_GURMUKHI) || \ + (tag) == OLD_INDIC_TAG (HB_SCRIPT_KANNADA) || \ + (tag) == OLD_INDIC_TAG (HB_SCRIPT_MALAYALAM) || \ + (tag) == OLD_INDIC_TAG (HB_SCRIPT_ORIYA) || \ + (tag) == OLD_INDIC_TAG (HB_SCRIPT_TAMIL) || \ + (tag) == OLD_INDIC_TAG (HB_SCRIPT_TELUGU) \ + ) struct indic_options_t { int initialized : 1; @@ -405,8 +417,7 @@ initial_reordering_consonant_syllable (const hb_ot_map_t *map, hb_buffer_t *buff /* For old-style Indic script tags, move the first post-base Halant after * last consonant. */ - if ((map->get_chosen_script (0) & 0x000000FF) != '2') { - /* We should only do this for Indic scripts which have a version two I guess. */ + if (IS_OLD_INDIC_TAG (map->get_chosen_script (0))) { for (unsigned int i = base + 1; i < end; i++) if (info[i].indic_category() == OT_H) { unsigned int j;