summaryrefslogtreecommitdiffstats
path: root/gfx/thebes/gfxWindowsPlatform.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gfx/thebes/gfxWindowsPlatform.cpp')
-rwxr-xr-xgfx/thebes/gfxWindowsPlatform.cpp26
1 files changed, 12 insertions, 14 deletions
diff --git a/gfx/thebes/gfxWindowsPlatform.cpp b/gfx/thebes/gfxWindowsPlatform.cpp
index af4d932a9..c68f622c6 100755
--- a/gfx/thebes/gfxWindowsPlatform.cpp
+++ b/gfx/thebes/gfxWindowsPlatform.cpp
@@ -13,6 +13,7 @@
#include "gfxWindowsSurface.h"
#include "nsUnicharUtils.h"
+#include "nsUnicodeProperties.h"
#include "mozilla/Preferences.h"
#include "mozilla/Services.h"
@@ -81,6 +82,7 @@ using namespace mozilla::gfx;
using namespace mozilla::layers;
using namespace mozilla::widget;
using namespace mozilla::image;
+using namespace mozilla::unicode;
IDWriteRenderingParams* GetDwriteRenderingParams(bool aGDI)
{
@@ -669,9 +671,15 @@ gfxWindowsPlatform::GetCommonFallbackFonts(uint32_t aCh, uint32_t aNextCh,
Script aRunScript,
nsTArray<const char*>& aFontList)
{
- if (aNextCh == 0xfe0fu) {
- aFontList.AppendElement(kFontSegoeUIEmoji);
- aFontList.AppendElement(kFontTwemojiMozilla);
+ 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);
+ }
}
// Arial is used as the default fallback for system fallback
@@ -680,17 +688,7 @@ gfxWindowsPlatform::GetCommonFallbackFonts(uint32_t aCh, uint32_t aNextCh,
if (!IS_IN_BMP(aCh)) {
uint32_t p = aCh >> 16;
if (p == 1) { // SMP plane
- if (aNextCh == 0xfe0eu) {
- aFontList.AppendElement(kFontSegoeUISymbol);
- aFontList.AppendElement(kFontSegoeUIEmoji);
- aFontList.AppendElement(kFontTwemojiMozilla);
- } else {
- if (aNextCh != 0xfe0fu) {
- aFontList.AppendElement(kFontSegoeUIEmoji);
- aFontList.AppendElement(kFontTwemojiMozilla);
- }
- aFontList.AppendElement(kFontSegoeUISymbol);
- }
+ aFontList.AppendElement(kFontSegoeUISymbol);
aFontList.AppendElement(kFontEbrima);
aFontList.AppendElement(kFontNirmalaUI);
aFontList.AppendElement(kFontCambriaMath);