summaryrefslogtreecommitdiffstats
path: root/libs/minikin/GraphemeBreak.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/minikin/GraphemeBreak.cpp')
-rw-r--r--libs/minikin/GraphemeBreak.cpp17
1 files changed, 2 insertions, 15 deletions
diff --git a/libs/minikin/GraphemeBreak.cpp b/libs/minikin/GraphemeBreak.cpp
index 1f361ba..45dd0ff 100644
--- a/libs/minikin/GraphemeBreak.cpp
+++ b/libs/minikin/GraphemeBreak.cpp
@@ -66,19 +66,6 @@ bool isPureKiller(uint32_t c) {
|| c == 0xA953 || c == 0xABED || c == 0x11134 || c == 0x112EA || c == 0x1172B);
}
-// Returns true if the character appears before or after zwj in a zwj emoji sequence. See
-// http://www.unicode.org/emoji/charts/emoji-zwj-sequences.html
-bool isZwjEmoji(uint32_t c) {
- return (c == 0x2764 // HEAVY BLACK HEART
- || c == 0x1F468 // MAN
- || c == 0x1F469 // WOMAN
- || c == 0x1F48B // KISS MARK
- || c == 0x1F466 // BOY
- || c == 0x1F467 // GIRL
- || c == 0x1F441 // EYE
- || c == 0x1F5E8); // LEFT SPEECH BUBBLE
-}
-
bool GraphemeBreak::isGraphemeBreak(const uint16_t* buf, size_t start, size_t count,
size_t offset) {
// This implementation closely follows Unicode Standard Annex #29 on
@@ -163,7 +150,7 @@ bool GraphemeBreak::isGraphemeBreak(const uint16_t* buf, size_t start, size_t co
return false;
}
// Tailoring: make emoji sequences with ZWJ a single grapheme cluster
- if (c1 == 0x200D && isZwjEmoji(c2) && offset_back > start) {
+ if (c1 == 0x200D && isEmoji(c2) && offset_back > start) {
// look at character before ZWJ to see that both can participate in an emoji zwj sequence
uint32_t c0 = 0;
U16_PREV(buf, start, offset_back, c0);
@@ -171,7 +158,7 @@ bool GraphemeBreak::isGraphemeBreak(const uint16_t* buf, size_t start, size_t co
// skip over emoji variation selector
U16_PREV(buf, start, offset_back, c0);
}
- if (isZwjEmoji(c0)) {
+ if (isEmoji(c0)) {
return false;
}
}