From 9f314177336f9551756944e0e555614c9189c7a5 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 24 Jan 2019 16:08:33 +0100 Subject: [PATCH] Form cluster for Emoji sub-region tag sequences Fixes https://github.com/harfbuzz/harfbuzz/issues/1556 --- src/hb-ot-shape.cc | 13 +++++++++++++ .../8d9c4b193808b8bde94389ba7831c1fc6f9e794e.ttf | Bin 0 -> 1548 bytes test/shaping/data/in-house/tests/cluster.tests | 1 + 3 files changed, 14 insertions(+) create mode 100644 test/shaping/data/in-house/fonts/8d9c4b193808b8bde94389ba7831c1fc6f9e794e.ttf diff --git a/src/hb-ot-shape.cc b/src/hb-ot-shape.cc index bc7224dcf..bed282a48 100644 --- a/src/hb-ot-shape.cc +++ b/src/hb-ot-shape.cc @@ -428,6 +428,19 @@ hb_set_unicode_props (hb_buffer_t *buffer) _hb_glyph_info_set_continuation (&info[i]); } } + /* Or part of the Other_Grapheme_Extend that is not marks. + * As of Unicode 11 that is just: + * + * 200C ; Other_Grapheme_Extend # Cf ZERO WIDTH NON-JOINER + * FF9E..FF9F ; Other_Grapheme_Extend # Lm [2] HALFWIDTH KATAKANA VOICED SOUND MARK..HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK + * E0020..E007F ; Other_Grapheme_Extend # Cf [96] TAG SPACE..CANCEL TAG + * + * ZWNJ is special, we decide about that seprately. Ignore Katakana. + * Tags are used for Emoji sub-region flag sequences: + * https://github.com/harfbuzz/harfbuzz/issues/1556 + */ + else if (unlikely (hb_in_range (info[i].codepoint, 0xE0020u, 0xE007Fu))) + _hb_glyph_info_set_continuation (&info[i]); } } diff --git a/test/shaping/data/in-house/fonts/8d9c4b193808b8bde94389ba7831c1fc6f9e794e.ttf b/test/shaping/data/in-house/fonts/8d9c4b193808b8bde94389ba7831c1fc6f9e794e.ttf new file mode 100644 index 0000000000000000000000000000000000000000..f1b84a4ad22bb736b7e71e6bcce80a9ebc6c9833 GIT binary patch literal 1548 zcmb7E&1)2A82`Pqlk8?2Hy}%?)Q>p?V^wT0R6L}p>6$1+6HOFTl;+*d>`vUBnPqkp zOsPf62!e-}QUtx|LA?48coEMz2pTVzrg-sE=s_E4ZPwp2Giy^TVxO1yd7t0&J@3ar z0qDU6q);Cz92}->0OlcT^CRP96NUNFIpWjA*2u((p}w2@?h$`OeC5c2$wOWH211}C zPyEN&#HYKfFK%xK)FtARC0Ez+vHG5PnRvRQ8+D{PU=9*@S85Aou0k(`Ikuk3oVjs} z{=I~I94gjbPy56(#J!H&JeNKN#wh70Q}aujD@ko6>vZ+GI)+krDN8=f)2`k3+vj%x zV?TW!)cr=YbrD~(zVy2l^6f@y5?>l!4h6W521Zi@$HU@Kw*?b8N{(ru*mr zekOvfD@!j&b5mW931cG#a}j0ZG6mL2yQ`ak-0I5GpT}}jZ`5KJP-ag3fDZ2EK*v>v zY>wB|Bj#97hYvbasf=kD(v|f6n#RiqXRsd@tj_#uUR_JO>d7=z>z7vIA`vOhUd}9M zfk-m+a*eUcXtv8CdaEUoPbc!Kj4$A$js*mmMTIBSWW{YL;S;XA(a$kJsYnkCL-c8)!5P4Y zhKrrl9)?H%U6c->#$n<3>s*Zp*^IFnGfzH4&+L0t-NVSZ>Le@8v({O5>aj=ZL$lNW zSFym_XBl@AbIed;ypFO-Zx&_wB8z={N>Jzd9G{oOhj24?8xV+ zGP`_dgTB(M?BFi$-)H}dYRB*oAk_L+-pX4@>~f>z-ezF%zQi{wz9(`++Cy&KMr?*E z43AFIH+oai{gP)kUMrjz7W(9R&1YgC9taq z9qrM_v5VAHwWkr*v~LM-GJ~s|4nnUg8o#1lgu$Fg&t}=HkUNt9jgF+Nc3;bQig65f zBmJ`|jqmtGrujY}3X0`ein-W?l#|#_#Q0rY<(PN=T^@;z=ODh(d9>xk^dG&PSu$1d Xk8JD({^GwFgGnIxnz9^1auRq25|rcv literal 0 HcmV?d00001 diff --git a/test/shaping/data/in-house/tests/cluster.tests b/test/shaping/data/in-house/tests/cluster.tests index 928843f0f..44d220184 100644 --- a/test/shaping/data/in-house/tests/cluster.tests +++ b/test/shaping/data/in-house/tests/cluster.tests @@ -1,2 +1,3 @@ ../fonts/4fac3929fc3332834e93673780ec0fe94342d193.ttf:--cluster-level=2:U+0078,U+030A,U+0058,U+030A:[gid2=0+1083|gid3=1@-1132,-8+0|gid1=2+1200|gid3=3@-1190,349+0] ../fonts/43ef465752be9af900745f72fe29cb853a1401a5.ttf:--cluster-level=1:U+05D4,U+05B7,U+05E9,U+05BC,U+05C1,U+05B8,U+05DE,U+05B4,U+05DD:[uni05DD=8+1359|uni05B4=7@111,0+0|uni05DE=6+1391|uni05B8=5+0|uni05BC=3+0|uni05C1=3+0|uni05E9=2+1451|uni05B7=1@28,0+0|uni05D4=0+1338] +../fonts/8d9c4b193808b8bde94389ba7831c1fc6f9e794e.ttf::U+1F3F4,U+E0067,U+E0062,U+E0077,U+E006C,U+E0073,U+E007F:[.notdef=0+1229|space=0+0|space=0+0|space=0+0|space=0+0|space=0+0|space=0+0]