[Indic] Allow Consonant_Medial's after Consonant's
authorBehdad Esfahbod <behdad@behdad.org>
Tue, 13 Nov 2012 02:41:22 +0000 (18:41 -0800)
committerBehdad Esfahbod <behdad@behdad.org>
Tue, 13 Nov 2012 02:41:22 +0000 (18:41 -0800)
Mostly affects Myanmar, but also Tai Tham, Javanese, and Cham.  The
latter three are untested (no fonts!).

src/hb-ot-shape-complex-indic-machine.rl
src/hb-ot-shape-complex-indic-private.hh

index b745466..a536da5 100644 (file)
@@ -55,8 +55,9 @@ RS   = 13;
 Coeng = 14;
 Repha = 15;
 Ra    = 16;
+CM    = 17;
 
-c = (C | Ra);                  # is_consonant
+c = (C | Ra)CM*;               # is_consonant
 n = ((ZWNJ?.RS)? (N.N?)?);     # is_consonant_modifier
 z = ZWJ|ZWNJ;                  # is_joiner
 h = H | Coeng;                 # is_halant_or_coeng
index c3c51fe..de7264a 100644 (file)
@@ -63,7 +63,8 @@ enum indic_category_t {
   OT_RS, /* Register Shifter, used in Khmer OT spec */
   OT_Coeng,
   OT_Repha,
-  OT_Ra /* Not explicitly listed in the OT spec, but used in the grammar. */
+  OT_Ra, /* Not explicitly listed in the OT spec, but used in the grammar. */
+  OT_CM
 };
 
 /* Visual positions in a syllable from left to right. */
@@ -103,7 +104,7 @@ enum indic_syllabic_category_t {
   INDIC_SYLLABIC_CATEGORY_CONSONANT_DEAD       = OT_C,
   INDIC_SYLLABIC_CATEGORY_CONSONANT_FINAL      = OT_C,
   INDIC_SYLLABIC_CATEGORY_CONSONANT_HEAD_LETTER        = OT_C,
-  INDIC_SYLLABIC_CATEGORY_CONSONANT_MEDIAL     = OT_C,
+  INDIC_SYLLABIC_CATEGORY_CONSONANT_MEDIAL     = OT_CM,
   INDIC_SYLLABIC_CATEGORY_CONSONANT_PLACEHOLDER        = OT_NBSP,
   INDIC_SYLLABIC_CATEGORY_CONSONANT_SUBJOINED  = OT_C,
   INDIC_SYLLABIC_CATEGORY_CONSONANT_REPHA      = OT_Repha,
@@ -285,7 +286,7 @@ is_joiner (const hb_glyph_info_t &info)
  * We treat Vowels and placeholders as if they were consonants.  This is safe because Vowels
  * cannot happen in a consonant syllable.  The plus side however is, we can call the
  * consonant syllable logic from the vowel syllable function and get it all right! */
-#define CONSONANT_FLAGS (FLAG (OT_C) | FLAG (OT_Ra) | FLAG (OT_V) | FLAG (OT_NBSP) | FLAG (OT_DOTTEDCIRCLE))
+#define CONSONANT_FLAGS (FLAG (OT_C) | FLAG (OT_CM) | FLAG (OT_Ra) | FLAG (OT_V) | FLAG (OT_NBSP) | FLAG (OT_DOTTEDCIRCLE))
 static inline bool
 is_consonant (const hb_glyph_info_t &info)
 {