From 5a9cba9744876dfc56bdc9aed805f571bd0d4b0a Mon Sep 17 00:00:00 2001 From: David Corbett Date: Wed, 8 Nov 2017 13:15:27 -0500 Subject: [PATCH] Mark non-initial left matras as unsafe to break --- src/hb-ot-shape-complex-indic.cc | 14 +++++++++----- test/shaping/Makefile.am | 1 + .../1a3d8f381387dd29be1e897e4b5100ac8b4829e1.ttf | Bin 0 -> 1380 bytes test/shaping/tests/indic-init.tests | 1 + 4 files changed, 11 insertions(+), 5 deletions(-) create mode 100644 test/shaping/fonts/sha1sum/1a3d8f381387dd29be1e897e4b5100ac8b4829e1.ttf create mode 100644 test/shaping/tests/indic-init.tests 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 0000000000000000000000000000000000000000..d060ea96ea0740e07cb9aa3119890eed6d99ac54 GIT binary patch literal 1380 zcmZuxTWB0r82-=9Y`VLt8)KWaP-zA!y2adfgh317G?>LC55`L}d+F{<_QLFB z%obalgw~LWVM`ON*h(JqU`tRDQLrrtg7HBK1*tE^`p^f#KB?_&n9}t-GpY5#GyLcO zzyEyaJNFqH85yFTbdp4RA==+Bmp{L8gou77V&#EYUq3aIL?nHQTg5yu-z!x}wBAHi8UNNwVb{Sa9rj^tqm8Y+x{UzW~776if zHVj+^K9J38(+v`}0-pqaG_OpTNQxsQK3+pX$)|UJcfdy^?#BGQrD9pDpQa%6m(ea0 zfs4@@Ndhs(+@pn@mM&{NexlYywf(HtCe+%*+Ft42j8Qwkwd^wYG*xT#n7OZ+TN8hr-K|^F<;{B&1Lm#X9o8jl%=ON@v&WZCygzex?t{~A^P<&gSUs-V z8XH52m8DIYD+E0ezwmKG#O><+x7zi6K!{|9YGyay<@!{*A zSpKETr>_~tne!LUeQdbbR&`a?b+v8Am|dDXt@Hw*EjfF zZf-^zeCBvdbr&`tn{Jyo@X=G_O}%%7M)7x^zP|U4%l7_1Z{G(|aElzedBqF+8-~+m z&%l~-_Rz5zW5S;MyXs-VZ7VxurMOG!~3Jby&Bo`geexm>rkR_Kb!R7zk5%=S0 zUy8o=