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

Unified Diff: third_party/WebKit/Source/platform/fonts/FontCache.cpp

Issue 1883483002: Add code to call skia's matchFamilyStyleCharacter API, which uses the (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fallbackproxy
Patch Set: Add expectation for font-fallback failure on Win7 and revert DEPS change Created 4 years, 8 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/FontCache.cpp
diff --git a/third_party/WebKit/Source/platform/fonts/FontCache.cpp b/third_party/WebKit/Source/platform/fonts/FontCache.cpp
index b97d46bb73380bae5358653bc70948bfdbfe9ab5..70c33f6764a618e716c5a34e92ba77f6a041c8ae 100644
--- a/third_party/WebKit/Source/platform/fonts/FontCache.cpp
+++ b/third_party/WebKit/Source/platform/fonts/FontCache.cpp
@@ -81,6 +81,7 @@ bool FontCache::s_antialiasedTextEnabled = false;
bool FontCache::s_lcdTextEnabled = false;
bool FontCache::s_useSubpixelPositioning = false;
float FontCache::s_deviceScaleFactor = 1.0;
+bool FontCache::s_useSkiaFontFallback = false;
#endif // OS(WIN)
FontCache* FontCache::fontCache()
@@ -374,5 +375,21 @@ void FontCache::dumpShapeResultCache(WebProcessMemoryDump* memoryDump)
memoryDump->addSuballocation(dump->guid(), String(WTF::Partitions::kAllocatedObjectPoolName));
}
+// SkFontMgr requires script-based locale names, like "zh-Hant" and "zh-Hans",
+// instead of "zh-CN" and "zh-TW".
+CString toSkFontMgrLocale(const String& locale)
+{
+ if (!locale.startsWith("zh", TextCaseInsensitive))
+ return locale.ascii();
+
+ switch (localeToScriptCodeForFontSelection(locale)) {
+ case USCRIPT_SIMPLIFIED_HAN:
+ return "zh-Hans";
+ case USCRIPT_TRADITIONAL_HAN:
+ return "zh-Hant";
+ default:
+ return locale.ascii();
+ }
+}
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/platform/fonts/FontCache.h ('k') | third_party/WebKit/Source/platform/fonts/FontDescription.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698