Issue #2492 - Standardized use of Emoji Character Properties

Detection of Emoji Components, for use as suffixes of TextDefault.
Detection of Non-Presentation Emojis as TextDefault.
Detection of all Extended Pictographics as EmojiDefault.
This commit is contained in:
Andy 2024-03-30 04:57:12 -07:00 committed by roytam1
commit 69f3b4e199
5 changed files with 33 additions and 32 deletions

View file

@ -638,14 +638,12 @@ gfxWindowsPlatform::GetCommonFallbackFonts(uint32_t aCh, uint32_t aNextCh,
nsTArray<const char*>& aFontList)
{
EmojiPresentation emoji = GetEmojiPresentation(aCh);
if (emoji != EmojiPresentation::TextOnly) {
if (aNextCh == kVariationSelector16 ||
(aNextCh != kVariationSelector15 &&
emoji == EmojiPresentation::EmojiDefault)) {
// if char is followed by VS16, try for a color emoji glyph
// XXX: For Win8+ native, aFontList.AppendElement(kFontSegoeUIEmoji);
aFontList.AppendElement(kFontTwemojiMozilla);
}
EmojiPresentation eNext = GetEmojiPresentation(aNextCh);
if (aNextCh != kVariationSelector15 &&
emoji != EmojiPresentation::TextOnly &&
(emoji != EmojiPresentation::TextDefault ||
eNext == EmojiPresentation::EmojiComponent)) {
aFontList.AppendElement(kFontTwemojiMozilla);
}
// Arial is used as the default fallback for system fallback