Hello,

The attached patches are needed in libcaca and toilet to fix
rendering width when specifying the -w option in toilet. For
users of figfont that do not set up a terminal width in their
canvas first, I've left the old default of 80 characters.

Thanks,

-Kees

-- 
Kees Cook                                            @debian.org
Description: inherit the "terminal" width from the canvas before starting
 to use it for rendering. This allows callers to specify the wrapping
 width, otherwise it falls back to the hard-coded 80 characters.
Author: Kees Cook <k...@debian.org>
Debian-Bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=636939

Index: libcaca-0.99.beta17/caca/figfont.c
===================================================================
--- libcaca-0.99.beta17.orig/caca/figfont.c	2012-03-06 23:49:52.612972944 -0800
+++ libcaca-0.99.beta17/caca/figfont.c	2012-03-07 00:05:08.941244629 -0800
@@ -77,6 +77,8 @@
 
     /* from TOIlet’s main.c */
     ff->term_width = 80;
+    if (cv->width)
+        ff->term_width = cv->width;
     ff->hmode = H_DEFAULT;
 
     /* from TOIlet’s render.c */
Description: pass desired terminal width to the canvas so that
 caca_canvas_set_figfont() will pick it up. Requires a corresponding
 fix in libcaca.
Debian-Bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=636939
Author: Kees Cook <k...@debian.org>

Index: toilet-0.2/src/figlet.c
===================================================================
--- toilet-0.2.orig/src/figlet.c	2012-03-06 21:38:29.192004122 -0800
+++ toilet-0.2/src/figlet.c	2012-03-06 23:57:19.298911812 -0800
@@ -38,6 +38,8 @@
 {
     char path[2048];
 
+    caca_set_canvas_size(cx->cv, cx->term_width, 0);
+
     snprintf(path, 2047, "%s/%s", cx->dir, cx->font);
     if(caca_canvas_set_figfont(cx->cv, path))
     {

Reply via email to