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

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: 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..e8952481f758e3110f9b6ac3be9607670b249c18 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()));
jbroman 2014/08/07 16:36:40 drive-by nit: why the double parentheses for both
bungeman-skia 2014/08/07 16:41:32 Thanks, for pointing that out, will fix. This was
+ RefPtr<SkTypeface> typeface = adoptRef((fm->matchFamilyStyleCharacter(0, SkFontStyle(), locale, c)));
+ if (!typeface)
return emptyAtom;
+ SkString skiaFamilyName;
+ typeface->getFamilyName(&skiaFamilyName);
return skiaFamilyName.c_str();
}
« 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