Ignore:
Timestamp:
Oct 8, 2006, 2:14:13 PM (14 years ago)
Author:
Sam Hocevar
Message:
  • Break everything. Temporarily. Only the term output works.
  • Allow to read from stdin.
  • Wrap at terminal width (currently letter-wrap, not word-wrap).
File:
1 edited

Legend:

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

    r1170 r1193  
    4545};
    4646
    47 static struct figfont *open_font(void);
     47static struct figfont *open_font(context_t *cx);
    4848static void free_font(struct figfont *);
    4949
    50 cucul_canvas_t *render_figlet(uint32_t const *string, unsigned int length)
     50cucul_canvas_t *render_figlet(context_t *cx, uint32_t const *string,
     51                              unsigned int length)
    5152{
    5253    cucul_canvas_t *cv;
     
    5455    unsigned int x, i, c;
    5556
    56     font = open_font();
     57    font = open_font(cx);
    5758
    5859    if(!font)
     
    8283}
    8384
    84 static struct figfont *open_font(void)
     85static struct figfont *open_font(context_t *cx)
    8586{
    8687    char *data = NULL;
     
    9394
    9495    /* Open font: try .tlf, then .flf */
    95     snprintf(path, 2047, "%s/%s.tlf", toilet_dir, toilet_font);
     96    snprintf(path, 2047, "%s/%s.tlf", cx->dir, cx->font);
    9697    path[2047] = '\0';
    9798    f = fopen(path, "r");
    9899    if(!f)
    99100    {
    100         snprintf(path, 2047, "%s/%s.flf", toilet_dir, toilet_font);
     101        snprintf(path, 2047, "%s/%s.flf", cx->dir, cx->font);
    101102        path[2047] = '\0';
    102103        f = fopen(path, "r");
     
    228229            ch = cucul_getchar(font->image, i, j);
    229230
     231            /* Replace hardblanks with U+00A0 NO-BREAK SPACE */
    230232            if(ch == font->hardblank)
    231233                cucul_putchar(font->image, i, j, ch = ' ');
     234                //cucul_putchar(font->image, i, j, ch = 0xa0);
    232235
    233236            if(oldch && ch != oldch)
Note: See TracChangeset for help on using the changeset viewer.