Bug 23336 - unable to display bitmap-only (SFNT) TrueType or OpenType

Force to find out a size for bitmap-only ttf to avoid the blank glyphs
in the font.

Patch from Bug Fly
This commit is contained in:
Akira TAGOH 2012-03-07 17:32:14 +09:00
parent a13d518fdd
commit 1f01c4b60c
1 changed files with 13 additions and 17 deletions

View File

@ -2513,14 +2513,10 @@ FcFreeTypeCharSetAndSpacing (FT_Face face, FcBlanks *blanks, int *spacing)
{
FcCharSet *cs;
cs = FcFreeTypeCharSetAndSpacingForSize (face, blanks, spacing, -1);
/*
* Check for bitmap-only ttf fonts that are missing the glyf table.
* In that case, pick a size and look for glyphs in that size instead
*/
if (FcCharSetCount (cs) == 0)
{
/* Check for non-scalable TT fonts */
if (!(face->face_flags & FT_FACE_FLAG_SCALABLE) &&
face->num_fixed_sizes > 0 &&
FT_Get_Sfnt_Table (face, ft_sfnt_head))
@ -2534,10 +2530,10 @@ FcFreeTypeCharSetAndSpacing (FT_Face face, FcBlanks *blanks, int *spacing)
abs (face->available_sizes[strike_index].height - 16))
strike_index = i;
}
FcCharSetDestroy (cs);
cs = FcFreeTypeCharSetAndSpacingForSize (face, blanks, spacing, strike_index);
}
}
else
cs = FcFreeTypeCharSetAndSpacingForSize (face, blanks, spacing, -1);
return cs;
}