Index: third_party/WebKit/Source/platform/fonts/linux/FontCacheLinux.cpp |
diff --git a/third_party/WebKit/Source/platform/fonts/linux/FontCacheLinux.cpp b/third_party/WebKit/Source/platform/fonts/linux/FontCacheLinux.cpp |
index bfc61b7aae54553b1d14c9cfb2f4ac6ce4a4dec0..f38677a9c622ff50372cd46713e22dafc7ba9d65 100644 |
--- a/third_party/WebKit/Source/platform/fonts/linux/FontCacheLinux.cpp |
+++ b/third_party/WebKit/Source/platform/fonts/linux/FontCacheLinux.cpp |
@@ -43,6 +43,25 @@ FontCache::FontCache() : m_purgePreventCount(0) { |
} |
} |
+// The system UI font is localizable. When not localized, |
+// FontCache::createTypeface() maps "system-ui" to the Skia default font. |
+static AtomicString& mutableSystemFontFamily() { |
+ DEFINE_STATIC_LOCAL(AtomicString, systemFontFamily, |
+ (FontFamilyNames::system_ui)); |
+ return systemFontFamily; |
+} |
+ |
+// static |
+const AtomicString& FontCache::systemFontFamily(float) { |
+ return mutableSystemFontFamily(); |
+} |
+ |
+// static |
+void FontCache::setSystemFontFamily(const char* familyName) { |
+ mutableSystemFontFamily() = |
drott
2016/10/13 07:59:35
Let's DCHECK for a non zero-length familyName argu
kojii
2016/10/13 09:03:20
Done.
|
+ !familyName || !*familyName ? familyName : FontFamilyNames::system_ui; |
+} |
+ |
void FontCache::getFontForCharacter( |
UChar32 c, |
const char* preferredLocale, |