From 909e34f68a969275bc9b14c63e03d5d131823d91 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sat, 22 Jan 2022 09:44:13 -0700 Subject: [PATCH] [unsafe-to-concat] Adjust Arabic-joining start boundary condition more --- src/hb-ot-shape-complex-arabic.cc | 14 ++++++++++++-- test/shape/data/in-house/Makefile.sources | 1 + .../34da9aab7bee86c4dfc3b85e423435822fdf4b62.ttf | Bin 0 -> 1904 bytes test/shape/data/in-house/meson.build | 1 + .../data/in-house/tests/unsafe-to-concat.tests | 1 + 5 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 test/shape/data/in-house/fonts/34da9aab7bee86c4dfc3b85e423435822fdf4b62.ttf create mode 100644 test/shape/data/in-house/tests/unsafe-to-concat.tests diff --git a/src/hb-ot-shape-complex-arabic.cc b/src/hb-ot-shape-complex-arabic.cc index 5eec4af37..2298aa92f 100644 --- a/src/hb-ot-shape-complex-arabic.cc +++ b/src/hb-ot-shape-complex-arabic.cc @@ -321,9 +321,19 @@ arabic_joining (hb_buffer_t *buffer) info[prev].arabic_shaping_action() = entry->prev_action; buffer->unsafe_to_break (prev, i + 1); } - else if (2 <= state && state <= 5) /* States that have a possible prev_action. */ + else { - buffer->unsafe_to_concat (prev, i + 1); + if (prev == UINT_MAX) + { + if (this_type >= JOINING_TYPE_R) + buffer->unsafe_to_concat_from_outbuffer (0, i + 1); + } + else + { + if (this_type >= JOINING_TYPE_R || + (2 <= state && state <= 5) /* States that have a possible prev_action. */) + buffer->unsafe_to_concat (prev, i + 1); + } } info[i].arabic_shaping_action() = entry->curr_action; diff --git a/test/shape/data/in-house/Makefile.sources b/test/shape/data/in-house/Makefile.sources index 01047d548..02c9e914b 100644 --- a/test/shape/data/in-house/Makefile.sources +++ b/test/shape/data/in-house/Makefile.sources @@ -59,6 +59,7 @@ TESTS = \ tests/tibetan-contractions-2.tests \ tests/tibetan-vowels.tests \ tests/tt-kern-gpos.tests \ + tests/unsafe-to-concat.tests \ tests/use-indic3.tests \ tests/use-marchen.tests \ tests/use-syllable.tests \ diff --git a/test/shape/data/in-house/fonts/34da9aab7bee86c4dfc3b85e423435822fdf4b62.ttf b/test/shape/data/in-house/fonts/34da9aab7bee86c4dfc3b85e423435822fdf4b62.ttf new file mode 100644 index 0000000000000000000000000000000000000000..8508fbeeb5fd773bfe3cf2b2170f2f6c74100b23 GIT binary patch literal 1904 zcma)6U2GIp6#nk)%xu~IY$?0jvVSg1yCs$4cDr3@`6;y9t_h`EyQmG()hS(QW7{q5 zLV*M&(I^rhFeYli2jYv87)*RHCYosCgFg9SV#J8Q(L|z>_+Wyu?fBi9U8sPG_h#mv z^WE=!=ggfm0|B5Gr{TazCOt5SEr7wJbbxd;2wOJgVLe?0w6fa6vAj~|>d=6b|$m+0T1zvJ-qi9?H@SMQ^J6%b341!E$4;PB7fuP2t8 zBoKMQ`yu@j{pQJ;((xu0-_pOI{^sf8K|`rmP63M4Ynm~R&!N}x9{nryBeTX#VZ)`K z44@{d|K?nAp)}?T%mNzo;k;=gY_>bz7B49==tP{*#Ch|YjjM|yN8DM)pSEzAd+@cz zuOhBPyJwkfqT+cGAbX9C=9eMhH`6#}zJY3>F&gViraBWouSXy9hC*IXDD*+d;|Yg7 zo)Al89ly#t5M*r@cWa}rdp$m1XCl>=jJ0m{F|r; zlUsV%=)RrXyz7F#u_Ge4a^qj=+^y+kOJktg9cXB*uMZ@*@9ve)1M_crPH+R>t%;QV z3}J;yTpd0BjlKtJ8|$CYMr&GHVhi2j$mmFTVt+YKo+Q>=ad$0HceTaWH`EU6?uH$^ zWL4Rry6~_z>b`fh&m9Tja7CyxvSh1LjGF-TPA^(_r$DeRGev#CxrH?<8>o>1I z`o7t`d^PCQvUGJQ5@kn@A@BGBVRZmuQOooX6MO~!J205nWezRB90r0(vw6t~I&Z5F ztXOr7h;z`We3sh4UV9aJB=9}aYE4l!RZ-N_@`GJ9GTCfK?AA9$YU~_ZUip#RyCp>& z6BoHeq^?!DJO>X?L!OTZDmHP|xe6#!LH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