Changeset 2821 for libcaca/trunk/tools/sortchars.c
- Timestamp:
- Sep 27, 2008, 3:12:46 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/tools/sortchars.c
r2397 r2821 21 21 #endif 22 22 23 #include "c ucul.h"23 #include "caca.h" 24 24 25 25 #define GLYPHS 0x7f … … 49 49 int count[DX][DY]; 50 50 char utf8[7]; 51 c ucul_canvas_t *cv;52 c ucul_font_t *f;51 caca_canvas_t *cv; 52 caca_font_t *f; 53 53 char const * const * fonts; 54 54 uint8_t *img; … … 56 56 int ret, i, max; 57 57 58 /* Load a libc uculinternal font */59 fonts = c ucul_get_font_list();58 /* Load a libcaca internal font */ 59 fonts = caca_get_font_list(); 60 60 if(fonts[FONT] == NULL) 61 61 { 62 fprintf(stderr, "error: libc uculwas compiled without any fonts\n");62 fprintf(stderr, "error: libcaca was compiled without any fonts\n"); 63 63 return -1; 64 64 } 65 f = c ucul_load_font(fonts[FONT], 0);65 f = caca_load_font(fonts[FONT], 0); 66 66 if(f == NULL) 67 67 { … … 70 70 } 71 71 72 cv = c ucul_create_canvas(1, 1);73 c ucul_set_color_ansi(cv, CUCUL_WHITE, CUCUL_BLACK);72 cv = caca_create_canvas(1, 1); 73 caca_set_color_ansi(cv, CACA_WHITE, CACA_BLACK); 74 74 75 75 /* Create our bitmap buffer (32-bit ARGB) */ 76 w = c ucul_get_font_width(f);77 h = c ucul_get_font_height(f);76 w = caca_get_font_width(f); 77 h = caca_get_font_height(f); 78 78 img = malloc(4 * w * h); 79 79 … … 95 95 for(i = 0x20; i < GLYPHS; i++) 96 96 { 97 c ucul_put_char(cv, 0, 0, i);97 caca_put_char(cv, 0, 0, i); 98 98 99 99 /* Render the canvas onto our image buffer */ 100 c ucul_render_canvas(cv, f, img, w, h, 4 * w);100 caca_render_canvas(cv, f, img, w, h, 4 * w); 101 101 102 102 for(y = 0; y < h * DY; y++) … … 166 166 for(i = 0; i < FULLRANGE; i++) 167 167 { 168 ret = c ucul_utf32_to_utf8(utf8, bestchar[i]);168 ret = caca_utf32_to_utf8(utf8, bestchar[i]); 169 169 utf8[ret] = '\0'; 170 170 printf("%i, ", bestchar[i]); … … 176 176 for(i = 0; i < GLYPHS; i++) 177 177 { 178 ret = c ucul_utf32_to_utf8(utf8, bestchar[i]);178 ret = caca_utf32_to_utf8(utf8, bestchar[i]); 179 179 utf8[ret] = '\0'; 180 180 printf("0x%03x, ", allbits[i]); … … 184 184 printf("\n};\n"); 185 185 186 c ucul_free_canvas(cv);186 caca_free_canvas(cv); 187 187 188 188 testcircle(); … … 253 253 } 254 254 255 ret = c ucul_utf32_to_utf8(utf8, bestchar[bits]);255 ret = caca_utf32_to_utf8(utf8, bestchar[bits]); 256 256 utf8[ret] = '\0'; 257 257 printf("%s", utf8);
Note: See TracChangeset
for help on using the changeset viewer.