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

Unified Diff: Source/platform/fonts/skia/FontCacheSkia.cpp

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 | « Source/platform/fonts/android/FontCacheAndroidTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/fonts/skia/FontCacheSkia.cpp
diff --git a/Source/platform/fonts/skia/FontCacheSkia.cpp b/Source/platform/fonts/skia/FontCacheSkia.cpp
index 7536ca53791c68ac1b1c4ec7496836f408139f77..fb66bfe5369048262b7e267abccdca6557de49b8 100644
--- a/Source/platform/fonts/skia/FontCacheSkia.cpp
+++ b/Source/platform/fonts/skia/FontCacheSkia.cpp
@@ -86,7 +86,7 @@ PassRefPtr<SimpleFontData> FontCache::platformFallbackForCharacter(const FontDes
return fontDataFromFontPlatformData(&platformData, DoNotRetain);
}
-#endif // !OS(WINDOWNS) && !OS(ANDROID)
+#endif // !OS(WIN) && !OS(ANDROID)
PassRefPtr<SimpleFontData> FontCache::getLastResortFallbackFont(const FontDescription& description, ShouldRetain shouldRetain)
{
@@ -107,29 +107,10 @@ PassRefPtr<SimpleFontData> FontCache::getLastResortFallbackFont(const FontDescri
PassRefPtr<SkTypeface> FontCache::createTypeface(const FontDescription& fontDescription, const AtomicString& family, CString& name)
{
- name = "";
-
// If we're creating a fallback font (e.g. "-webkit-monospace"), convert the name into
// the fallback name (like "monospace") that fontconfig understands.
if (!family.length() || family.startsWith("-webkit-")) {
- static const struct {
- FontDescription::GenericFamilyType mType;
- const char* mName;
- } fontDescriptions[] = {
- { FontDescription::SerifFamily, "serif" },
- { FontDescription::SansSerifFamily, "sans-serif" },
- { FontDescription::MonospaceFamily, "monospace" },
- { FontDescription::CursiveFamily, "cursive" },
- { FontDescription::FantasyFamily, "fantasy" }
- };
-
- FontDescription::GenericFamilyType type = fontDescription.genericFamily();
- for (unsigned i = 0; i < SK_ARRAY_COUNT(fontDescriptions); i++) {
- if (type == fontDescriptions[i].mType) {
- name = fontDescriptions[i].mName;
- break;
- }
- }
+ name = getFallbackFontFamily(fontDescription).string().utf8();
} else {
// convert the name to utf8
name = family.utf8();
@@ -167,6 +148,6 @@ FontPlatformData* FontCache::createFontPlatformData(const FontDescription& fontD
fontDescription.useSubpixelPositioning());
return result;
}
-#endif // !OS(WINDOWNS)
+#endif // !OS(WIN)
} // namespace WebCore
« no previous file with comments | « Source/platform/fonts/android/FontCacheAndroidTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698