From: greg Date: Fri, 19 Jun 2009 05:34:03 +0000 (+0200) Subject: Add hack to support empty lines of text X-Git-Tag: 0.9.7~104 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=49bf5a419a286d70b3a82f4a60059849ed2c536a;p=libass Add hack to support empty lines of text Consecutive forced breaks (\N\N) can be used to create empty lines of text in other renderers. This doesn't work with the current text layouter (wrap_lines_smart). This hack inserts a space glyph between two consecutive forced breaks to get around this limitation. --- diff --git a/libass/ass_render.c b/libass/ass_render.c index f2a34b2..870623e 100644 --- a/libass/ass_render.c +++ b/libass/ass_render.c @@ -2224,6 +2224,14 @@ ass_render_event(ass_renderer_t *render_priv, ass_event_t *event, if (code == 0) break; + // Insert space between two forced breaks to create empty lines + // FIXME: should probably be done in wrap_lines_smart, + // this is a hack + if (previous == '\n' && code == '\n') { + code = ' '; + p -= 2; + } + if (text_info->length >= text_info->max_glyphs) { // Raise maximum number of glyphs text_info->max_glyphs *= 2;