diff --git a/src/gen-indic-table.py b/src/gen-indic-table.py index fda293b59..318ea5a91 100755 --- a/src/gen-indic-table.py +++ b/src/gen-indic-table.py @@ -243,15 +243,18 @@ for k,new_cat in category_overrides.items(): data[k] = (new_cat, pos, block) # We only expect position for certain types +positioned_categories = ('CM', 'SM', 'RS', 'H', 'M') for k, (cat, pos, block) in data.items(): - if cat not in ('CM', 'SM', 'RS', 'H', 'M'): + if cat not in positioned_categories: pos = 'END' data[k] = (cat, pos, block) # Position overrides are more complicated +# Keep in sync with CONSONANT_FLAGS in the shaper +consonant_categories = ('C', 'CS', 'Ra','CM', 'V', 'PLACEHOLDER', 'DOTTEDCIRCLE') for k, (cat, pos, block) in data.items(): - if cat in ('C', 'CS', 'Ra','CM', 'V', 'PLACEHOLDER', 'DOTTEDCIRCLE'): + if cat in consonant_categories: pos = 'BASE_C' data[k] = (cat, pos, block) diff --git a/src/hb-ot-shaper-indic.hh b/src/hb-ot-shaper-indic.hh index 587ccaece..415227712 100644 --- a/src/hb-ot-shaper-indic.hh +++ b/src/hb-ot-shaper-indic.hh @@ -78,7 +78,9 @@ enum indic_category_t { * * 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! */ + * consonant syllable logic from the vowel syllable function and get it all right! + * + * Keep in sync with consonant_categories in the generator. */ #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))