summaryrefslogtreecommitdiffstats
path: root/libass/ass_render.c
diff options
context:
space:
mode:
Diffstat (limited to 'libass/ass_render.c')
-rw-r--r--libass/ass_render.c8
1 files 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;