Changeset 1438 for libcaca/trunk/tools/makefont.c
- Timestamp:
- Nov 27, 2006, 3:53:17 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/tools/makefont.c
r1365 r1438 92 92 FT_Bitmap img; 93 93 int stdwidth, fullwidth, height, blocks, glyphs, fullglyphs; 94 unsigned int n, b, i , index;94 unsigned int n, b, i; 95 95 unsigned int stdsize, fullsize, control_size, data_size, current_offset; 96 96 uint8_t *glyph_data; … … 226 226 227 227 /* Render all glyphs, so that we can know their offset */ 228 current_offset = n = index =0;228 current_offset = n = 0; 229 229 for(b = 0; blocklist[b + 1]; b += 2) 230 230 { … … 420 420 static int printf_unicode(struct glyph *g) 421 421 { 422 int wr itten= 0;423 424 wr itten+= printf("U+%.04X: \"", g->unicode);422 int wr = 0; 423 424 wr += printf("U+%.04X: \"", g->unicode); 425 425 426 426 if(g->unicode < 0x20 || (g->unicode >= 0x7f && g->unicode <= 0xa0)) 427 wr itten+= printf("\\x%.02x\"", g->unicode);427 wr += printf("\\x%.02x\"", g->unicode); 428 428 else 429 wr itten+= printf("%s\"", g->buf);430 431 return wr itten;429 wr += printf("%s\"", g->buf); 430 431 return wr; 432 432 } 433 433 … … 448 448 char buf[BUFSIZ]; 449 449 char *parser = buf; 450 int re wind= 0; /* we use this variable to rewind 2 bytes after \000451 450 int rev = 0; /* we use this variable to rewind 2 bytes after \000 451 * was printed when the next char starts with "\", too. */ 452 452 453 453 while(bytes--) … … 459 459 parser += sprintf(parser, "\", \""); 460 460 written = 0; 461 re wind= 0;461 rev = 0; 462 462 } 463 463 464 464 if(ch == '\\' || ch == '"') 465 465 { 466 parser -= re wind;466 parser -= rev; 467 467 parser += sprintf(parser, "\\%c", ch); 468 re wind= 0;468 rev = 0; 469 469 } 470 470 else if(ch >= 0x20 && ch < 0x7f) 471 471 { 472 472 parser += sprintf(parser, "%c", ch); 473 re wind= 0;473 rev = 0; 474 474 } 475 475 else 476 476 { 477 parser -= re wind;477 parser -= rev; 478 478 parser += sprintf(parser, "\\%.03o", ch); 479 re wind= ch ? 0 : 2;479 rev = ch ? 0 : 2; 480 480 } 481 481 … … 483 483 } 484 484 485 parser -= re wind;485 parser -= rev; 486 486 parser[0] = '\0'; 487 487
Note: See TracChangeset
for help on using the changeset viewer.