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: |