From: Grigori Goronzy Date: Thu, 16 Jul 2009 20:44:12 +0000 (+0200) Subject: Tweak font metrics to match Windows GDI X-Git-Tag: 0.9.7~42 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b625c5a90cb8076612c0b1c8032db8629809b92e;p=libass Tweak font metrics to match Windows GDI Try to change ascender/descender calculation to be more compatible with Windows GDI and consequently, VSFilter. --- diff --git a/libass/ass_font.c b/libass/ass_font.c index 34ae292..35d34cf 100644 --- a/libass/ass_font.c +++ b/libass/ass_font.c @@ -268,8 +268,9 @@ void ass_font_get_asc_desc(ass_font_t *font, uint32_t ch, int *asc, for (i = 0; i < font->n_faces; ++i) { FT_Face face = font->faces[i]; if (FT_Get_Char_Index(face, ch)) { - *asc = face->size->metrics.ascender; - *desc = -face->size->metrics.descender; + int y_scale = face->size->metrics.y_scale; + *asc = FT_MulFix(face->ascender, y_scale); + *desc = FT_MulFix(-face->descender, y_scale); return; } }