Ignore:
Timestamp:
Nov 13, 2006, 2:02:05 AM (16 years ago)
Author:
Sam Hocevar
Message:
  • Support for ANSI escape codes in the input:

http://zoy.org/~sam/toilet-ansi.png
http://zoy.org/~sam/toilet-ansi2.png

  • Empty lines are currently broken.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • toilet/trunk/src/figlet.c

    r1376 r1385  
    3333#define EXT_GLYPHS (STD_GLYPHS + 7)
    3434
    35 static int feed_figlet(context_t *, uint32_t);
     35static int feed_figlet(context_t *, uint32_t, uint32_t);
    3636static int flush_figlet(context_t *);
    3737static int end_figlet(context_t *);
     
    5151}
    5252
    53 static int feed_figlet(context_t *cx, uint32_t ch)
     53static int feed_figlet(context_t *cx, uint32_t ch, uint32_t attr)
    5454{
    5555    unsigned int c, w, h, x, y;
     
    9191        cx->h = cx->y + h;
    9292
     93    if(attr)
     94        cucul_set_attr(cx->cv, attr);
    9395    cucul_set_canvas_size(cx->cv, cx->w, cx->h);
    9496
     
    9799        for(x = 0; x < w; x++)
    98100    {
    99         uint32_t tmp = cucul_get_char(cx->image, x, y + c * cx->height);
    100         cucul_put_char(cx->cv, cx->x + x, cx->y + y, tmp);
     101        uint32_t tmpch = cucul_get_char(cx->image, x, y + c * cx->height);
     102        //uint32_t tmpat = cucul_get_attr(cx->image, x, y + c * cx->height);
     103        /* FIXME: this could be changed to cucul_put_attr() when the
     104         * function is fixed in libcucul */
     105        //cucul_set_attr(cx->cv, tmpat);
     106        cucul_put_char(cx->cv, cx->x + x, cx->y + y, tmpch);
     107        //cucul_put_attr(cx->cv, cx->x + x, cx->y + y, tmpat);
    101108    }
    102109
Note: See TracChangeset for help on using the changeset viewer.