[Indic] Allow Consonant_Medial's after Consonant's

Mostly affects Myanmar, but also Tai Tham, Javanese, and Cham.  The
latter three are untested (no fonts!).
This commit is contained in:
Behdad Esfahbod 2012-11-12 18:41:22 -08:00
parent d187099cba
commit 9cac1338c4
2 changed files with 6 additions and 4 deletions

View File

@ -55,8 +55,9 @@ RS = 13;
Coeng = 14; Coeng = 14;
Repha = 15; Repha = 15;
Ra = 16; Ra = 16;
CM = 17;
c = (C | Ra); # is_consonant c = (C | Ra)CM*; # is_consonant
n = ((ZWNJ?.RS)? (N.N?)?); # is_consonant_modifier n = ((ZWNJ?.RS)? (N.N?)?); # is_consonant_modifier
z = ZWJ|ZWNJ; # is_joiner z = ZWJ|ZWNJ; # is_joiner
h = H | Coeng; # is_halant_or_coeng h = H | Coeng; # is_halant_or_coeng

View File

@ -63,7 +63,8 @@ enum indic_category_t {
OT_RS, /* Register Shifter, used in Khmer OT spec */ OT_RS, /* Register Shifter, used in Khmer OT spec */
OT_Coeng, OT_Coeng,
OT_Repha, 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. */ /* 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_DEAD = OT_C,
INDIC_SYLLABIC_CATEGORY_CONSONANT_FINAL = OT_C, INDIC_SYLLABIC_CATEGORY_CONSONANT_FINAL = OT_C,
INDIC_SYLLABIC_CATEGORY_CONSONANT_HEAD_LETTER = 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_PLACEHOLDER = OT_NBSP,
INDIC_SYLLABIC_CATEGORY_CONSONANT_SUBJOINED = OT_C, INDIC_SYLLABIC_CATEGORY_CONSONANT_SUBJOINED = OT_C,
INDIC_SYLLABIC_CATEGORY_CONSONANT_REPHA = OT_Repha, 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 * 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 * 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! */ * 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 static inline bool
is_consonant (const hb_glyph_info_t &info) is_consonant (const hb_glyph_info_t &info)
{ {