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

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: Add test 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..470ed688837bd9f1fea2c58f62199dc156d71ee8 100644
--- a/third_party/WebKit/Source/platform/fonts/android/FontCacheAndroid.cpp
+++ b/third_party/WebKit/Source/platform/fonts/android/FontCacheAndroid.cpp
@@ -51,6 +51,13 @@ 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.
drott 2016/08/30 08:18:58 Looks okay to me but let's file a bug to keep trac
+ 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.
UChar32 examplerChar;
« 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