Index: third_party/WebKit/Source/platform/fonts/skia/FontCacheSkia.cpp |
diff --git a/third_party/WebKit/Source/platform/fonts/skia/FontCacheSkia.cpp b/third_party/WebKit/Source/platform/fonts/skia/FontCacheSkia.cpp |
index 16678e70b19b88a6feb4f67e57f32b195d9e5e93..92442840161d800d53c25cdad1d733881de670ba 100644 |
--- a/third_party/WebKit/Source/platform/fonts/skia/FontCacheSkia.cpp |
+++ b/third_party/WebKit/Source/platform/fonts/skia/FontCacheSkia.cpp |
@@ -229,21 +229,33 @@ sk_sp<SkTypeface> FontCache::createTypeface( |
} |
#endif |
+#if OS(WIN) |
+ DCHECK_NE(family, FontFamilyNames::system_ui); |
+ const char* familyNameForSkia = name.data(); |
+#else |
+ // When the system UI font is localized, "system-ui" should have |
+ // been replaced to the localied name. Use the Skia default family |
drott
2016/10/12 11:01:59
Can you add some explanations where was it replace
kojii
2016/10/12 11:14:52
FontCacheLinux already has setSystemFontFamily() i
|
+ // if it is not localized by using nullptr. |
+ const char* familyNameForSkia = |
+ family == FontFamilyNames::system_ui ? nullptr : name.data(); |
+#endif |
+ |
#if OS(LINUX) || OS(WIN) |
// On linux if the fontManager has been overridden then we should be calling |
// the embedder provided font Manager rather than calling |
// SkTypeface::CreateFromName which may redirect the call to the default font |
// Manager. On Windows the font manager is always present. |
- if (m_fontManager) |
+ if (m_fontManager) { |
return sk_sp<SkTypeface>(m_fontManager->matchFamilyStyle( |
- name.data(), fontDescription.skiaFontStyle())); |
+ familyNameForSkia, fontDescription.skiaFontStyle())); |
+ } |
#endif |
// FIXME: Use m_fontManager, matchFamilyStyle instead of |
// legacyCreateTypeface on all platforms. |
sk_sp<SkFontMgr> fm(SkFontMgr::RefDefault()); |
- return sk_sp<SkTypeface>( |
- fm->legacyCreateTypeface(name.data(), fontDescription.skiaFontStyle())); |
+ return sk_sp<SkTypeface>(fm->legacyCreateTypeface( |
+ familyNameForSkia, fontDescription.skiaFontStyle())); |
} |
#if !OS(WIN) |