mirror of
https://github.com/mpv-player/mpv
synced 2025-02-20 14:56:55 +00:00
Do not try to guess font metrics based on its bounding box.
It was originally a workaround for fonts with bad ascender/descender values, but it breaks display of some otherwise valid fonts (bugzilla 987), so reverted. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25688 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
46c4f6ae9f
commit
eb96cc741e
@ -248,14 +248,8 @@ void ass_font_get_asc_desc(ass_font_t* font, uint32_t ch, int* asc, int* desc)
|
||||
for (i = 0; i < font->n_faces; ++i) {
|
||||
FT_Face face = font->faces[i];
|
||||
if (FT_Get_Char_Index(face, ch)) {
|
||||
int v, v2;
|
||||
v = face->size->metrics.ascender;
|
||||
v2 = FT_MulFix(face->bbox.yMax, face->size->metrics.y_scale);
|
||||
*asc = (v > v2 * 0.9) ? v : v2;
|
||||
|
||||
v = - face->size->metrics.descender;
|
||||
v2 = - FT_MulFix(face->bbox.yMin, face->size->metrics.y_scale);
|
||||
*desc = (v > v2 * 0.9) ? v : v2;
|
||||
*asc = face->size->metrics.ascender;
|
||||
*desc = - face->size->metrics.descender;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user