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

Side by Side Diff: third_party/WebKit/Source/platform/fonts/skia/FontCacheSkia.cpp

Issue 2302663002: Add more last resort fallback fonts in the vague hope that at least one can be loaded successfully. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 3 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 | « content/browser/renderer_host/dwrite_font_proxy_message_filter_win.cc ('k') | no next file » | 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, 2007, 2008, 2009 Google Inc. All rights reserved. 2 * Copyright (c) 2006, 2007, 2008, 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 #if OS(WIN) 141 #if OS(WIN)
142 // Try some more Windows-specific fallbacks. 142 // Try some more Windows-specific fallbacks.
143 if (!fontPlatformData) { 143 if (!fontPlatformData) {
144 DEFINE_STATIC_LOCAL(const FontFaceCreationParams, msuigothicCreationPara ms, (AtomicString("MS UI Gothic"))); 144 DEFINE_STATIC_LOCAL(const FontFaceCreationParams, msuigothicCreationPara ms, (AtomicString("MS UI Gothic")));
145 fontPlatformData = getFontPlatformData(description, msuigothicCreationPa rams); 145 fontPlatformData = getFontPlatformData(description, msuigothicCreationPa rams);
146 } 146 }
147 if (!fontPlatformData) { 147 if (!fontPlatformData) {
148 DEFINE_STATIC_LOCAL(const FontFaceCreationParams, mssansserifCreationPar ams, (AtomicString("Microsoft Sans Serif"))); 148 DEFINE_STATIC_LOCAL(const FontFaceCreationParams, mssansserifCreationPar ams, (AtomicString("Microsoft Sans Serif")));
149 fontPlatformData = getFontPlatformData(description, mssansserifCreationP arams); 149 fontPlatformData = getFontPlatformData(description, mssansserifCreationP arams);
150 } 150 }
151 if (!fontPlatformData) {
152 DEFINE_STATIC_LOCAL(const FontFaceCreationParams, segoeuiCreationParams, (AtomicString("Segoe UI")));
153 fontPlatformData = getFontPlatformData(description, segoeuiCreationParam s);
154 }
155 if (!fontPlatformData) {
156 DEFINE_STATIC_LOCAL(const FontFaceCreationParams, calibriCreationParams, (AtomicString("Calibri")));
157 fontPlatformData = getFontPlatformData(description, calibriCreationParam s);
158 }
159 if (!fontPlatformData) {
160 DEFINE_STATIC_LOCAL(const FontFaceCreationParams, timesnewromanCreationP arams, (AtomicString("Times New Roman")));
161 fontPlatformData = getFontPlatformData(description, timesnewromanCreatio nParams);
162 }
163 if (!fontPlatformData) {
164 DEFINE_STATIC_LOCAL(const FontFaceCreationParams, couriernewCreationPara ms, (AtomicString("Courier New")));
165 fontPlatformData = getFontPlatformData(description, couriernewCreationPa rams);
166 }
151 #endif 167 #endif
152 168
153 ASSERT(fontPlatformData); 169 ASSERT(fontPlatformData);
154 return fontDataFromFontPlatformData(fontPlatformData, shouldRetain); 170 return fontDataFromFontPlatformData(fontPlatformData, shouldRetain);
155 } 171 }
156 172
157 PassRefPtr<SkTypeface> FontCache::createTypeface(const FontDescription& fontDesc ription, const FontFaceCreationParams& creationParams, CString& name) 173 PassRefPtr<SkTypeface> FontCache::createTypeface(const FontDescription& fontDesc ription, const FontFaceCreationParams& creationParams, CString& name)
158 { 174 {
159 #if !OS(WIN) && !OS(ANDROID) 175 #if !OS(WIN) && !OS(ANDROID)
160 if (creationParams.creationType() == CreateFontByFciIdAndTtcIndex) { 176 if (creationParams.creationType() == CreateFontByFciIdAndTtcIndex) {
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 return wrapUnique(new FontPlatformData(tf, 227 return wrapUnique(new FontPlatformData(tf,
212 name.data(), 228 name.data(),
213 fontSize, 229 fontSize,
214 (numericFontWeight(fontDescription.weight()) > 200 + tf->fontStyle().wei ght()) || fontDescription.isSyntheticBold(), 230 (numericFontWeight(fontDescription.weight()) > 200 + tf->fontStyle().wei ght()) || fontDescription.isSyntheticBold(),
215 ((fontDescription.style() == FontStyleItalic || fontDescription.style() == FontStyleOblique) && !tf->isItalic()) || fontDescription.isSyntheticItalic(), 231 ((fontDescription.style() == FontStyleItalic || fontDescription.style() == FontStyleOblique) && !tf->isItalic()) || fontDescription.isSyntheticItalic(),
216 fontDescription.orientation())); 232 fontDescription.orientation()));
217 } 233 }
218 #endif // !OS(WIN) 234 #endif // !OS(WIN)
219 235
220 } // namespace blink 236 } // namespace blink
OLDNEW
« no previous file with comments | « content/browser/renderer_host/dwrite_font_proxy_message_filter_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698