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

Unified Diff: Source/platform/fonts/AlternateFontFamily.h

Issue 185863007: Try last resort on no-match in platformFallbackForCharacter on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Unit test 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 | « no previous file | Source/platform/fonts/android/FontCacheAndroid.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/fonts/AlternateFontFamily.h
diff --git a/Source/platform/fonts/AlternateFontFamily.h b/Source/platform/fonts/AlternateFontFamily.h
index efa70144aa82544425263e79b0e9c41f0d5fe133..59a8c23375c49c7ce164bbe495438c15c1af7ea5 100644
--- a/Source/platform/fonts/AlternateFontFamily.h
+++ b/Source/platform/fonts/AlternateFontFamily.h
@@ -106,18 +106,26 @@ inline const AtomicString& alternateFamilyName(const AtomicString& familyName)
inline const AtomicString getFallbackFontFamily(const FontDescription& description)
{
- DEFINE_STATIC_LOCAL(const AtomicString, sansStr, ("Sans", AtomicString::ConstructFromLiteral));
- DEFINE_STATIC_LOCAL(const AtomicString, serifStr, ("Serif", AtomicString::ConstructFromLiteral));
- DEFINE_STATIC_LOCAL(const AtomicString, monospaceStr, ("Monospace", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(const AtomicString, sansStr, ("sans-serif", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(const AtomicString, serifStr, ("serif", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(const AtomicString, monospaceStr, ("monospace", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(const AtomicString, cursiveStr, ("cursive", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(const AtomicString, fantasyStr, ("fantasy", AtomicString::ConstructFromLiteral));
switch (description.genericFamily()) {
+ case FontDescription::SansSerifFamily:
+ return sansStr;
case FontDescription::SerifFamily:
return serifStr;
case FontDescription::MonospaceFamily:
return monospaceStr;
- case FontDescription::SansSerifFamily:
+ case FontDescription::CursiveFamily:
+ return cursiveStr;
+ case FontDescription::FantasyFamily:
+ return fantasyStr;
default:
- return sansStr;
+ // Let the caller use the system default font.
+ return emptyAtom;
}
}
« no previous file with comments | « no previous file | Source/platform/fonts/android/FontCacheAndroid.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698