diff --git a/src/hb-ot-shape-complex-indic.cc b/src/hb-ot-shape-complex-indic.cc index f7df985d1..8e2cd620e 100644 --- a/src/hb-ot-shape-complex-indic.cc +++ b/src/hb-ot-shape-complex-indic.cc @@ -1686,11 +1686,15 @@ final_reordering_syllable (const hb_ot_shape_plan_t *plan, /* Apply 'init' to the Left Matra if it's a word start. */ - if (info[start].indic_position () == POS_PRE_M && - (!start || - !(FLAG_UNSAFE (_hb_glyph_info_get_general_category (&info[start - 1])) & - FLAG_RANGE (HB_UNICODE_GENERAL_CATEGORY_FORMAT, HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK)))) - info[start].mask |= indic_plan->mask_array[INIT]; + if (info[start].indic_position () == POS_PRE_M) + { + if (!start || + !(FLAG_UNSAFE (_hb_glyph_info_get_general_category (&info[start - 1])) & + FLAG_RANGE (HB_UNICODE_GENERAL_CATEGORY_FORMAT, HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK))) + info[start].mask |= indic_plan->mask_array[INIT]; + else + buffer->unsafe_to_break (start - 1, start + 1); + } /* diff --git a/test/shaping/Makefile.am b/test/shaping/Makefile.am index ca7c1c30b..592754b29 100644 --- a/test/shaping/Makefile.am +++ b/test/shaping/Makefile.am @@ -58,6 +58,7 @@ TESTS = \ tests/hangul-jamo.tests \ tests/hyphens.tests \ tests/indic-consonant-with-stacker.tests \ + tests/indic-init.tests \ tests/indic-joiner-candrabindu.tests \ tests/indic-joiners.tests \ tests/indic-old-spec.tests \ diff --git a/test/shaping/fonts/sha1sum/1a3d8f381387dd29be1e897e4b5100ac8b4829e1.ttf b/test/shaping/fonts/sha1sum/1a3d8f381387dd29be1e897e4b5100ac8b4829e1.ttf new file mode 100644 index 000000000..d060ea96e Binary files /dev/null and b/test/shaping/fonts/sha1sum/1a3d8f381387dd29be1e897e4b5100ac8b4829e1.ttf differ diff --git a/test/shaping/tests/indic-init.tests b/test/shaping/tests/indic-init.tests new file mode 100644 index 000000000..1231eabce --- /dev/null +++ b/test/shaping/tests/indic-init.tests @@ -0,0 +1 @@ +fonts/sha1sum/1a3d8f381387dd29be1e897e4b5100ac8b4829e1.ttf:--no-glyph-names:U+09AC,U+09C7,U+09AC,U+09C7:[3=0+273|1=0+460|2=2+307|1=2+460]