summaryrefslogtreecommitdiffstats
path: root/gfx/thebes/gfxPlatformMac.cpp
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-05-09 19:41:33 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-05-09 19:41:33 +0200
commitfd2b227f19844978021811e9e1a60b8bcbd1ecad (patch)
treea378867115a91a3f33ff019f2c303b0406b1c688 /gfx/thebes/gfxPlatformMac.cpp
parentaa662adcfc086965ee9ecdcf4d2c01a1c4869efa (diff)
parent2619698a2eb7363940d1e6a2d71a9ce7b366d3f5 (diff)
downloadUXP-fd2b227f19844978021811e9e1a60b8bcbd1ecad.tar
UXP-fd2b227f19844978021811e9e1a60b8bcbd1ecad.tar.gz
UXP-fd2b227f19844978021811e9e1a60b8bcbd1ecad.tar.lz
UXP-fd2b227f19844978021811e9e1a60b8bcbd1ecad.tar.xz
UXP-fd2b227f19844978021811e9e1a60b8bcbd1ecad.zip
Merge branch 'intl-ICU-emoji-work'
Diffstat (limited to 'gfx/thebes/gfxPlatformMac.cpp')
-rw-r--r--gfx/thebes/gfxPlatformMac.cpp23
1 files changed, 13 insertions, 10 deletions
diff --git a/gfx/thebes/gfxPlatformMac.cpp b/gfx/thebes/gfxPlatformMac.cpp
index 3216f0f07..79684dd19 100644
--- a/gfx/thebes/gfxPlatformMac.cpp
+++ b/gfx/thebes/gfxPlatformMac.cpp
@@ -18,6 +18,7 @@
#include "nsTArray.h"
#include "mozilla/Preferences.h"
#include "mozilla/VsyncDispatcher.h"
+#include "nsUnicodeProperties.h"
#include "qcms.h"
#include "gfx2DGlue.h"
@@ -29,6 +30,7 @@
using namespace mozilla;
using namespace mozilla::gfx;
+using namespace mozilla::unicode;
// cribbed from CTFontManager.h
enum {
@@ -195,23 +197,24 @@ gfxPlatformMac::GetCommonFallbackFonts(uint32_t aCh, uint32_t aNextCh,
Script aRunScript,
nsTArray<const char*>& aFontList)
{
- if (aNextCh == 0xfe0f) {
- aFontList.AppendElement(kFontAppleColorEmoji);
+ 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
+ aFontList.AppendElement(kFontAppleColorEmoji);
+ }
}
aFontList.AppendElement(kFontLucidaGrande);
if (!IS_IN_BMP(aCh)) {
uint32_t p = aCh >> 16;
- uint32_t b = aCh >> 8;
if (p == 1) {
- if (b >= 0x1f0 && b < 0x1f7) {
- aFontList.AppendElement(kFontAppleColorEmoji);
- } else {
- aFontList.AppendElement(kFontAppleSymbols);
- aFontList.AppendElement(kFontSTIXGeneral);
- aFontList.AppendElement(kFontGeneva);
- }
+ aFontList.AppendElement(kFontAppleSymbols);
+ aFontList.AppendElement(kFontSTIXGeneral);
+ aFontList.AppendElement(kFontGeneva);
} else if (p == 2) {
// OSX installations with MS Office may have these fonts
aFontList.AppendElement(kFontMingLiUExtB);