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

Unified Diff: Source/platform/fonts/android/FontCacheAndroid.cpp

Issue 447233003: Use font manager for fallback on Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove extra parens. Created 6 years, 4 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
« 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/android/FontCacheAndroid.cpp
diff --git a/Source/platform/fonts/android/FontCacheAndroid.cpp b/Source/platform/fonts/android/FontCacheAndroid.cpp
index 131bc27e99dc4542f317a9925af070046fe96951..8f070e8603027de4758b8e4caef8cded2df45bdd 100644
--- a/Source/platform/fonts/android/FontCacheAndroid.cpp
+++ b/Source/platform/fonts/android/FontCacheAndroid.cpp
@@ -35,8 +35,8 @@
#include "platform/fonts/SimpleFontData.h"
#include "platform/fonts/FontDescription.h"
#include "platform/fonts/FontFaceCreationParams.h"
-
-#include "SkTypeface_android.h"
+#include "third_party/skia/include/core/SkTypeface.h"
+#include "third_party/skia/include/ports/SkFontMgr.h"
namespace blink {
@@ -63,10 +63,13 @@ static AtomicString getFamilyNameForCharacter(UChar32 c, UScriptCode script)
break;
}
- SkString skiaFamilyName;
- if (!SkGetFallbackFamilyNameForChar(c, locale, &skiaFamilyName) || skiaFamilyName.isEmpty())
+ RefPtr<SkFontMgr> fm = adoptRef(SkFontMgr::RefDefault());
+ RefPtr<SkTypeface> typeface = adoptRef(fm->matchFamilyStyleCharacter(0, SkFontStyle(), locale, c));
+ if (!typeface)
return emptyAtom;
+ SkString skiaFamilyName;
+ typeface->getFamilyName(&skiaFamilyName);
return skiaFamilyName.c_str();
f(malita) 2014/08/07 17:41:07 Unrelated nit: for the sake of the next person loo
bungeman-skia 2014/08/07 17:48:06 OMG, yes. This is what it was doing, so I'm leavin
}
« 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