Index: content/child/dwrite_font_proxy/dwrite_font_proxy_init_win.cc |
diff --git a/content/child/dwrite_font_proxy/dwrite_font_proxy_init_win.cc b/content/child/dwrite_font_proxy/dwrite_font_proxy_init_win.cc |
index e7a2f2afe6f3cf5a9aba5847a9f0c65f772c570c..da083233fb2f7fccb082bb85c9d33e77b69249e9 100644 |
--- a/content/child/dwrite_font_proxy/dwrite_font_proxy_init_win.cc |
+++ b/content/child/dwrite_font_proxy/dwrite_font_proxy_init_win.cc |
@@ -87,6 +87,18 @@ void InitializeDWriteFontProxy() { |
// addref. |
skia_font_manager->ref(); |
SetDefaultSkiaFactory(skia_font_manager.get()); |
+ |
+ // When IDWriteFontFallback is not available (prior to Win8.1) Skia will |
+ // still attempt to use DirectWrite to determine fallback fonts (in |
+ // SkFontMgr_DirectWrite::onMatchFamilyStyleCharacter), which will likely |
+ // result in trying to load the system font collection. To avoid that and |
+ // instead fall back on WebKit's fallback logic, we don't use Skia's font |
+ // fallback if IDWriteFontFallback is not available. |
+ // This flag can be removed when Win8.0 and earlier are no longer supported. |
+ bool fallback_available = font_fallback.Get() != nullptr; |
+ DCHECK_EQ(fallback_available, |
+ base::win::GetVersion() > base::win::VERSION_WIN8); |
+ blink::WebFontRendering::setUseSkiaFontFallback(fallback_available); |
} |
void UninitializeDWriteFontProxy() { |