Index: Source/platform/fonts/win/FontFallbackWin.cpp |
diff --git a/Source/platform/fonts/win/FontFallbackWin.cpp b/Source/platform/fonts/win/FontFallbackWin.cpp |
index 85f293f38701bb30530acff8bad4e3cef8e6f740..9e291f01f3f6f2d0d66d5f6ee040f248015442b7 100644 |
--- a/Source/platform/fonts/win/FontFallbackWin.cpp |
+++ b/Source/platform/fonts/win/FontFallbackWin.cpp |
@@ -31,6 +31,7 @@ |
#include "config.h" |
#include "platform/fonts/win/FontFallbackWin.h" |
+#include "platform/fonts/FontCache.h" |
#include "SkFontMgr.h" |
#include "SkTypeface.h" |
#include "wtf/HashMap.h" |
@@ -47,10 +48,16 @@ namespace { |
static inline bool isFontPresent(const UChar* fontName, SkFontMgr* fontManager) |
{ |
String family = fontName; |
- RefPtr<SkTypeface> tf = adoptRef(fontManager->legacyCreateTypeface(family.utf8().data(), SkTypeface::kNormal)); |
- if (!tf) |
+ SkTypeface* typeface; |
+ if (FontCache::useDirectWrite()) |
+ typeface = fontManager->matchFamilyStyle(family.utf8().data(), SkFontStyle()); |
+ else |
+ typeface = fontManager->legacyCreateTypeface(family.utf8().data(), SkTypeface::kNormal); |
+ |
+ if (!typeface) |
return false; |
+ RefPtr<SkTypeface> tf = adoptRef(typeface); |
SkTypeface::LocalizedStrings* actualFamilies = tf->createFamilyNameIterator(); |
bool matchesRequestedFamily = false; |
SkTypeface::LocalizedString actualFamily; |