Bug 1032671 - Part 1. Add emoji presentation API for UTR#51. r=jfkthame
From ICU 57, ICU supports emoji presentation as draft API. MozReview-Commit-ID: 6JgQMv4Ky9m
This commit is contained in:
@@ -46,6 +46,12 @@ enum IdentifierType {
|
|||||||
IDTYPE_ALLOWED = 1,
|
IDTYPE_ALLOWED = 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum EmojiPresentation {
|
||||||
|
TextOnly = 0,
|
||||||
|
TextDefault = 1,
|
||||||
|
EmojiDefault = 2
|
||||||
|
};
|
||||||
|
|
||||||
extern const hb_unicode_general_category_t sICUtoHBcategory[];
|
extern const hb_unicode_general_category_t sICUtoHBcategory[];
|
||||||
|
|
||||||
inline uint32_t
|
inline uint32_t
|
||||||
@@ -172,6 +178,19 @@ IsDefaultIgnorable(uint32_t aCh)
|
|||||||
return u_hasBinaryProperty(aCh, UCHAR_DEFAULT_IGNORABLE_CODE_POINT);
|
return u_hasBinaryProperty(aCh, UCHAR_DEFAULT_IGNORABLE_CODE_POINT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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 nsUGenCategory
|
// returns the simplified Gen Category as defined in nsUGenCategory
|
||||||
inline nsUGenCategory GetGenCategory(uint32_t aCh) {
|
inline nsUGenCategory GetGenCategory(uint32_t aCh) {
|
||||||
return sDetailedToGeneralCategory[GetGeneralCategory(aCh)];
|
return sDetailedToGeneralCategory[GetGeneralCategory(aCh)];
|
||||||
|
|||||||
Reference in New Issue
Block a user