From 00983363e4356fd4bd0da3659f37707b31fc6597 Mon Sep 17 00:00:00 2001 From: Grigori Goronzy Date: Mon, 29 Jun 2009 05:19:40 +0200 Subject: Fix two-pass stroking for \xbord, \ybord The two-pass stroker blindly assumed that the number of points of the stroked glyph is the same, no matter the size of the stroker. Unfortunately, this is not the case every time. In such cases, the coordinates will only be replaced up to mininum of points of both glyphs. It's incredibly hacky, but seems to work well (and look good). --- libass/ass_render.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libass/ass_render.c b/libass/ass_render.c index 86dfd3d..d3d53e4 100644 --- a/libass/ass_render.c +++ b/libass/ass_render.c @@ -1799,7 +1799,7 @@ get_outline_glyph(ass_renderer_t *render_priv, int symbol, // 2nd pass if x/y borders are different if (render_priv->state.border_x != render_priv->state.border_y) { - int i; + int i, m; FT_Glyph g; FT_OutlineGlyph go, gi; @@ -1814,7 +1814,8 @@ get_outline_glyph(ass_renderer_t *render_priv, int symbol, // Replace x coordinates go = (FT_OutlineGlyph) info->outline_glyph; gi = (FT_OutlineGlyph) g; - for (i = 0; i < go->outline.n_points; i++) + m = FFMIN(go->outline.n_points, gi->outline.n_points); + for (i = 0; i < m; i++) go->outline.points[i].x = gi->outline.points[i].x; FT_Done_Glyph(g); } -- cgit v1.2.3