diff options
author | 2010-08-06 18:08:18 +0000 | |
---|---|---|
committer | 2010-08-06 18:08:18 +0000 | |
commit | 61a678a28d6ff9cd066d342e6641c40470ed822d (patch) | |
tree | e30bc84424593b54c67c65bbf53fec9336aa165d | |
parent | c9c9ebbc29b62e7d3b06ff18023b09faeb49d618 (diff) |
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
-rw-r--r-- | src/ports/SkFontHost_FreeType.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ports/SkFontHost_FreeType.cpp b/src/ports/SkFontHost_FreeType.cpp index b7645ddce6..9af21bc981 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); |