summaryrefslogtreecommitdiffstats
path: root/intl
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-05-09 19:41:33 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-05-09 19:41:33 +0200
commitfd2b227f19844978021811e9e1a60b8bcbd1ecad (patch)
treea378867115a91a3f33ff019f2c303b0406b1c688 /intl
parentaa662adcfc086965ee9ecdcf4d2c01a1c4869efa (diff)
parent2619698a2eb7363940d1e6a2d71a9ce7b366d3f5 (diff)
downloadUXP-fd2b227f19844978021811e9e1a60b8bcbd1ecad.tar
UXP-fd2b227f19844978021811e9e1a60b8bcbd1ecad.tar.gz
UXP-fd2b227f19844978021811e9e1a60b8bcbd1ecad.tar.lz
UXP-fd2b227f19844978021811e9e1a60b8bcbd1ecad.tar.xz
UXP-fd2b227f19844978021811e9e1a60b8bcbd1ecad.zip
Merge branch 'intl-ICU-emoji-work'
Diffstat (limited to 'intl')
-rw-r--r--intl/unicharutil/util/nsUnicodeProperties.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/intl/unicharutil/util/nsUnicodeProperties.h b/intl/unicharutil/util/nsUnicodeProperties.h
index 303582f99..ee1d77252 100644
--- a/intl/unicharutil/util/nsUnicodeProperties.h
+++ b/intl/unicharutil/util/nsUnicodeProperties.h
@@ -54,6 +54,15 @@ enum XidmodType {
XIDMOD_NOT_CHARS
};
+enum EmojiPresentation {
+ TextOnly = 0,
+ TextDefault = 1,
+ EmojiDefault = 2
+};
+
+const uint32_t kVariationSelector15 = 0xFE0E; // text presentation
+const uint32_t kVariationSelector16 = 0xFE0F; // emoji presentation
+
// ICU is available, so simply forward to its API
extern const hb_unicode_general_category_t sICUtoHBcategory[];
@@ -170,6 +179,19 @@ IsEastAsianWidthFWH(uint32_t aCh)
return false;
}
+inline EmojiPresentation
+GetEmojiPresentation(uint32_t aCh)
+{
+ if (!u_hasBinaryProperty(aCh, UCHAR_EMOJI)) {
+ return TextOnly;
+ }
+
+ if (u_hasBinaryProperty(aCh, UCHAR_EMOJI_PRESENTATION)) {
+ return EmojiDefault;
+ }
+ return TextDefault;
+}
+
// returns the simplified Gen Category as defined in nsIUGenCategory
inline nsIUGenCategory::nsUGenCategory GetGenCategory(uint32_t aCh) {
return sDetailedToGeneralCategory[GetGeneralCategory(aCh)];