mirror of
https://github.com/roytam1/basilisk55.git
synced 2026-05-26 14:58:59 +00:00
import from UXP: Issue #2871 - Restructure GetEmojiPresentation() for Extended_Pictographic clusters (f13f1bd9)
This commit is contained in:
@@ -212,7 +212,7 @@ gfxPlatformGtk::GetCommonFallbackFonts(uint32_t aCh, uint32_t aNextCh,
|
||||
nsTArray<const char*>& aFontList)
|
||||
{
|
||||
EmojiPresentation emoji = GetEmojiPresentation(aCh);
|
||||
EmojiPresentation eNext = GetEmojiPresentation(aNextCh);
|
||||
EmojiPresentation eNext = GetEmojiPresentation(aNextCh, true);
|
||||
if (aNextCh != kVariationSelector15 &&
|
||||
emoji != EmojiPresentation::TextOnly &&
|
||||
(emoji != EmojiPresentation::TextDefault ||
|
||||
|
||||
@@ -201,7 +201,7 @@ gfxPlatformMac::GetCommonFallbackFonts(uint32_t aCh, uint32_t aNextCh,
|
||||
nsTArray<const char*>& aFontList)
|
||||
{
|
||||
EmojiPresentation emoji = GetEmojiPresentation(aCh);
|
||||
EmojiPresentation eNext = GetEmojiPresentation(aNextCh);
|
||||
EmojiPresentation eNext = GetEmojiPresentation(aNextCh, true);
|
||||
if (aNextCh != kVariationSelector15 &&
|
||||
emoji != EmojiPresentation::TextOnly &&
|
||||
(emoji != EmojiPresentation::TextDefault ||
|
||||
|
||||
@@ -647,7 +647,7 @@ gfxWindowsPlatform::GetCommonFallbackFonts(uint32_t aCh, uint32_t aNextCh,
|
||||
nsTArray<const char*>& aFontList)
|
||||
{
|
||||
EmojiPresentation emoji = GetEmojiPresentation(aCh);
|
||||
EmojiPresentation eNext = GetEmojiPresentation(aNextCh);
|
||||
EmojiPresentation eNext = GetEmojiPresentation(aNextCh, true);
|
||||
if (aNextCh != kVariationSelector15 &&
|
||||
emoji != EmojiPresentation::TextOnly &&
|
||||
(emoji != EmojiPresentation::TextDefault ||
|
||||
|
||||
@@ -275,10 +275,10 @@ ClusterIterator::Next()
|
||||
IsClusterExtender(ch) ||
|
||||
IsEmojiClusterExtender(ch) ||
|
||||
(baseIsEmoji && prevWasZwj &&
|
||||
((GetEmojiPresentation(ch) == EmojiDefault) ||
|
||||
(GetEmojiPresentation(ch) == EmojiComponent) ||
|
||||
(GetEmojiPresentation(ch) == TextDefault &&
|
||||
GetEmojiPresentation(aExtCh) == EmojiComponent)));
|
||||
((GetEmojiPresentation(ch, true) == EmojiDefault) ||
|
||||
(GetEmojiPresentation(ch, true) == EmojiComponent) ||
|
||||
(GetEmojiPresentation(ch, true) == TextDefault &&
|
||||
GetEmojiPresentation(aExtCh, true) == EmojiComponent)));
|
||||
if (!extendCluster) {
|
||||
break;
|
||||
}
|
||||
@@ -346,7 +346,7 @@ ClusterReverseIterator::Next()
|
||||
}
|
||||
break;
|
||||
}
|
||||
nextWasComponent = (GetEmojiPresentation(ch) == EmojiComponent);
|
||||
nextWasComponent = (GetEmojiPresentation(ch, true) == EmojiComponent);
|
||||
} while ((mPos - tRel) > mLimit);
|
||||
mPos -= tPos;
|
||||
|
||||
|
||||
@@ -184,19 +184,21 @@ IsDefaultIgnorable(uint32_t aCh)
|
||||
}
|
||||
|
||||
inline EmojiPresentation
|
||||
GetEmojiPresentation(uint32_t aCh)
|
||||
GetEmojiPresentation(uint32_t aCh, bool bExt = false)
|
||||
{
|
||||
if (u_hasBinaryProperty(aCh, UCHAR_EMOJI_COMPONENT)) {
|
||||
return EmojiComponent;
|
||||
}
|
||||
if (u_hasBinaryProperty(aCh, UCHAR_EMOJI) &&
|
||||
!u_hasBinaryProperty(aCh, UCHAR_EMOJI_PRESENTATION)) {
|
||||
return TextDefault;
|
||||
if (!u_hasBinaryProperty(aCh, UCHAR_EMOJI)) {
|
||||
return TextOnly;
|
||||
}
|
||||
if (u_hasBinaryProperty(aCh, UCHAR_EXTENDED_PICTOGRAPHIC)) {
|
||||
if (u_hasBinaryProperty(aCh, UCHAR_EMOJI_PRESENTATION)) {
|
||||
return EmojiDefault;
|
||||
}
|
||||
return TextOnly;
|
||||
if (bExt && u_hasBinaryProperty(aCh, UCHAR_EXTENDED_PICTOGRAPHIC)) {
|
||||
return EmojiDefault;
|
||||
}
|
||||
return TextDefault;
|
||||
}
|
||||
|
||||
// returns the simplified Gen Category as defined in nsIUGenCategory
|
||||
|
||||
Reference in New Issue
Block a user