Changeset 2821 for libcaca/trunk/tools
- Timestamp:
- Sep 27, 2008, 3:12:46 PM (14 years ago)
- Location:
- libcaca/trunk/tools
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/tools/Makefile.am
r2299 r2821 1 1 # $Id$ 2 2 3 AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/c ucul -I../cucul\3 AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/caca -I../caca \ 4 4 -I$(top_srcdir)/caca -DDATADIR=\"$(pkgdatadir)\" 5 5 … … 9 9 10 10 sortchars_SOURCES = sortchars.c 11 sortchars_LDADD = ../c ucul/libcucul.la11 sortchars_LDADD = ../caca/libcaca.la 12 12 13 13 makefont_SOURCES = makefont.c 14 makefont_LDADD = ../c ucul/libcucul.la14 makefont_LDADD = ../caca/libcaca.la 15 15 makefont_CFLAGS = $(PANGOFT2_CFLAGS) 16 16 makefont_LDFLAGS = $(PANGOFT2_LIBS) -
libcaca/trunk/tools/makefont.c
r2819 r2821 31 31 #include <pango/pangoft2.h> 32 32 33 #include "c ucul.h"33 #include "caca.h" 34 34 35 35 /* Split our big strings into chunks of 480 characters, because it is … … 167 167 glyphs += blocklist[b + 1] - blocklist[b]; 168 168 for(i = blocklist[b]; i < blocklist[b + 1]; i++) 169 if(c ucul_utf32_is_fullwidth(i))169 if(caca_utf32_is_fullwidth(i)) 170 170 fullglyphs++; 171 171 } … … 178 178 179 179 /* Let's go! */ 180 printf("/* libc uculfont file\n");180 printf("/* libcaca font file\n"); 181 181 printf(" * \"%s\": %i dpi, %i bpp, %ix%i/%ix%i glyphs\n", 182 182 font, dpi, bpp, stdwidth, height, fullwidth, height); … … 232 232 unsigned int k, current_size = stdsize; 233 233 234 if(c ucul_utf32_is_fullwidth(i))234 if(caca_utf32_is_fullwidth(i)) 235 235 { 236 236 current_width = fullwidth; … … 238 238 } 239 239 gtab[n].unicode = i; 240 bytes = c ucul_utf32_to_utf8(gtab[n].buf, gtab[n].unicode);240 bytes = caca_utf32_to_utf8(gtab[n].buf, gtab[n].unicode); 241 241 gtab[n].buf[bytes] = '\0'; 242 242 -
libcaca/trunk/tools/optipal.c
r2299 r2821 19 19 #endif 20 20 21 #include "c ucul.h" /* Only necessary for CUCUL_* macros */21 #include "caca.h" /* Only necessary for CACA_* macros */ 22 22 23 23 static void base_colors(void); … … 30 30 static unsigned int const hue_list[] = 31 31 { 32 C UCUL_RED, CUCUL_BROWN, CUCUL_GREEN,33 C UCUL_CYAN, CUCUL_BLUE, CUCUL_MAGENTA32 CACA_RED, CACA_BROWN, CACA_GREEN, 33 CACA_CYAN, CACA_BLUE, CACA_MAGENTA 34 34 }; 35 35 … … 168 168 /* black background colour pairs that are needed for the old renderer */ 169 169 for(i = 1; i < 16; i++) 170 SETPAIR(i, C UCUL_BLACK, cur++);170 SETPAIR(i, CACA_BLACK, cur++); 171 171 172 172 /* gray combinations used for grayscale dithering */ 173 SETPAIR(C UCUL_BLACK, CUCUL_DARKGRAY, cur++);174 SETPAIR(C UCUL_DARKGRAY, CUCUL_LIGHTGRAY, cur++);175 SETPAIR(C UCUL_LIGHTGRAY, CUCUL_DARKGRAY, cur++);176 SETPAIR(C UCUL_WHITE, CUCUL_LIGHTGRAY, cur++);177 SETPAIR(C UCUL_LIGHTGRAY, CUCUL_WHITE, cur++);173 SETPAIR(CACA_BLACK, CACA_DARKGRAY, cur++); 174 SETPAIR(CACA_DARKGRAY, CACA_LIGHTGRAY, cur++); 175 SETPAIR(CACA_LIGHTGRAY, CACA_DARKGRAY, cur++); 176 SETPAIR(CACA_WHITE, CACA_LIGHTGRAY, cur++); 177 SETPAIR(CACA_LIGHTGRAY, CACA_WHITE, cur++); 178 178 179 179 /* white/light, light/dark, lightgray/light, darkgray/dark, dark/black … … 183 183 for(i = 1; i < 7; i++) 184 184 { 185 SETPAIR(C UCUL_WHITE, i + 8, cur++);186 SETPAIR(i + 8, C UCUL_WHITE, cur++);185 SETPAIR(CACA_WHITE, i + 8, cur++); 186 SETPAIR(i + 8, CACA_WHITE, cur++); 187 187 SETPAIR(i, i + 8, cur++); 188 188 SETPAIR(i + 8, i, cur++); 189 SETPAIR(C UCUL_LIGHTGRAY, i + 8, cur++);190 SETPAIR(i + 8, C UCUL_LIGHTGRAY, cur++);191 SETPAIR(C UCUL_DARKGRAY, i, cur++);192 SETPAIR(i, C UCUL_DARKGRAY, cur++);193 SETPAIR(C UCUL_BLACK, i, cur++);189 SETPAIR(CACA_LIGHTGRAY, i + 8, cur++); 190 SETPAIR(i + 8, CACA_LIGHTGRAY, cur++); 191 SETPAIR(CACA_DARKGRAY, i, cur++); 192 SETPAIR(i, CACA_DARKGRAY, cur++); 193 SETPAIR(CACA_BLACK, i, cur++); 194 194 } 195 195 … … 216 216 /* black on light gray, black on white, white on dark gray, dark gray 217 217 * on white, white on blue, light gray on blue (chosen arbitrarily) */ 218 SETPAIR(C UCUL_BLACK, CUCUL_LIGHTGRAY, cur++);219 SETPAIR(C UCUL_BLACK, CUCUL_WHITE, cur++);220 SETPAIR(C UCUL_WHITE, CUCUL_DARKGRAY, cur++);221 SETPAIR(C UCUL_DARKGRAY, CUCUL_WHITE, cur++);222 SETPAIR(C UCUL_WHITE, CUCUL_BLUE, cur++);223 SETPAIR(C UCUL_LIGHTGRAY, CUCUL_BLUE, cur++);218 SETPAIR(CACA_BLACK, CACA_LIGHTGRAY, cur++); 219 SETPAIR(CACA_BLACK, CACA_WHITE, cur++); 220 SETPAIR(CACA_WHITE, CACA_DARKGRAY, cur++); 221 SETPAIR(CACA_DARKGRAY, CACA_WHITE, cur++); 222 SETPAIR(CACA_WHITE, CACA_BLUE, cur++); 223 SETPAIR(CACA_LIGHTGRAY, CACA_BLUE, cur++); 224 224 } 225 225 … … 237 237 for(i = 1; i < 7; i++) 238 238 { 239 if(i != C UCUL_BLUE)239 if(i != CACA_BLUE) 240 240 { 241 SETPAIR(C UCUL_LIGHTGRAY, i, 128 +241 SETPAIR(CACA_LIGHTGRAY, i, 128 + 242 242 slang_assoc[i + 8 + 16 * i]); 243 SETPAIR(C UCUL_WHITE, i, 128 +244 slang_assoc[C UCUL_LIGHTGRAY + 16 * (i + 8)]);243 SETPAIR(CACA_WHITE, i, 128 + 244 slang_assoc[CACA_LIGHTGRAY + 16 * (i + 8)]); 245 245 } 246 SETPAIR(C UCUL_BLACK, i + 8,247 128 + slang_assoc[C UCUL_DARKGRAY + 16 * i]);248 SETPAIR(C UCUL_DARKGRAY, i + 8,246 SETPAIR(CACA_BLACK, i + 8, 247 128 + slang_assoc[CACA_DARKGRAY + 16 * i]); 248 SETPAIR(CACA_DARKGRAY, i + 8, 249 249 128 + slang_assoc[i + 16 * (i + 8)]); 250 SETPAIR(i + 8, C UCUL_DARKGRAY,251 128 + slang_assoc[i + 16 * C UCUL_DARKGRAY]);252 SETPAIR(i, C UCUL_LIGHTGRAY,253 128 + slang_assoc[i + 8 + 16 * C UCUL_LIGHTGRAY]);254 SETPAIR(i, C UCUL_WHITE,255 128 + slang_assoc[i + 8 + 16 * C UCUL_WHITE]);250 SETPAIR(i + 8, CACA_DARKGRAY, 251 128 + slang_assoc[i + 16 * CACA_DARKGRAY]); 252 SETPAIR(i, CACA_LIGHTGRAY, 253 128 + slang_assoc[i + 8 + 16 * CACA_LIGHTGRAY]); 254 SETPAIR(i, CACA_WHITE, 255 128 + slang_assoc[i + 8 + 16 * CACA_WHITE]); 256 256 } 257 257 … … 287 287 { 288 288 SETPAIR(hue_list[i], hue_list[(i + 3) % 6], 289 128 + slang_assoc[hue_list[i] + 16 * C UCUL_BLACK]);289 128 + slang_assoc[hue_list[i] + 16 * CACA_BLACK]); 290 290 SETPAIR(hue_list[i] + 8, hue_list[(i + 3) % 6], 291 128 + slang_assoc[hue_list[i] + 8 + 16 * C UCUL_BLACK]);291 128 + slang_assoc[hue_list[i] + 8 + 16 * CACA_BLACK]); 292 292 SETPAIR(hue_list[(i + 3) % 6], hue_list[i] + 8, 293 128 + slang_assoc[C UCUL_BLACK + 16 * hue_list[i]]);293 128 + slang_assoc[CACA_BLACK + 16 * hue_list[i]]); 294 294 SETPAIR(hue_list[(i + 3) % 6] + 8, hue_list[i] + 8, 295 128 + slang_assoc[C UCUL_WHITE + 16 * (hue_list[i] + 8)]);295 128 + slang_assoc[CACA_WHITE + 16 * (hue_list[i] + 8)]); 296 296 } 297 297 } -
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.