mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-08 08:48:39 +09:00
Add emoji presentation API
This commit is contained in:
parent
14cceb8708
commit
33a4b11c98
1 changed files with 19 additions and 0 deletions
|
|
@ -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)];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue