[shape] Adjust Grapheme clusters for Katakana voiced sound marks

Fixes https://github.com/harfbuzz/harfbuzz/issues/3844
This commit is contained in:
Behdad Esfahbod 2022-10-15 14:26:02 -06:00
parent bda42fc34a
commit d65af60213
1 changed files with 5 additions and 3 deletions

View File

@ -527,18 +527,20 @@ hb_set_unicode_props (hb_buffer_t *buffer)
} }
#endif #endif
/* Or part of the Other_Grapheme_Extend that is not marks. /* Or part of the Other_Grapheme_Extend that is not marks.
* As of Unicode 11 that is just: * As of Unicode 15 that is just:
* *
* 200C ; Other_Grapheme_Extend # Cf ZERO WIDTH NON-JOINER * 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 * 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 * E0020..E007F ; Other_Grapheme_Extend # Cf [96] TAG SPACE..CANCEL TAG
* *
* ZWNJ is special, we don't want to merge it as there's no need, and keeping * ZWNJ is special, we don't want to merge it as there's no need, and keeping
* it separate results in more granular clusters. Ignore Katakana for now. * it separate results in more granular clusters.
* Tags are used for Emoji sub-region flag sequences: * Tags are used for Emoji sub-region flag sequences:
* https://github.com/harfbuzz/harfbuzz/issues/1556 * https://github.com/harfbuzz/harfbuzz/issues/1556
* Katakana ones were requested:
* https://github.com/harfbuzz/harfbuzz/issues/3844
*/ */
else if (unlikely (hb_in_range<hb_codepoint_t> (info[i].codepoint, 0xE0020u, 0xE007Fu))) else if (unlikely (hb_in_ranges<hb_codepoint_t> (info[i].codepoint, 0xFF9Eu, 0xFF9Fu, 0xE0020u, 0xE007Fu)))
_hb_glyph_info_set_continuation (&info[i]); _hb_glyph_info_set_continuation (&info[i]);
} }
} }