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

Side by Side 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, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | Source/platform/fonts/android/FontCacheAndroid.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> 3 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com>
4 * Copyright (C) 2013 Google, Inc. All rights reserved. 4 * Copyright (C) 2013 Google, Inc. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 9 *
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 return helvetica; 99 return helvetica;
100 if (equalIgnoringCase(familyName, helvetica)) 100 if (equalIgnoringCase(familyName, helvetica))
101 return arial; 101 return arial;
102 102
103 return emptyAtom; 103 return emptyAtom;
104 } 104 }
105 105
106 106
107 inline const AtomicString getFallbackFontFamily(const FontDescription& descripti on) 107 inline const AtomicString getFallbackFontFamily(const FontDescription& descripti on)
108 { 108 {
109 DEFINE_STATIC_LOCAL(const AtomicString, sansStr, ("Sans", AtomicString::Cons tructFromLiteral)); 109 DEFINE_STATIC_LOCAL(const AtomicString, sansStr, ("sans-serif", AtomicString ::ConstructFromLiteral));
110 DEFINE_STATIC_LOCAL(const AtomicString, serifStr, ("Serif", AtomicString::Co nstructFromLiteral)); 110 DEFINE_STATIC_LOCAL(const AtomicString, serifStr, ("serif", AtomicString::Co nstructFromLiteral));
111 DEFINE_STATIC_LOCAL(const AtomicString, monospaceStr, ("Monospace", AtomicSt ring::ConstructFromLiteral)); 111 DEFINE_STATIC_LOCAL(const AtomicString, monospaceStr, ("monospace", AtomicSt ring::ConstructFromLiteral));
112 DEFINE_STATIC_LOCAL(const AtomicString, cursiveStr, ("cursive", AtomicString ::ConstructFromLiteral));
113 DEFINE_STATIC_LOCAL(const AtomicString, fantasyStr, ("fantasy", AtomicString ::ConstructFromLiteral));
112 114
113 switch (description.genericFamily()) { 115 switch (description.genericFamily()) {
116 case FontDescription::SansSerifFamily:
117 return sansStr;
114 case FontDescription::SerifFamily: 118 case FontDescription::SerifFamily:
115 return serifStr; 119 return serifStr;
116 case FontDescription::MonospaceFamily: 120 case FontDescription::MonospaceFamily:
117 return monospaceStr; 121 return monospaceStr;
118 case FontDescription::SansSerifFamily: 122 case FontDescription::CursiveFamily:
123 return cursiveStr;
124 case FontDescription::FantasyFamily:
125 return fantasyStr;
119 default: 126 default:
120 return sansStr; 127 // Let the caller use the system default font.
128 return emptyAtom;
121 } 129 }
122 } 130 }
123 131
124 } // namespace WebCore 132 } // namespace WebCore
125 133
126 #endif // AlternateFontFamily_h 134 #endif // AlternateFontFamily_h
OLDNEW
« 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