Chromium Code Reviews| Index: third_party/WebKit/Source/platform/fonts/mac/FontCacheMac.mm |
| diff --git a/third_party/WebKit/Source/platform/fonts/mac/FontCacheMac.mm b/third_party/WebKit/Source/platform/fonts/mac/FontCacheMac.mm |
| index 0ea373417959f4aa4d374ba9457769928ce2d893..63a7c87caa69b0bf60ae5840457825d634d957af 100644 |
| --- a/third_party/WebKit/Source/platform/fonts/mac/FontCacheMac.mm |
| +++ b/third_party/WebKit/Source/platform/fonts/mac/FontCacheMac.mm |
| @@ -53,6 +53,15 @@ |
| namespace blink { |
| +// Unfortunately, these chosen font names require a bit of experimentation and |
| +// researching on the respective platforms as to what works best and is widely |
| +// available. They may require further tuning after OS updates. Mozilla's |
| +// choices in the gfxPlatformMac::GetCommonFallbackFonts method collects some of |
| +// the outcome of this experimentation. |
| +const char* kColorEmojiFontsMac[] = { "Apple Color Emoji" }; |
| +const char* kTextEmojiFontsMac[] = { "Hiragino Kaku Gothic ProN", "Zapf Dingbats", "Apple Symbols" }; |
| +const char* kSymbolsAndMathFontsMac[] = { "Menlo", "Arial Unicode MS" }; |
| + |
| static void invalidateFontCache() |
| { |
| if (!isMainThread()) { |
| @@ -216,4 +225,29 @@ PassOwnPtr<FontPlatformData> FontCache::createFontPlatformData(const FontDescrip |
| return platformData.release(); |
| } |
| + |
|
wkorman
2016/02/02 19:04:08
-1 blank
|
| +const Vector<AtomicString> FontCache::platformFontListForFallbackPriority(FontFallbackPriority fallbackPriority) const |
| +{ |
| + Vector<AtomicString> returnVector; |
| + switch (fallbackPriority) { |
| + case FontFallbackPriority::EmojiEmoji: |
| + for (size_t i = 0; i < WTF_ARRAY_LENGTH(kColorEmojiFontsMac); ++i) |
| + returnVector.append(kColorEmojiFontsMac[i]); |
| + break; |
| + case FontFallbackPriority::EmojiText: |
| + for (size_t i = 0; i < WTF_ARRAY_LENGTH(kTextEmojiFontsMac); ++i) |
| + returnVector.append(kTextEmojiFontsMac[i]); |
| + break; |
| + case FontFallbackPriority::Math: |
| + case FontFallbackPriority::Symbols: |
| + for (size_t i = 0; i < WTF_ARRAY_LENGTH(kSymbolsAndMathFontsMac); ++i) |
| + returnVector.append(kSymbolsAndMathFontsMac[i]); |
| + break; |
| + default: |
| + ASSERT_NOT_REACHED(); |
| + } |
| + return returnVector; |
| +} |
| + |
|
wkorman
2016/02/02 19:04:08
-1 blank
|
| + |
| } // namespace blink |