summaryrefslogtreecommitdiff
path: root/pango/pango-emoji.c
diff options
context:
space:
mode:
Diffstat (limited to 'pango/pango-emoji.c')
-rw-r--r--pango/pango-emoji.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/pango/pango-emoji.c b/pango/pango-emoji.c
index 8d5a46d6..0abb8783 100644
--- a/pango/pango-emoji.c
+++ b/pango/pango-emoji.c
@@ -158,14 +158,16 @@ static inline unsigned char
_pango_EmojiSegmentationCategory (gunichar codepoint)
{
/* Specific ones first. */
+ if (('a' <= codepoint && codepoint <= 'z') ||
+ ('A' <= codepoint && codepoint <= 'Z') ||
+ codepoint == ' ')
+ return kMaxEmojiScannerCategory;
+
+ if ('0' <= codepoint && codepoint <= '9')
+ return KEYCAP_BASE;
+
switch (codepoint)
{
- case 'a' ... 'z':
- case 'A' ... 'Z':
- case ' ':
- return kMaxEmojiScannerCategory;
- case '0' ... '9':
- return KEYCAP_BASE;
case kCombiningEnclosingKeycapCharacter:
return COMBINING_ENCLOSING_KEYCAP;
case kCombiningEnclosingCircleBackslashCharacter:
@@ -178,14 +180,15 @@ _pango_EmojiSegmentationCategory (gunichar codepoint)
return VS16;
case 0x1F3F4:
return TAG_BASE;
- case 0xE0030 ... 0xE0039:
- case 0xE0061 ... 0xE007A:
- return TAG_SEQUENCE;
case 0xE007F:
return TAG_TERM;
default: ;
}
+ if ((0xE0030 <= codepoint && codepoint <= 0xE0039) ||
+ (0xE0061 <= codepoint && codepoint <= 0xE007A))
+ return TAG_SEQUENCE;
+
if (_pango_Is_Emoji_Modifier_Base (codepoint))
return EMOJI_MODIFIER_BASE;
if (_pango_Is_Emoji_Modifier (codepoint))