From 9b48357234806a4fe29ec97eba6c998a26033b5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reimar=20D=C3=B6ffinger?= Date: Tue, 24 Sep 2013 22:28:15 +0200 Subject: Skip both newline and carriage return. '\r' characters weren't skipped correctly. SKIP_SYMBOL from original patch renamed to IS_SKIP_SYMBOL. Signed-off-by: wm4 --- libass/ass_render.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libass/ass_render.c b/libass/ass_render.c index 45d88bb..0cf1f16 100644 --- a/libass/ass_render.c +++ b/libass/ass_render.c @@ -682,6 +682,8 @@ blend_vector_exit: render_priv->state.clip_drawing = 0; } +#define IS_SKIP_SYMBOL(x) ((x) == 0 || (x) == '\n' || (x) == '\r') + /** * \brief Convert TextInfo struct to ASS_Image list * Splits glyphs in halves when needed (for \kf karaoke). @@ -699,7 +701,7 @@ static ASS_Image *render_text(ASS_Renderer *render_priv, int dst_x, int dst_y) for (i = 0; i < text_info->length; ++i) { GlyphInfo *info = text_info->glyphs + i; - if ((info->symbol == 0) || (info->symbol == '\n') || !info->bm_s + if (IS_SKIP_SYMBOL(info->symbol) || !info->bm_s || (info->shadow_x == 0 && info->shadow_y == 0) || info->skip) continue; @@ -733,7 +735,7 @@ static ASS_Image *render_text(ASS_Renderer *render_priv, int dst_x, int dst_y) last_tail = 0; for (i = 0; i < text_info->length; ++i) { GlyphInfo *info = text_info->glyphs + i; - if ((info->symbol == 0) || (info->symbol == '\n') || !info->bm_o + if (IS_SKIP_SYMBOL(info->symbol) || !info->bm_o || info->skip) continue; @@ -766,7 +768,7 @@ static ASS_Image *render_text(ASS_Renderer *render_priv, int dst_x, int dst_y) for (i = 0; i < text_info->length; ++i) { GlyphInfo *info = text_info->glyphs + i; - if ((info->symbol == 0) || (info->symbol == '\n') || !info->bm + if (IS_SKIP_SYMBOL(info->symbol) || !info->bm || info->skip) continue; -- cgit v1.2.3