From 7686ff854bbb9698bb1469dcfe6d288c695a76b7 Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Thu, 4 Mar 2021 23:09:32 +0200 Subject: [PATCH] [ot] Keep substituted Default_Ignorables (#2886) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Don’t replace Default_Ignorables with zero-width space if they are substituted or multiplied, not just when ligated. After this change, HarfBuzz output matches that of Uniscribe and CoreText for the new tests. Fixes https://github.com/harfbuzz/harfbuzz/issues/2883 --- src/hb-ot-layout.hh | 3 ++- .../08b4b136f418add748dc641eb4a83033476f1170.ttf | Bin 0 -> 2396 bytes .../6677074106f94a2644da6aaaacd5bbd48cbdc7de.ttf | Bin 0 -> 2388 bytes .../fcea341ba6489536390384d8403ce5287ba71a4a.ttf | Bin 0 -> 1824 bytes .../data/in-house/tests/default-ignorables.tests | 3 +++ .../tests/mongolian-variation-selector.tests | 2 +- 6 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 test/shaping/data/in-house/fonts/08b4b136f418add748dc641eb4a83033476f1170.ttf create mode 100644 test/shaping/data/in-house/fonts/6677074106f94a2644da6aaaacd5bbd48cbdc7de.ttf create mode 100644 test/shaping/data/in-house/fonts/fcea341ba6489536390384d8403ce5287ba71a4a.ttf diff --git a/src/hb-ot-layout.hh b/src/hb-ot-layout.hh index f3bb15581..ac61bc70d 100644 --- a/src/hb-ot-layout.hh +++ b/src/hb-ot-layout.hh @@ -315,12 +315,13 @@ _hb_glyph_info_get_unicode_space_fallback_type (const hb_glyph_info_t *info) } static inline bool _hb_glyph_info_ligated (const hb_glyph_info_t *info); +static inline bool _hb_glyph_info_substituted (const hb_glyph_info_t *info); static inline bool _hb_glyph_info_is_default_ignorable (const hb_glyph_info_t *info) { return (info->unicode_props() & UPROPS_MASK_IGNORABLE) && - !_hb_glyph_info_ligated (info); + !_hb_glyph_info_substituted (info); } static inline bool _hb_glyph_info_is_default_ignorable_and_not_hidden (const hb_glyph_info_t *info) diff --git a/test/shaping/data/in-house/fonts/08b4b136f418add748dc641eb4a83033476f1170.ttf b/test/shaping/data/in-house/fonts/08b4b136f418add748dc641eb4a83033476f1170.ttf new file mode 100644 index 0000000000000000000000000000000000000000..4d0f52adc0b69e97c534e545db95885f9c7d245d GIT binary patch literal 2396 zcmZuyUuaWj6hG&?$!%tr<7u&MBPWRx9X>8LqNlnsD zL0kt8L3FsW2N?(=GH?twh8trK!@(YW@M*{fGLXGEAAH=v4c6}W-Fp+O^}F2PIp_DC zbH0=BJNFAQ5xHoU6q*_z-8V)9bc@Jd1REWnnw%b8i7&(c61Fxz{pQ~3+c&yk-z8Em zPfqXD&x8)fh{PStA4_HuOT)E~uVQXH?D*W`=@aSUeJ?@(orrhMrxLTbdhY7*kAn-( zgQ)z}{uS&SuzTh+#Zy&(P!{$%*xF()nc&ZP0d^F2eI{{giMqG~wnxrq6PZ-(=3D!* z9_r-_OSwXE$GvL@P#>l#PfUH_&+{effb><13RP`tZfY7F)We~=?z(U|(%t3j?Ty3) z?>^AzAKKRHa=YvLTR!jwCls4<#qF%JRd% z9H;g5@;WNkls1O=gzu9|HmR2F1_}^0v?~=@y3^gMha=$u;Zs6EC{407cca?f9234? z-+-*v?S69P>{PcNZd9Q1=q?`cJ6MMUyyxigY&* zy5f54!&JhScV)wNw~#~nF?SIvFF_FSSP{2lf2dFm6FVgD$-88{bO{SG|gqMp*VQ&G2#cv zN&HaOLz>(jqgp8&VaeTT#M#Qetc0h)qtP{WTyq(xU)IccGDa7Sy0c_HU+=H_(!Yc>9Krh4NJ>->)MsL8Y zfHzMoz*#V3@XH!;6UdeUt7%@E2D=QeB&D=A{EpIUGJXy-i}1~(o&i+oM@J3Q9*Wa` zWE(E~_8Y4`^)BTwt9Z)K81)oTqpU>RkhK)?d?xc$aRBHp+)FPQvI_(&Y-2mCxO1?_v-F3fz)KN_3Gw@u*8jNnKw$}1MXFN6oRj}R{ zzHG$FZu3$*@#t9mknDPy#k_CI^Q($Vc4J;ovAZwNy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1e?0NRWJJ?F`d=SviO!^G@%d|~qXB=Q%Q{r)4>xITgZGNGg-=d*G_}er zlA2lVC%1`Y^nsVpjLOcLQeC~*FD>mg&Hnnk#-*kIp6;F=%LvsRjg+A6e(o^6lUd_` zV|LckhW>YIJTuj+epoy|H5J+)QpO1+kisxt#TJ*9mx#CHxp#kl=3weKRO-K~pl{PR zUsUpkT<)9lo>g}HZg>V)xcDVQKT>x|c?n(GRoXXspFAU#SAS{eJIrgFPJFq(a#zC# zLypN+co=nAdz_X>94Sx3k`CL){ak>_SF%5bGGin745nG-)X@EMdbevoa&1E$SX zu~m@`{E`u+0rhq&?44-zdfPi{R@og`)^~r}&Hnkx*6(%%o!#NXlPZgGfcQG6qYE=# zcXf@g?LAl55yQu>ZXkqhSNEV9JFf0UNJ4lJD=6VSR*}admatA%H#jZC+5Jg$+nPn) z6Fh%PIz2=ZJTe*+DYASw_E6em#@S5+7(xbP%r;Q=?Y67!d++6N zSnS)UZ9Z${sF;|yW!;PTXC}6bb0h37%e|XB1-k&cXrhZD9`TCLw^7W;dlP+1TJiXB zz{RnJd@)-Fh1`6;4D!YNdZp{8LYxZ1PEjvQ-Lx}8HWqfXdSU9ZT?WZ2QlTF0rR!JR5z?r#4E0UHha literal 0 HcmV?d00001 diff --git a/test/shaping/data/in-house/tests/default-ignorables.tests b/test/shaping/data/in-house/tests/default-ignorables.tests index a27b67a68..69e549a12 100644 --- a/test/shaping/data/in-house/tests/default-ignorables.tests +++ b/test/shaping/data/in-house/tests/default-ignorables.tests @@ -1,2 +1,5 @@ ../fonts/051d92f8bc6ff724511b296c27623f824de256e9.ttf::U+0075,U+0361,U+034F,U+0301,U+0069:[gid2=0+1266|gid7=0@-617,442+0|gid5=0@-7,0+0|gid1=4+528] ../fonts/bf962d3202883a820aed019d9b5c1838c2ff69c6.ttf::U+0020,U+06CC,U+064E,U+034F,U+0651:[uni0651=1+0|space=1+0|uni064E=1@236,-432+0|uni06CC=1+1266|space=0+452] +../fonts/6677074106f94a2644da6aaaacd5bbd48cbdc7de.ttf::U+0647,U+200D:[terminal=0+0|uni0647.init=0+702] +../fonts/fcea341ba6489536390384d8403ce5287ba71a4a.ttf::U+0647,U+200D:[uni0647200D=0+702] +../fonts/08b4b136f418add748dc641eb4a83033476f1170.ttf::U+0647,U+200D:[terminal=0+0|terminal=0+0|uni0647.init=0+702] diff --git a/test/shaping/data/in-house/tests/mongolian-variation-selector.tests b/test/shaping/data/in-house/tests/mongolian-variation-selector.tests index c5e35c890..f624a295f 100644 --- a/test/shaping/data/in-house/tests/mongolian-variation-selector.tests +++ b/test/shaping/data/in-house/tests/mongolian-variation-selector.tests @@ -16,4 +16,4 @@ ../fonts/4d4206e30b2dbf1c1ef492a8eae1c9e7829ebad8.ttf::U+1820,U+200C,U+182D,U+1820,U+1837:[uni1820.E820_a.isol=0+1550|space=1+0|uni182D.E8E2_g.init=2+1000|uni1820.E823_a.medi=3+400|uni1837.E931_r.fina=4+750] ../fonts/4d4206e30b2dbf1c1ef492a8eae1c9e7829ebad8.ttf::U+1830,U+1824,U+1837,U+200D,U+200D,U+182D,U+1820,U+200D:[uni1830.E90B_s.init=0+850|uni1824.E844_u.medi=1+600|uni1837.E930_r.medi=2+600|space=2+0|space=2+0|uni182D.E8E5_g.medi1=5+800|uni1820.E823_a.medi=6+400|space=6+0] ../fonts/4d4206e30b2dbf1c1ef492a8eae1c9e7829ebad8.ttf::U+200D,U+182D,U+1824,U+182F,U+1822:[space=0+0|uni182D.E8E5_g.medi1=1+800|uni1824.E844_u.medi=2+600|uni182F.E908_l.medi=3+400|uni1822.E837_i.fina=4+600] -../fonts/4d4206e30b2dbf1c1ef492a8eae1c9e7829ebad8.ttf::U+182A,U+1820,U+1822,U+182D,U+180E,U+1820,U+202F,U+1836,U+1822,U+1828:[uni182A1820.E875_ba.init=0+1000|uni1822.E836_i.medi2=2+1000|uni182D.E8E8_g.fina1=3+1250|space=4+0|uni1820.E827_a.fina2=5+600|uni202F.nobreak=6+500|uni1836.E92B_y.init1=7+500|uni1822.E834_i.medi=8+500|uni1828.E866_n.fina=9+850] +../fonts/4d4206e30b2dbf1c1ef492a8eae1c9e7829ebad8.ttf::U+182A,U+1820,U+1822,U+182D,U+180E,U+1820,U+202F,U+1836,U+1822,U+1828:[uni182A1820.E875_ba.init=0+1000|uni1822.E836_i.medi2=2+1000|uni182D.E8E8_g.fina1=3+1250|uni180E.E80E_mvs=4+0|uni1820.E827_a.fina2=5+600|uni202F.nobreak=6+500|uni1836.E92B_y.init1=7+500|uni1822.E834_i.medi=8+500|uni1828.E866_n.fina=9+850]