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

Unified Diff: Source/platform/fonts/win/FontFallbackWin.cpp

Issue 805273003: Change FontFallbackWin to use matchFamilyStyle (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698