| Index: third_party/WebKit/Source/platform/fonts/win/FontCacheSkiaWin.cpp
|
| diff --git a/third_party/WebKit/Source/platform/fonts/win/FontCacheSkiaWin.cpp b/third_party/WebKit/Source/platform/fonts/win/FontCacheSkiaWin.cpp
|
| index 9e2f7619b4f1354be3089543ae8859c1a46f10c1..841f46ac90520526b94c3db92c108da9a27ab1c3 100644
|
| --- a/third_party/WebKit/Source/platform/fonts/win/FontCacheSkiaWin.cpp
|
| +++ b/third_party/WebKit/Source/platform/fonts/win/FontCacheSkiaWin.cpp
|
| @@ -52,6 +52,8 @@ int32_t FontCache::s_smallCaptionFontHeight = 0;
|
| AtomicString* FontCache::s_statusFontFamilyName = 0;
|
| int32_t FontCache::s_statusFontHeight = 0;
|
|
|
| +UScriptCode FontCache::m_preferredScriptForHan = USCRIPT_COMMON;
|
| +
|
| namespace {
|
|
|
| int32_t ensureMinimumFontHeightIfNeeded(int32_t fontHeight)
|
| @@ -112,9 +114,25 @@ FontCache::FontCache()
|
| m_fontManager = adoptPtr(fontManager);
|
| }
|
|
|
| -void FontCache::acceptLanguagesChanged(const String&)
|
| +void FontCache::acceptLanguagesChanged(const String& acceptLanguages)
|
| {
|
| - // TODO(kojii): Take acceptLanguages into account for ambiguos scripts.
|
| + // Use the UI locale if it can disambiguate the Unified Han.
|
| + // Since Chrome synchronizes the ICU default locale with its UI locale,
|
| + // this ICU locale tells the current UI locale of Chrome.
|
| + m_preferredScriptForHan = scriptCodeForHanFromLocale(
|
| + icu::Locale::getDefault().getName(), '_');
|
| + if (m_preferredScriptForHan != USCRIPT_COMMON)
|
| + return;
|
| +
|
| + // Use acceptLanguages if it has languages that can disambiguate.
|
| + Vector<String> languages;
|
| + acceptLanguages.split(',', languages);
|
| + for (String token : languages) {
|
| + token = token.stripWhiteSpace();
|
| + m_preferredScriptForHan = scriptCodeForHanFromLocale(token);
|
| + if (m_preferredScriptForHan != USCRIPT_COMMON)
|
| + return;
|
| + }
|
| }
|
|
|
| // Given the desired base font, this will create a SimpleFontData for a specific
|
|
|