summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgreg <greg@blackbox>2009-06-19 07:34:03 +0200
committergreg <greg@blackbox>2009-06-20 03:38:00 +0200
commit49bf5a419a286d70b3a82f4a60059849ed2c536a (patch)
tree88a1aafba07b87d9e2eca652c379b109735ac063
parent9c1ff393d29aee7b64be2f5c526886819abfc7ec (diff)
downloadlibass-49bf5a419a286d70b3a82f4a60059849ed2c536a.tar.bz2
libass-49bf5a419a286d70b3a82f4a60059849ed2c536a.tar.xz
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.
-rw-r--r--libass/ass_render.c8
1 files changed, 8 insertions, 0 deletions
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;