From 422e08dbb8e2c0c5664f1bdc7e159a673cfea8c5 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 15 Jun 2011 17:22:48 -0400 Subject: [PATCH] Better categorize Indic character classes Matches OT types now. --- src/hb-ot-shape-complex-indic.cc | 51 ++++++++++++++++++++------------ 1 file changed, 32 insertions(+), 19 deletions(-) diff --git a/src/hb-ot-shape-complex-indic.cc b/src/hb-ot-shape-complex-indic.cc index 07ec95bc7..c79d0fc6f 100644 --- a/src/hb-ot-shape-complex-indic.cc +++ b/src/hb-ot-shape-complex-indic.cc @@ -57,7 +57,7 @@ enum { enum indic_syllabic_category_t { INDIC_SYLLABIC_CATEGORY_OTHER = OT_X, - INDIC_SYLLABIC_CATEGORY_AVAGRAHA = OT_SM, + INDIC_SYLLABIC_CATEGORY_AVAGRAHA = OT_X, INDIC_SYLLABIC_CATEGORY_BINDU = OT_SM, INDIC_SYLLABIC_CATEGORY_CONSONANT = OT_C, INDIC_SYLLABIC_CATEGORY_CONSONANT_DEAD = OT_C, @@ -67,11 +67,11 @@ enum indic_syllabic_category_t { INDIC_SYLLABIC_CATEGORY_CONSONANT_PLACEHOLDER = OT_NBSP, INDIC_SYLLABIC_CATEGORY_CONSONANT_SUBJOINED = OT_C, INDIC_SYLLABIC_CATEGORY_CONSONANT_REPHA = OT_C, - INDIC_SYLLABIC_CATEGORY_MODIFYING_LETTER = OT_SM, + INDIC_SYLLABIC_CATEGORY_MODIFYING_LETTER = OT_X, INDIC_SYLLABIC_CATEGORY_NUKTA = OT_N, - INDIC_SYLLABIC_CATEGORY_REGISTER_SHIFTER = OT_SM, - INDIC_SYLLABIC_CATEGORY_TONE_LETTER = OT_V, - INDIC_SYLLABIC_CATEGORY_TONE_MARK = OT_M, + INDIC_SYLLABIC_CATEGORY_REGISTER_SHIFTER = OT_X, + INDIC_SYLLABIC_CATEGORY_TONE_LETTER = OT_X, + INDIC_SYLLABIC_CATEGORY_TONE_MARK = OT_X, INDIC_SYLLABIC_CATEGORY_VIRAMA = OT_H, INDIC_SYLLABIC_CATEGORY_VISARGA = OT_SM, INDIC_SYLLABIC_CATEGORY_VOWEL = OT_V, @@ -83,20 +83,33 @@ enum indic_syllabic_category_t { enum indic_matra_category_t { INDIC_MATRA_CATEGORY_NOT_APPLICABLE = 0, - INDIC_MATRA_CATEGORY_BOTTOM, - INDIC_MATRA_CATEGORY_BOTTOM_AND_RIGHT, - INDIC_MATRA_CATEGORY_INVISIBLE, - INDIC_MATRA_CATEGORY_LEFT, - INDIC_MATRA_CATEGORY_LEFT_AND_RIGHT, - INDIC_MATRA_CATEGORY_OVERSTRUCK, - INDIC_MATRA_CATEGORY_RIGHT, - INDIC_MATRA_CATEGORY_TOP, - INDIC_MATRA_CATEGORY_TOP_AND_BOTTOM, - INDIC_MATRA_CATEGORY_TOP_AND_BOTTOM_AND_RIGHT, - INDIC_MATRA_CATEGORY_TOP_AND_LEFT, - INDIC_MATRA_CATEGORY_TOP_AND_LEFT_AND_RIGHT, - INDIC_MATRA_CATEGORY_TOP_AND_RIGHT, - INDIC_MATRA_CATEGORY_VISUAL_ORDER_LEFT + INDIC_MATRA_CATEGORY_LEFT = 0x01, + INDIC_MATRA_CATEGORY_TOP = 0x02, + INDIC_MATRA_CATEGORY_BOTTOM = 0x04, + INDIC_MATRA_CATEGORY_RIGHT = 0x08, + + /* We don't really care much about these since we decompose them + * in the generic pre-shaping layer. */ + INDIC_MATRA_CATEGORY_BOTTOM_AND_RIGHT = INDIC_MATRA_CATEGORY_BOTTOM + + INDIC_MATRA_CATEGORY_RIGHT, + INDIC_MATRA_CATEGORY_LEFT_AND_RIGHT = INDIC_MATRA_CATEGORY_LEFT + + INDIC_MATRA_CATEGORY_RIGHT, + INDIC_MATRA_CATEGORY_TOP_AND_BOTTOM = INDIC_MATRA_CATEGORY_TOP + + INDIC_MATRA_CATEGORY_BOTTOM, + INDIC_MATRA_CATEGORY_TOP_AND_BOTTOM_AND_RIGHT = INDIC_MATRA_CATEGORY_TOP + + INDIC_MATRA_CATEGORY_BOTTOM + + INDIC_MATRA_CATEGORY_RIGHT, + INDIC_MATRA_CATEGORY_TOP_AND_LEFT = INDIC_MATRA_CATEGORY_TOP + + INDIC_MATRA_CATEGORY_LEFT, + INDIC_MATRA_CATEGORY_TOP_AND_LEFT_AND_RIGHT = INDIC_MATRA_CATEGORY_TOP + + INDIC_MATRA_CATEGORY_LEFT + + INDIC_MATRA_CATEGORY_RIGHT, + INDIC_MATRA_CATEGORY_TOP_AND_RIGHT = INDIC_MATRA_CATEGORY_TOP + + INDIC_MATRA_CATEGORY_RIGHT, + + INDIC_MATRA_CATEGORY_INVISIBLE = INDIC_MATRA_CATEGORY_NOT_APPLICABLE, + INDIC_MATRA_CATEGORY_OVERSTRUCK = INDIC_MATRA_CATEGORY_NOT_APPLICABLE, + INDIC_MATRA_CATEGORY_VISUAL_ORDER_LEFT = INDIC_MATRA_CATEGORY_NOT_APPLICABLE }; #define INDIC_COMBINE_CATEGORIES(S,M) \