Ignore:
Timestamp:
Sep 27, 2008, 3:12:46 PM (11 years ago)
Author:
Sam Hocevar
Message:

Starting refactoring to get rid of libcucul. The initial reason for the
split is rendered moot by the plugin system: when enabled, binaries do
not link directly with libX11 or libGL. I hope this is a step towards
more consisteny and clarity.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/tools/sortchars.c

    r2397 r2821  
    2121#endif
    2222
    23 #include "cucul.h"
     23#include "caca.h"
    2424
    2525#define GLYPHS 0x7f
     
    4949    int count[DX][DY];
    5050    char utf8[7];
    51     cucul_canvas_t *cv;
    52     cucul_font_t *f;
     51    caca_canvas_t *cv;
     52    caca_font_t *f;
    5353    char const * const * fonts;
    5454    uint8_t *img;
     
    5656    int ret, i, max;
    5757
    58     /* Load a libcucul internal font */
    59     fonts = cucul_get_font_list();
     58    /* Load a libcaca internal font */
     59    fonts = caca_get_font_list();
    6060    if(fonts[FONT] == NULL)
    6161    {
    62         fprintf(stderr, "error: libcucul was compiled without any fonts\n");
     62        fprintf(stderr, "error: libcaca was compiled without any fonts\n");
    6363        return -1;
    6464    }
    65     f = cucul_load_font(fonts[FONT], 0);
     65    f = caca_load_font(fonts[FONT], 0);
    6666    if(f == NULL)
    6767    {
     
    7070    }
    7171
    72     cv = cucul_create_canvas(1, 1);
    73     cucul_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);
    7474
    7575    /* Create our bitmap buffer (32-bit ARGB) */
    76     w = cucul_get_font_width(f);
    77     h = cucul_get_font_height(f);
     76    w = caca_get_font_width(f);
     77    h = caca_get_font_height(f);
    7878    img = malloc(4 * w * h);
    7979
     
    9595    for(i = 0x20; i < GLYPHS; i++)
    9696    {
    97         cucul_put_char(cv, 0, 0, i);
     97        caca_put_char(cv, 0, 0, i);
    9898
    9999        /* Render the canvas onto our image buffer */
    100         cucul_render_canvas(cv, f, img, w, h, 4 * w);
     100        caca_render_canvas(cv, f, img, w, h, 4 * w);
    101101
    102102        for(y = 0; y < h * DY; y++)
     
    166166    for(i = 0; i < FULLRANGE; i++)
    167167    {
    168         ret = cucul_utf32_to_utf8(utf8, bestchar[i]);
     168        ret = caca_utf32_to_utf8(utf8, bestchar[i]);
    169169        utf8[ret] = '\0';
    170170        printf("%i, ", bestchar[i]);
     
    176176    for(i = 0; i < GLYPHS; i++)
    177177    {
    178         ret = cucul_utf32_to_utf8(utf8, bestchar[i]);
     178        ret = caca_utf32_to_utf8(utf8, bestchar[i]);
    179179        utf8[ret] = '\0';
    180180        printf("0x%03x, ", allbits[i]);
     
    184184    printf("\n};\n");
    185185
    186     cucul_free_canvas(cv);
     186    caca_free_canvas(cv);
    187187
    188188    testcircle();
     
    253253                }
    254254
    255             ret = cucul_utf32_to_utf8(utf8, bestchar[bits]);
     255            ret = caca_utf32_to_utf8(utf8, bestchar[bits]);
    256256            utf8[ret] = '\0';
    257257            printf("%s", utf8);
Note: See TracChangeset for help on using the changeset viewer.