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

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

Issue 1693563003: Take Accept-Language into account in CJK font fallback for Android/Win (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@aceept-lang
Patch Set: Fix non-Windows builds Created 4 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
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 335b243f3066233ece5ccbb28fe24987cb9ba115..4a5521003683722aebd3769c2c024ad48bd1d514 100644
--- a/third_party/WebKit/Source/platform/fonts/android/FontCacheAndroid.cpp
+++ b/third_party/WebKit/Source/platform/fonts/android/FontCacheAndroid.cpp
@@ -31,6 +31,7 @@
#include "platform/fonts/FontCache.h"
#include "platform/Language.h"
+#include "platform/fonts/AcceptLanguagesResolver.h"
#include "platform/fonts/SimpleFontData.h"
#include "platform/fonts/FontDescription.h"
#include "platform/fonts/FontFaceCreationParams.h"
@@ -57,16 +58,13 @@ static CString toSkFontMgrLocale(const String& locale)
}
}
-void FontCache::acceptLanguagesChanged(const String&)
-{
- // TODO(kojii): Take acceptLanguages into account for ambiguos scripts.
-}
-
static AtomicString getFamilyNameForCharacter(UChar32 c, const FontDescription& fontDescription)
{
RefPtr<SkFontMgr> fm = adoptRef(SkFontMgr::RefDefault());
- const char* bcp47Locales[2];
+ const char* bcp47Locales[3];
int localeCount = 0;
+ if (const char* hanLocale = AcceptLanguagesResolver::preferredHanSkFontMgrLocale())
+ bcp47Locales[localeCount++] = hanLocale;
CString defaultLocale = toSkFontMgrLocale(defaultLanguage());
bcp47Locales[localeCount++] = defaultLocale.data();
CString fontLocale;

Powered by Google App Engine
This is Rietveld 408576698