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).
// 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;
// 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);
}