Changeset 1193 for toilet/trunk/src/figlet.c
- Timestamp:
- Oct 8, 2006, 2:14:13 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
toilet/trunk/src/figlet.c
r1170 r1193 45 45 }; 46 46 47 static struct figfont *open_font( void);47 static struct figfont *open_font(context_t *cx); 48 48 static void free_font(struct figfont *); 49 49 50 cucul_canvas_t *render_figlet(uint32_t const *string, unsigned int length) 50 cucul_canvas_t *render_figlet(context_t *cx, uint32_t const *string, 51 unsigned int length) 51 52 { 52 53 cucul_canvas_t *cv; … … 54 55 unsigned int x, i, c; 55 56 56 font = open_font( );57 font = open_font(cx); 57 58 58 59 if(!font) … … 82 83 } 83 84 84 static struct figfont *open_font( void)85 static struct figfont *open_font(context_t *cx) 85 86 { 86 87 char *data = NULL; … … 93 94 94 95 /* 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); 96 97 path[2047] = '\0'; 97 98 f = fopen(path, "r"); 98 99 if(!f) 99 100 { 100 snprintf(path, 2047, "%s/%s.flf", toilet_dir, toilet_font);101 snprintf(path, 2047, "%s/%s.flf", cx->dir, cx->font); 101 102 path[2047] = '\0'; 102 103 f = fopen(path, "r"); … … 228 229 ch = cucul_getchar(font->image, i, j); 229 230 231 /* Replace hardblanks with U+00A0 NO-BREAK SPACE */ 230 232 if(ch == font->hardblank) 231 233 cucul_putchar(font->image, i, j, ch = ' '); 234 //cucul_putchar(font->image, i, j, ch = 0xa0); 232 235 233 236 if(oldch && ch != oldch)
Note: See TracChangeset
for help on using the changeset viewer.