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
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);