diff --git a/src/hb-ot-shape-complex-indic-machine.rl b/src/hb-ot-shape-complex-indic-machine.rl index 7dcbb063c..77606d132 100644 --- a/src/hb-ot-shape-complex-indic-machine.rl +++ b/src/hb-ot-shape-complex-indic-machine.rl @@ -52,11 +52,12 @@ VD = 10; A = 11; NBSP = 12; DOTTEDCIRCLE = 13; +RS = 14; c = C | Ra; n = N N?; z = ZWJ|ZWNJ; -matra_group = M N? H?; +matra_group = (M | RS) N? H?; syllable_tail = SM? (VD VD?)?; place_holder = NBSP | DOTTEDCIRCLE; diff --git a/src/hb-ot-shape-complex-indic-private.hh b/src/hb-ot-shape-complex-indic-private.hh index faf561673..ab44777e3 100644 --- a/src/hb-ot-shape-complex-indic-private.hh +++ b/src/hb-ot-shape-complex-indic-private.hh @@ -58,7 +58,8 @@ enum indic_category_t { OT_VD, OT_A, OT_NBSP, - OT_DOTTEDCIRCLE /* Not in the spec, but special in Uniscribe. /Very very/ special! */ + OT_DOTTEDCIRCLE, /* Not in the spec, but special in Uniscribe. /Very very/ special! */ + OT_RS /* Register Shifter, used in Khmer OT spec */ }; /* Visual positions in a syllable from left to right. */ @@ -92,7 +93,7 @@ enum indic_syllabic_category_t { INDIC_SYLLABIC_CATEGORY_CONSONANT_REPHA = OT_C, INDIC_SYLLABIC_CATEGORY_MODIFYING_LETTER = OT_X, INDIC_SYLLABIC_CATEGORY_NUKTA = OT_N, - INDIC_SYLLABIC_CATEGORY_REGISTER_SHIFTER = OT_X, + INDIC_SYLLABIC_CATEGORY_REGISTER_SHIFTER = OT_RS, INDIC_SYLLABIC_CATEGORY_TONE_LETTER = OT_X, INDIC_SYLLABIC_CATEGORY_TONE_MARK = OT_X, INDIC_SYLLABIC_CATEGORY_VIRAMA = OT_H, diff --git a/src/hb-ot-shape-complex-indic.cc b/src/hb-ot-shape-complex-indic.cc index fd0fe3437..10ec5c5da 100644 --- a/src/hb-ot-shape-complex-indic.cc +++ b/src/hb-ot-shape-complex-indic.cc @@ -261,6 +261,8 @@ _hb_ot_shape_complex_setup_masks_indic (hb_ot_map_t *map HB_UNUSED, info.indic_position() = consonant_position (info.codepoint); if (is_ra (info.codepoint)) info.indic_category() = OT_Ra; + } else if (info.indic_category() == OT_RS) { + info.indic_position() = POS_ABOVE_M; } else if (info.indic_category() == OT_SM || info.indic_category() == OT_VD) { info.indic_position() = POS_SMVD;