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

Unified Diff: src/ports/SkFontHost_FreeType.cpp

Issue 382053003: Update find_name_and_attributes to take ttc index. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Move find_name_and_attributes to SkTypeface_FreeType::ScanFont. Created 6 years, 5 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 | « src/ports/SkFontConfigInterface_android.cpp ('k') | src/ports/SkFontHost_FreeType_common.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ports/SkFontHost_FreeType.cpp
diff --git a/src/ports/SkFontHost_FreeType.cpp b/src/ports/SkFontHost_FreeType.cpp
index 6448beb89b2d265786bc15d19f6ad30b2cd54bfe..e2b0fe9ae6b9f640bed76ea3d86b671602098d12 100644
--- a/src/ports/SkFontHost_FreeType.cpp
+++ b/src/ports/SkFontHost_FreeType.cpp
@@ -1670,11 +1670,9 @@ size_t SkTypeface_FreeType::onGetTableData(SkFontTableTag tag, size_t offset,
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
-/* Export this so that other parts of our FonttHost port can make use of our
- ability to extract the name+style from a stream, using FreeType's api.
-*/
-bool find_name_and_attributes(SkStream* stream, SkString* name,
- SkTypeface::Style* style, bool* isFixedPitch) {
+/*static*/ bool SkTypeface_FreeType::ScanFont(
+ SkStream* stream, int ttcIndex, SkString* name, SkTypeface::Style* style, bool* isFixedPitch)
+{
FT_Library library;
if (FT_Init_FreeType(&library)) {
return false;
@@ -1702,7 +1700,7 @@ bool find_name_and_attributes(SkStream* stream, SkString* name,
}
FT_Face face;
- if (FT_Open_Face(library, &args, 0, &face)) {
+ if (FT_Open_Face(library, &args, ttcIndex, &face)) {
FT_Done_FreeType(library);
return false;
}
« no previous file with comments | « src/ports/SkFontConfigInterface_android.cpp ('k') | src/ports/SkFontHost_FreeType_common.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698