Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(584)

Unified Diff: Source/core/css/CSSFontSelector.cpp

Issue 184703003: Fix generic font family issue on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/platform/android/fast/text/international/non-generic-font-fallback-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/CSSFontSelector.cpp
diff --git a/Source/core/css/CSSFontSelector.cpp b/Source/core/css/CSSFontSelector.cpp
index a15bf91dd170b804f130c4a6300cbe7fe83a3c8b..618fea40bc886a21d0a330f333604346dc8f4d91 100644
--- a/Source/core/css/CSSFontSelector.cpp
+++ b/Source/core/css/CSSFontSelector.cpp
@@ -156,12 +156,15 @@ static AtomicString familyNameFromSettings(const GenericFontFamilySettings& sett
{
UScriptCode script = fontDescription.script();
+#if OS(ANDROID)
if (fontDescription.genericFamily() == FontDescription::StandardFamily && !fontDescription.isSpecifiedFont())
- return settings.standard(script);
+ return FontCache::getGenericFamilyNameForScript(FontFamilyNames::webkit_standard, script);
dglazkov 2014/02/28 21:30:30 This is okay, but can we not instead unfork this c
Xianzhu 2014/02/28 22:15:12 FontCache::getFontFamilyForCharacter doesn't actua
-#if OS(ANDROID)
- return FontCache::getGenericFamilyNameForScript(genericFamilyName, script);
+ if (genericFamilyName.startsWith("-webkit-"))
+ return FontCache::getGenericFamilyNameForScript(genericFamilyName, script);
#else
+ if (fontDescription.genericFamily() == FontDescription::StandardFamily && !fontDescription.isSpecifiedFont())
+ return settings.standard(script);
if (genericFamilyName == FontFamilyNames::webkit_serif)
return settings.serif(script);
if (genericFamilyName == FontFamilyNames::webkit_sans_serif)
« no previous file with comments | « LayoutTests/platform/android/fast/text/international/non-generic-font-fallback-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698