Chromium Code Reviews| 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..f2c6de5b5186ddcb1042ff950690ecdc2b94882b 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 fontLocale; |
| + if (!fontDescription.locale().isEmpty()) { |
| + fontLocale = fontDescription.locale().ascii(); |
| + bcp47Locales[localeCount++] = fontLocale.data(); |
| + } |
| + CString defaultLocale = defaultLanguage().ascii(); |
| + bcp47Locales[localeCount++] = defaultLocale.data(); |
|
bungeman-chromium
2014/10/23 16:55:41
I now have this documented and working more like a
|
| + RefPtr<SkTypeface> typeface = adoptRef(fm->matchFamilyStyleCharacter(0, SkFontStyle(), bcp47Locales, localeCount, c)); |
| if (!typeface) |
| return emptyAtom; |