From: Grigori Goronzy Date: Sat, 6 Aug 2011 18:06:54 +0000 (+0200) Subject: Adjust italic to non-italic style spacing X-Git-Tag: 0.10.0~21 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=37fe952c045963c8c86bc630b6a673df9d728dcc;p=libass Adjust italic to non-italic style spacing Previously, the space added was quite a lot, since it was calculated so that it would be enough to accommodate a heavily FreeType-slanted glyph in the worst case. In many cases this was too much spacing, especially if the italic font was only slightly angled. The new fix simply ensures that the glyph is inside the bounds of the advance. --- diff --git a/libass/ass_render.c b/libass/ass_render.c index 8d55667..719b8bd 100644 --- a/libass/ass_render.c +++ b/libass/ass_render.c @@ -1859,10 +1859,8 @@ ass_render_event(ASS_Renderer *render_priv, ASS_Event *event, while (back && og->bbox.xMax - og->bbox.xMin == 0 && og->italic) og = &glyphs[--back]; - if (og->bbox.xMax > og->cluster_advance.x) { - // The FreeType oblique slants by 6/16 - og->cluster_advance.x += og->bbox.yMax * 0.375; - } + if (og->bbox.xMax > og->cluster_advance.x) + og->cluster_advance.x = og->bbox.xMax; } // add horizontal letter spacing