summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSiyamed Sinir <siyamed@google.com>2018-04-12 21:42:26 -0700
committerSiyamed Sinir <siyamed@google.com>2018-04-19 19:19:33 +0000
commitbeeb49c4751ac932cf54ea11770e31c6dab49a2b (patch)
tree42f1c03a297b4602ee00333b25692b7a948e19b5
parent3da4269e6097e0dafdb438c760dafdde13feda95 (diff)
downloadminikin-beeb49c4751ac932cf54ea11770e31c6dab49a2b.tar.gz
Update Emoji.cpp for emoji 11
This CL removes the Emoji 5.0 info from Emoji.java since they are supported by ICU. It adds emoji added in Emoji 11. Test: Verified that ICU handles Emoji 5.0 emoji Test: Verified hardware keyboard backspace with hair color emoji Test: Visually verified cursor moves with hardware keyboard Bug: 77148691 Change-Id: I2cae8f8f5fc6014f715b591ac14e2928da661cde (cherry picked from commit 31790982cccdcdee1d73a743a2b3d3383f33a01c)
-rw-r--r--libs/minikin/Emoji.cpp24
1 files changed, 13 insertions, 11 deletions
diff --git a/libs/minikin/Emoji.cpp b/libs/minikin/Emoji.cpp
index baf15a2..ad83189 100644
--- a/libs/minikin/Emoji.cpp
+++ b/libs/minikin/Emoji.cpp
@@ -19,16 +19,18 @@
namespace minikin {
bool isNewEmoji(uint32_t c) {
- // Emoji characters new in Unicode emoji 5.0.
- // From http://www.unicode.org/Public/emoji/5.0/emoji-data.txt
- // TODO: Remove once emoji-data.text 5.0 is in ICU or update to 6.0.
- if (c < 0x1F6F7 || c > 0x1F9E6) {
+ // Emoji characters new in Unicode emoji 11
+ // From https://www.unicode.org/Public/emoji/11.0/emoji-data.txt
+ // TODO: Remove once emoji-data.text 11 is in ICU or update to 11.
+ if (c < 0x1F6F9 || c > 0x1F9FF) {
// Optimization for characters outside the new emoji range.
return false;
}
- return (0x1F6F7 <= c && c <= 0x1F6F8) || c == 0x1F91F || (0x1F928 <= c && c <= 0x1F92F) ||
- (0x1F931 <= c && c <= 0x1F932) || c == 0x1F94C || (0x1F95F <= c && c <= 0x1F96B) ||
- (0x1F992 <= c && c <= 0x1F997) || (0x1F9D0 <= c && c <= 0x1F9E6);
+ return c == 0x265F || c == 0x267E || c == 0x1F6F9 || (0x1F94D <= c && c <= 0x1F94F) ||
+ (0x1F96C <= c && c <= 0x1F970) || (0x1F973 <= c && c <= 0x1F976) || c == 0x1F97A ||
+ (0x1F97C <= c && c <= 0x1F97F) || (0x1F998 <= c && c <= 0x1F9A2) ||
+ (0x1F9B0 <= c && c <= 0x1F9B9) || (0x1F9C1 <= c && c <= 0x1F9C2) ||
+ (0x1F9E7 <= c && c <= 0x1F9FF);
}
bool isEmoji(uint32_t c) {
@@ -48,10 +50,10 @@ bool isEmojiBase(uint32_t c) {
if (c == 0x1F91D || c == 0x1F93C) {
return true;
}
- // Emoji Modifier Base characters new in Unicode emoji 5.0.
- // From http://www.unicode.org/Public/emoji/5.0/emoji-data.txt
- // TODO: Remove once emoji-data.text 5.0 is in ICU or update to 6.0.
- if (c == 0x1F91F || (0x1F931 <= c && c <= 0x1F932) || (0x1F9D1 <= c && c <= 0x1F9DD)) {
+ // Emoji Modifier Base characters new in Unicode emoji 11
+ // From https://www.unicode.org/Public/emoji/11.0/emoji-data.txt
+ // TODO: Remove once emoji-data.text 11 is in ICU or update to 11.
+ if ((0x1F9B5 <= c && c <= 0x1F9B6) || (0x1F9B8 <= c && c <= 0x1F9B9)) {
return true;
}
return u_hasBinaryProperty(c, UCHAR_EMOJI_MODIFIER_BASE);