Index: Source/platform/fonts/win/FontFallbackWin.cpp |
diff --git a/Source/platform/fonts/win/FontFallbackWin.cpp b/Source/platform/fonts/win/FontFallbackWin.cpp |
index a7f5be4cdc1052d3035da781586990baa85dbd20..d1f5340ea33a05a431bf4e027656eb7957eb234e 100644 |
--- a/Source/platform/fonts/win/FontFallbackWin.cpp |
+++ b/Source/platform/fonts/win/FontFallbackWin.cpp |
@@ -285,8 +285,10 @@ UScriptCode getScript(int ucs4) |
const UChar* getFontBasedOnUnicodeBlock(int ucs4, SkFontMgr* fontManager) |
{ |
static const UChar* emojiFonts[] = {L"Segoe UI Emoji", L"Segoe UI Symbol"}; |
+ static const UChar* mathFonts[] = {L"Cambria Math", L"Segoe UI Symbol", L"Code2000"}; |
static const UChar* symbolFont = L"Segoe UI Symbol"; |
static const UChar* emojiFont = 0; |
+ static const UChar* mathFont = 0; |
static bool initialized = false; |
if (!initialized) { |
for (size_t i = 0; i < WTF_ARRAY_LENGTH(emojiFonts); i++) { |
@@ -295,6 +297,12 @@ const UChar* getFontBasedOnUnicodeBlock(int ucs4, SkFontMgr* fontManager) |
break; |
} |
} |
+ for (size_t i = 0; i < WTF_ARRAY_LENGTH(mathFonts); i++) { |
+ if (isFontPresent(mathFonts[i], fontManager)) { |
+ mathFont = mathFonts[i]; |
+ break; |
+ } |
+ } |
initialized = true; |
} |
@@ -302,16 +310,30 @@ const UChar* getFontBasedOnUnicodeBlock(int ucs4, SkFontMgr* fontManager) |
switch (block) { |
case UBLOCK_EMOTICONS: |
return emojiFont; |
+ case UBLOCK_ENCLOSED_ALPHANUMERIC_SUPPLEMENT: |
ebraminio
2015/09/04 21:28:24
Sorry, UBLOCK_ENCLOSED_ALPHANUMERIC_SUPPLEMENT whi
|
case UBLOCK_PLAYING_CARDS: |
case UBLOCK_MISCELLANEOUS_SYMBOLS: |
+ case UBLOCK_MISCELLANEOUS_SYMBOLS_AND_ARROWS: |
case UBLOCK_MISCELLANEOUS_SYMBOLS_AND_PICTOGRAPHS: |
- case UBLOCK_MISCELLANEOUS_TECHNICAL: |
case UBLOCK_TRANSPORT_AND_MAP_SYMBOLS: |
case UBLOCK_ALCHEMICAL_SYMBOLS: |
case UBLOCK_RUNIC: |
- case UBLOCK_SUPPLEMENTAL_MATHEMATICAL_OPERATORS: |
case UBLOCK_DINGBATS: |
+ case UBLOCK_GOTHIC: |
return symbolFont; |
+ case UBLOCK_ARROWS: |
+ case UBLOCK_MATHEMATICAL_OPERATORS: |
+ case UBLOCK_MISCELLANEOUS_TECHNICAL: |
+ case UBLOCK_GEOMETRIC_SHAPES: |
+ case UBLOCK_MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A: |
+ case UBLOCK_SUPPLEMENTAL_ARROWS_A: |
+ case UBLOCK_SUPPLEMENTAL_ARROWS_B: |
+ case UBLOCK_MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B: |
+ case UBLOCK_SUPPLEMENTAL_MATHEMATICAL_OPERATORS: |
+ case UBLOCK_MATHEMATICAL_ALPHANUMERIC_SYMBOLS: |
+ case UBLOCK_ARABIC_MATHEMATICAL_ALPHABETIC_SYMBOLS: |
+ case UBLOCK_GEOMETRIC_SHAPES_EXTENDED: |
+ return mathFont; |
default: |
return 0; |
}; |