diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-05-09 15:18:14 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-05-09 15:18:14 +0200 |
commit | 78430deb89ca5fb35588e73a35a3c702523f0345 (patch) | |
tree | 6d0c05b503c5219c228909b9ef843080df73c875 /intl/unicharutil/util | |
parent | 43208a5308f2ac64416d6c962d922776bb664431 (diff) | |
download | UXP-78430deb89ca5fb35588e73a35a3c702523f0345.tar UXP-78430deb89ca5fb35588e73a35a3c702523f0345.tar.gz UXP-78430deb89ca5fb35588e73a35a3c702523f0345.tar.lz UXP-78430deb89ca5fb35588e73a35a3c702523f0345.tar.xz UXP-78430deb89ca5fb35588e73a35a3c702523f0345.zip |
Add emoji presentation API
Diffstat (limited to 'intl/unicharutil/util')
-rw-r--r-- | intl/unicharutil/util/nsUnicodeProperties.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/intl/unicharutil/util/nsUnicodeProperties.h b/intl/unicharutil/util/nsUnicodeProperties.h index 303582f99..33f01f2d4 100644 --- a/intl/unicharutil/util/nsUnicodeProperties.h +++ b/intl/unicharutil/util/nsUnicodeProperties.h @@ -54,6 +54,12 @@ enum XidmodType { XIDMOD_NOT_CHARS }; +enum EmojiPresentation { + TextOnly = 0, + TextDefault = 1, + EmojiDefault = 2 +}; + // ICU is available, so simply forward to its API extern const hb_unicode_general_category_t sICUtoHBcategory[]; @@ -170,6 +176,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)]; |