[indic] Add back medial-consonant to grammar

Fixes https://github.com/harfbuzz/harfbuzz/issues/1592
This commit is contained in:
Behdad Esfahbod 2019-03-28 20:50:04 -07:00
parent 5ab6de7a6f
commit 21bb80ebf2
6 changed files with 673 additions and 588 deletions

File diff suppressed because it is too large Load Diff

View File

@ -52,6 +52,7 @@ DOTTEDCIRCLE = 12;
RS = 13; RS = 13;
Repha = 15; Repha = 15;
Ra = 16; Ra = 16;
CM = 17;
Symbol= 18; Symbol= 18;
CS = 19; CS = 19;
@ -67,10 +68,10 @@ matra_group = z{0,3}.M.N?.(H | forced_rakar)?;
syllable_tail = (z?.SM.SM?.ZWNJ?)? A{0,3}?; syllable_tail = (z?.SM.SM?.ZWNJ?)? A{0,3}?;
halant_group = (z?.H.(ZWJ.N?)?); halant_group = (z?.H.(ZWJ.N?)?);
final_halant_group = halant_group | H.ZWNJ; final_halant_group = halant_group | H.ZWNJ;
medial_group = CM?;
halant_or_matra_group = (final_halant_group | matra_group{0,4}); halant_or_matra_group = (final_halant_group | matra_group{0,4});
complex_syllable_tail = (halant_group.cn){0,4} halant_or_matra_group syllable_tail; complex_syllable_tail = (halant_group.cn){0,4} medial_group halant_or_matra_group syllable_tail;
consonant_syllable = (Repha|CS)? cn complex_syllable_tail; consonant_syllable = (Repha|CS)? cn complex_syllable_tail;
vowel_syllable = reph? V.n? (ZWJ | complex_syllable_tail); vowel_syllable = reph? V.n? (ZWJ | complex_syllable_tail);

View File

@ -720,7 +720,7 @@ initial_reordering_consonant_syllable (const hb_ot_shape_plan_t *plan,
indic_position_t last_pos = POS_START; indic_position_t last_pos = POS_START;
for (unsigned int i = start; i < end; i++) for (unsigned int i = start; i < end; i++)
{ {
if ((FLAG_UNSAFE (info[i].indic_category()) & (JOINER_FLAGS | FLAG (OT_N) | FLAG (OT_RS) | FLAG (OT_H)))) if ((FLAG_UNSAFE (info[i].indic_category()) & (JOINER_FLAGS | FLAG (OT_N) | FLAG (OT_RS) | MEDIAL_FLAGS | FLAG (OT_H))))
{ {
info[i].indic_position() = last_pos; info[i].indic_position() = last_pos;
if (unlikely (info[i].indic_category() == OT_H && if (unlikely (info[i].indic_category() == OT_H &&

View File

@ -62,17 +62,19 @@ enum indic_category_t {
OT_Coeng = 14, /* Khmer-style Virama. */ OT_Coeng = 14, /* Khmer-style Virama. */
OT_Repha = 15, /* Atomically-encoded logical or visual repha. */ OT_Repha = 15, /* Atomically-encoded logical or visual repha. */
OT_Ra = 16, OT_Ra = 16,
OT_CM = 17, /* Consonant-Medial; Unused by Indic shaper. */ OT_CM = 17, /* Consonant-Medial. */
OT_Symbol = 18, /* Avagraha, etc that take marks (SM,A,VD). */ OT_Symbol = 18, /* Avagraha, etc that take marks (SM,A,VD). */
OT_CS = 19 OT_CS = 19
}; };
#define MEDIAL_FLAGS (FLAG (OT_CM))
/* Note: /* Note:
* *
* 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_CS) | FLAG (OT_Ra) | FLAG (OT_V) | FLAG (OT_PLACEHOLDER) | FLAG (OT_DOTTEDCIRCLE)) #define CONSONANT_FLAGS (FLAG (OT_C) | FLAG (OT_CS) | FLAG (OT_Ra) | MEDIAL_FLAGS | FLAG (OT_V) | FLAG (OT_PLACEHOLDER) | FLAG (OT_DOTTEDCIRCLE))
#define JOINER_FLAGS (FLAG (OT_ZWJ) | FLAG (OT_ZWNJ)) #define JOINER_FLAGS (FLAG (OT_ZWJ) | FLAG (OT_ZWNJ))

View File

@ -6,3 +6,5 @@
../fonts/1735326da89f0818cd8c51a0600e9789812c0f94.ttf::U+0A51:[uni25CC=0+1044|udaatguru=0+0] ../fonts/1735326da89f0818cd8c51a0600e9789812c0f94.ttf::U+0A51:[uni25CC=0+1044|udaatguru=0+0]
../fonts/1735326da89f0818cd8c51a0600e9789812c0f94.ttf::U+25CC,U+0A51:[uni25CC=0+1044|udaatguru=0+0] ../fonts/1735326da89f0818cd8c51a0600e9789812c0f94.ttf::U+25CC,U+0A51:[uni25CC=0+1044|udaatguru=0+0]
../fonts/81c368a33816fb20e9f647e8f24e2180f4720263.ttf:--no-glyph-names:U+0C80,U+0C82:[1=0+502|2=0+502] ../fonts/81c368a33816fb20e9f647e8f24e2180f4720263.ttf:--no-glyph-names:U+0C80,U+0C82:[1=0+502|2=0+502]
../fonts/f75c4b05a0a4d67c1a808081ae3d74a9c66509e8.ttf::U+0A20,U+0A75,U+0A47:[tthaguru=0+1352|yakashguru=0@-90,0+0|eematraguru=0@-411,0+0]
../fonts/f75c4b05a0a4d67c1a808081ae3d74a9c66509e8.ttf::U+0A20,U+0A75,U+0A42:[tthaguru=0+1352|yakashuuguru=0+0]