Changeset 1376 for toilet/trunk/src/figlet.c
- Timestamp:
- Nov 12, 2006, 9:37:58 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
toilet/trunk/src/figlet.c
r1299 r1376 97 97 for(x = 0; x < w; x++) 98 98 { 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);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 101 } 102 102 … … 133 133 char buf[2048]; 134 134 char hardblank[10]; 135 cucul_buffer_t *b;136 135 TOIFILE *f; 137 136 unsigned int i, j, size, comment_lines; … … 250 249 251 250 /* Import buffer into canvas */ 252 b = cucul_load_memory(data, i); 253 cx->image = cucul_import_canvas(b, "utf8"); 254 cucul_free_buffer(b); 251 cx->image = cucul_create_canvas(0, 0); 252 cucul_import_memory(cx->image, data, i, "utf8"); 255 253 free(data); 256 257 if(!cx->image)258 {259 free(cx->lookup);260 fprintf(stderr, "libcucul could not load data in `%s'\n", path);261 return -1;262 }263 254 264 255 /* Remove EOL characters. For now we ignore hardblanks, don’t do any … … 270 261 for(i = cx->max_length; i--;) 271 262 { 272 ch = cucul_get char(cx->image, i, j);263 ch = cucul_get_char(cx->image, i, j); 273 264 274 265 /* TODO: Replace hardblanks with U+00A0 NO-BREAK SPACE */ 275 266 if(ch == cx->hardblank) 276 cucul_put char(cx->image, i, j, ch = ' ');277 //cucul_put char(cx->image, i, j, ch = 0xa0);267 cucul_put_char(cx->image, i, j, ch = ' '); 268 //cucul_put_char(cx->image, i, j, ch = 0xa0); 278 269 279 270 if(oldch && ch != oldch) … … 283 274 } 284 275 else if(oldch && ch == oldch) 285 cucul_put char(cx->image, i, j, ' ');276 cucul_put_char(cx->image, i, j, ' '); 286 277 else if(ch != ' ') 287 278 { 288 279 oldch = ch; 289 cucul_put char(cx->image, i, j, ' ');290 } 291 } 292 } 293 294 return 0; 295 } 296 280 cucul_put_char(cx->image, i, j, ' '); 281 } 282 } 283 } 284 285 return 0; 286 } 287
Note: See TracChangeset
for help on using the changeset viewer.