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

Unified Diff: third_party/WebKit/Source/platform/fonts/android/FontCacheAndroid.cpp

Issue 2288383002: Disable CJK specific generic font families for monospace on Android (Closed)
Patch Set: drott review, updated comments Created 4 years, 4 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 | third_party/WebKit/Source/platform/fonts/android/FontCacheAndroidTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/fonts/android/FontCacheAndroid.cpp
diff --git a/third_party/WebKit/Source/platform/fonts/android/FontCacheAndroid.cpp b/third_party/WebKit/Source/platform/fonts/android/FontCacheAndroid.cpp
index 0f24adb0b2c607e6552601f822c07fc74842941e..c580ac0160534f2202c41b5317689ebc60b9e59e 100644
--- a/third_party/WebKit/Source/platform/fonts/android/FontCacheAndroid.cpp
+++ b/third_party/WebKit/Source/platform/fonts/android/FontCacheAndroid.cpp
@@ -51,8 +51,17 @@ PassRefPtr<SimpleFontData> FontCache::fallbackFontForCharacter(const FontDescrip
// static
AtomicString FontCache::getGenericFamilyNameForScript(const AtomicString& familyName, const FontDescription& fontDescription)
{
+ // If monospace, do not apply CJK hack to find i18n fonts, because
+ // i18n fonts are likely not monospace. Monospace is mostly used
+ // for code, but when i18n characters appear in monospace, system
+ // fallback can still render the characters.
+ if (familyName == FontFamilyNames::webkit_monospace)
+ return familyName;
+
// This is a hack to use the preferred font for CJK scripts.
- // FIXME: Use new Skia API once Android system supports per-family and per-script fallback fonts.
+ // TODO(kojii): This logic disregards either generic family name
+ // or locale. We need an API that honors both to find appropriate
+ // fonts. crbug.com/642340
UChar32 examplerChar;
switch (fontDescription.script()) {
case USCRIPT_SIMPLIFIED_HAN:
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/fonts/android/FontCacheAndroidTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698