]> granicus.if.org Git - libass/commitdiff
Skip border generation if glyph is collapsed
authorGrigori Goronzy <greg@blackbox>
Thu, 21 Jan 2010 05:31:45 +0000 (06:31 +0100)
committerGrigori Goronzy <greg@blackbox>
Thu, 21 Jan 2010 05:31:45 +0000 (06:31 +0100)
If a character is completely collapsed in x or y direction (\fscx0,
\fscy0), the rasterizer will not generate any visible pixels. This also
means vsfilter will never draw any border in this case, since it works
on the pixel data. FreeType's stroker OTOH happily draws a border around
a character, no matter how collapsed it is. Emulate vsfilter's behavior
by skipping border generation if the glyph is collapsed.

libass/ass_render.c

index 6e4fb7afa2dfa97d710afe009ed891438dad8f88..dda01848117add582c633fe033d566d6990104e5 100644 (file)
@@ -1158,8 +1158,9 @@ get_outline_glyph(ASS_Renderer *render_priv, int symbol, GlyphInfo *info,
                                          render_priv->border_scale),
                             double_to_d6(render_priv->state.border_y *
                                          render_priv->border_scale));
-        } else if (render_priv->state.border_x > 0 ||
-                   render_priv->state.border_y > 0) {
+        } else if ((render_priv->state.border_x > 0
+                    || render_priv->state.border_y > 0)
+                   && key.scale_x && key.scale_y) {
 
             FT_Glyph_Copy(info->glyph, &info->outline_glyph);
             stroke_outline_glyph(render_priv,