Index: Source/platform/fonts/android/FontCacheAndroid.cpp |
diff --git a/Source/platform/fonts/android/FontCacheAndroid.cpp b/Source/platform/fonts/android/FontCacheAndroid.cpp |
index 59dafdc1c8143bee60cb8bcf82727242a9e53dfd..25c4c75952334abb3ac35a654647c846e25eb5b0 100644 |
--- a/Source/platform/fonts/android/FontCacheAndroid.cpp |
+++ b/Source/platform/fonts/android/FontCacheAndroid.cpp |
@@ -43,7 +43,16 @@ namespace blink { |
static AtomicString getFamilyNameForCharacter(UChar32 c, const FontDescription& fontDescription) |
{ |
RefPtr<SkFontMgr> fm = adoptRef(SkFontMgr::RefDefault()); |
- RefPtr<SkTypeface> typeface = adoptRef(fm->matchFamilyStyleCharacter(0, SkFontStyle(), fontDescription.locale().isEmpty() ? defaultLanguage().ascii().data() : fontDescription.locale().ascii().data(), c)); |
+ const char* bcp47Locales[2]; |
+ int localeCount = 0; |
+ CString defaultLocale = defaultLanguage().ascii(); |
+ bcp47Locales[localeCount++] = defaultLocale.data(); |
+ CString fontLocale; |
+ if (!fontDescription.locale().isEmpty()) { |
+ fontLocale = fontDescription.locale().ascii(); |
+ bcp47Locales[localeCount++] = fontLocale.data(); |
+ } |
+ RefPtr<SkTypeface> typeface = adoptRef(fm->matchFamilyStyleCharacter(0, SkFontStyle(), bcp47Locales, localeCount, c)); |
if (!typeface) |
return emptyAtom; |