From 61a678a28d6ff9cd066d342e6641c40470ed822d Mon Sep 17 00:00:00 2001 From: "agl@chromium.org" Date: Fri, 6 Aug 2010 18:08:18 +0000 Subject: [PATCH] Add support for TTC font files in SkFontHost_Freetype. This is a companion change to a Chrome CL ( http://codereview.chromium.org/2870073/show ) (Patch by: jshin (Chromium)) BUG=http://crbug.com/50389 TEST=See the Chromium CL mentioned above. http://codereview.appspot.com/1847046 git-svn-id: http://skia.googlecode.com/svn/trunk@593 2bbb7eff-a529-9590-31e7-b0007b416f81 --- src/ports/SkFontHost_FreeType.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ports/SkFontHost_FreeType.cpp b/src/ports/SkFontHost_FreeType.cpp index b7645dd..9af21bc 100644 --- a/src/ports/SkFontHost_FreeType.cpp +++ b/src/ports/SkFontHost_FreeType.cpp @@ -236,7 +236,10 @@ static SkFaceRec* ref_ft_face(uint32_t fontID) { args.stream = &rec->fFTStream; } - FT_Error err = FT_Open_Face(gFTLibrary, &args, 0, &rec->fFace); + int face_index; + int length = SkFontHost::GetFileName(fontID, NULL, 0, &face_index); + FT_Error err = FT_Open_Face(gFTLibrary, &args, length ? face_index : 0, + &rec->fFace); if (err) { // bad filename, try the default font fprintf(stderr, "ERROR: unable to open font '%x'\n", fontID); -- 2.7.4