Workaround for broken fonts with bad ascender/descender.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19699 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
eugeni 2006-09-05 20:06:20 +00:00
parent b4d4d22a50
commit 4fd16b0702
1 changed files with 11 additions and 7 deletions

View File

@ -1467,17 +1467,21 @@ static void process_karaoke_effects(void)
static int get_face_ascender(FT_Face face)
{
int v = face->size->metrics.ascender;
if (!v)
v = FT_MulFix(face->bbox.yMax, face->size->metrics.y_scale);
return v;
int v2 = FT_MulFix(face->bbox.yMax, face->size->metrics.y_scale);
if (v > v2 * 0.9)
return v;
else
return v2;
}
static int get_face_descender(FT_Face face)
{
int v = face->size->metrics.descender;
if (!v)
v = FT_MulFix(face->bbox.yMin, face->size->metrics.y_scale);
return -v;
int v = - face->size->metrics.descender;
int v2 = - FT_MulFix(face->bbox.yMin, face->size->metrics.y_scale);
if (v > v2 * 0.9)
return v;
else
return v2;
}
/**