Cluster Regional_Indicator pairs (aka emoji flags)

Fixes https://github.com/harfbuzz/harfbuzz/issues/2265
This commit is contained in:
Behdad Esfahbod 2021-06-09 19:06:31 -06:00
parent 4e72d5e35d
commit 2b0ced28b6
1 changed files with 8 additions and 0 deletions

View File

@ -488,6 +488,14 @@ hb_set_unicode_props (hb_buffer_t *buffer)
{
_hb_glyph_info_set_continuation (&info[i]);
}
/* Regional_Indicators are hairy as hell...
* https://github.com/harfbuzz/harfbuzz/issues/2265 */
else if (unlikely (i && hb_in_range<hb_codepoint_t> (info[i].codepoint, 0x1F1E6u, 0x1F1FFu)))
{
if (hb_in_range<hb_codepoint_t> (info[i - 1].codepoint, 0x1F1E6u, 0x1F1FFu) &&
!_hb_glyph_info_is_continuation (&info[i - 1]))
_hb_glyph_info_set_continuation (&info[i]);
}
#ifndef HB_NO_EMOJI_SEQUENCES
else if (unlikely (_hb_glyph_info_is_zwj (&info[i])))
{