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

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

Issue 381893002: Do not specify language for font fallback (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Passing rebaseline job to bots Created 6 years, 5 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 | « Source/platform/exported/linux/WebFontInfo.cpp ('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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 { 89 {
90 // First try the specified font with standard style & weight. 90 // First try the specified font with standard style & weight.
91 if (fontDescription.style() == FontStyleItalic 91 if (fontDescription.style() == FontStyleItalic
92 || fontDescription.weight() >= FontWeight600) { 92 || fontDescription.weight() >= FontWeight600) {
93 RefPtr<SimpleFontData> fontData = fallbackOnStandardFontStyle( 93 RefPtr<SimpleFontData> fontData = fallbackOnStandardFontStyle(
94 fontDescription, c); 94 fontDescription, c);
95 if (fontData) 95 if (fontData)
96 return fontData; 96 return fontData;
97 } 97 }
98 98
99 icu::Locale locale = icu::Locale::getDefault();
100 FontCache::PlatformFallbackFont fallbackFont; 99 FontCache::PlatformFallbackFont fallbackFont;
101 FontCache::getFontForCharacter(c, locale.getLanguage(), &fallbackFont); 100 FontCache::getFontForCharacter(c, "", &fallbackFont);
102 if (fallbackFont.name.isEmpty()) 101 if (fallbackFont.name.isEmpty())
103 return nullptr; 102 return nullptr;
104 103
105 FontFaceCreationParams creationParams; 104 FontFaceCreationParams creationParams;
106 creationParams = FontFaceCreationParams(fallbackFont.filename, fallbackFont. fontconfigInterfaceId, fallbackFont.ttcIndex); 105 creationParams = FontFaceCreationParams(fallbackFont.filename, fallbackFont. fontconfigInterfaceId, fallbackFont.ttcIndex);
107 106
108 // Changes weight and/or italic of given FontDescription depends on 107 // Changes weight and/or italic of given FontDescription depends on
109 // the result of fontconfig so that keeping the correct font mapping 108 // the result of fontconfig so that keeping the correct font mapping
110 // of the given character. See http://crbug.com/32109 for details. 109 // of the given character. See http://crbug.com/32109 for details.
111 bool shouldSetSyntheticBold = false; 110 bool shouldSetSyntheticBold = false;
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 fontSize, 214 fontSize,
216 (fontDescription.weight() >= FontWeight600 && !tf->isBold()) || fontDesc ription.isSyntheticBold(), 215 (fontDescription.weight() >= FontWeight600 && !tf->isBold()) || fontDesc ription.isSyntheticBold(),
217 (fontDescription.style() && !tf->isItalic()) || fontDescription.isSynthe ticItalic(), 216 (fontDescription.style() && !tf->isItalic()) || fontDescription.isSynthe ticItalic(),
218 fontDescription.orientation(), 217 fontDescription.orientation(),
219 fontDescription.useSubpixelPositioning()); 218 fontDescription.useSubpixelPositioning());
220 return result; 219 return result;
221 } 220 }
222 #endif // !OS(WIN) 221 #endif // !OS(WIN)
223 222
224 } // namespace WebCore 223 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/platform/exported/linux/WebFontInfo.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698