summaryrefslogtreecommitdiffstats
path: root/gfx/thebes/gfxAndroidPlatform.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/gfxAndroidPlatform.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/gfxAndroidPlatform.cpp')
-rw-r--r--gfx/thebes/gfxAndroidPlatform.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/gfx/thebes/gfxAndroidPlatform.cpp b/gfx/thebes/gfxAndroidPlatform.cpp
index f587737b5..76427d88c 100644
--- a/gfx/thebes/gfxAndroidPlatform.cpp
+++ b/gfx/thebes/gfxAndroidPlatform.cpp
@@ -21,6 +21,7 @@
#include "nsIScreenManager.h"
#include "nsILocaleService.h"
#include "nsServiceManagerUtils.h"
+#include "nsUnicodeProperties.h"
#include "gfxPrefs.h"
#include "cairo.h"
#include "VsyncSource.h"
@@ -32,6 +33,7 @@
using namespace mozilla;
using namespace mozilla::dom;
using namespace mozilla::gfx;
+using namespace mozilla::unicode;
static FT_Library gPlatformFTLibrary = nullptr;
@@ -168,19 +170,17 @@ gfxAndroidPlatform::GetCommonFallbackFonts(uint32_t aCh, uint32_t aNextCh,
static const char kNotoSansCJKJP[] = "Noto Sans CJK JP";
static const char kNotoColorEmoji[] = "Noto Color Emoji";
- if (aNextCh == 0xfe0fu) {
- // if char is followed by VS16, try for a color emoji glyph
- aFontList.AppendElement(kNotoColorEmoji);
+ 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(kNotoColorEmoji);
+ }
}
- if (!IS_IN_BMP(aCh)) {
- uint32_t p = aCh >> 16;
- if (p == 1) { // try color emoji font, unless VS15 (text style) present
- if (aNextCh != 0xfe0fu && aNextCh != 0xfe0eu) {
- aFontList.AppendElement(kNotoColorEmoji);
- }
- }
- } else {
+ if (IS_IN_BMP(aCh)) {
// try language-specific "Droid Sans *" and "Noto Sans *" fonts for
// certain blocks, as most devices probably have these
uint8_t block = (aCh >> 8) & 0xff;