提交 c57d46f4 编写于 作者: C Chinmay Garde 提交者: GitHub

Avoid workarounds for old version of ICU and Harfbuzz. (#4024)

上级 0fc962f0
......@@ -33,27 +33,16 @@ bool isNewEmoji(uint32_t c) {
}
bool isEmoji(uint32_t c) {
#if WIP_NEEDS_ICU_UPDATE
return false;
#else // WIP_NEEDS_ICU_UPDATE
return isNewEmoji(c) || u_hasBinaryProperty(c, UCHAR_EMOJI);
#endif // WIP_NEEDS_ICU_UPDATE
}
bool isEmojiModifier(uint32_t c) {
#if WIP_NEEDS_ICU_UPDATE
return false;
#else // WIP_NEEDS_ICU_UPDATE
// Emoji modifier are not expected to change, so there's a small change we
// need to customize this.
return u_hasBinaryProperty(c, UCHAR_EMOJI_MODIFIER);
#endif // WIP_NEEDS_ICU_UPDATE
}
bool isEmojiBase(uint32_t c) {
#if WIP_NEEDS_ICU_UPDATE
return false;
#else // WIP_NEEDS_ICU_UPDATE
// These two characters were removed from Emoji_Modifier_Base in Emoji 4.0,
// but we need to keep them as emoji modifier bases since there are fonts and
// user-generated text out there that treats these as potential emoji bases.
......@@ -68,7 +57,6 @@ bool isEmojiBase(uint32_t c) {
return true;
}
return u_hasBinaryProperty(c, UCHAR_EMOJI_MODIFIER_BASE);
#endif // WIP_NEEDS_ICU_UPDATE
}
UCharDirection emojiBidiOverride(const void* /* context */, UChar32 c) {
......
......@@ -787,10 +787,6 @@ static const hb_codepoint_t CHAR_HYPHEN = 0x2010; /* HYPHEN */
static inline hb_codepoint_t determineHyphenChar(hb_codepoint_t preferredHyphen,
hb_font_t* font) {
#if WIP_NEEDS_ICU_UPDATE
(void)CHAR_HYPHEN;
return 0x002D; // HYPHEN-MINUS
#else // WIP_NEEDS_ICU_UPDATE
hb_codepoint_t glyph;
if (preferredHyphen == 0x058A /* ARMENIAN_HYPHEN */
|| preferredHyphen == 0x05BE /* HEBREW PUNCTUATION MAQAF */
......@@ -813,7 +809,6 @@ static inline hb_codepoint_t determineHyphenChar(hb_codepoint_t preferredHyphen,
}
}
return preferredHyphen;
#endif // WIP_NEEDS_ICU_UPDATE
}
static inline void addHyphenToHbBuffer(hb_buffer_t* buffer,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册