Changeset 4766 for libcaca


Ignore:
Timestamp:
Feb 13, 2011, 1:48:50 PM (8 years ago)
Author:
Sam Hocevar
Message:

Rename figfont into charfont. We will support far more than figfonts in
the future.

Location:
libcaca/trunk/caca
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/caca/caca.h

    r4677 r4766  
    5050/** dither structure */
    5151typedef struct caca_dither caca_dither_t;
    52 /** font structure */
     52/** character font structure */
     53typedef struct caca_charfont caca_charfont_t;
     54/** bitmap font structure */
    5355typedef struct caca_font caca_font_t;
    5456/** file handle structure */
     
    414416/*  @} */
    415417
    416 /** \defgroup caca_font libcaca font handling
    417  *
    418  *  These functions provide font handling routines and high quality
     418/** \defgroup caca_charfont libcaca character font handling
     419 *
     420 *  These functions provide character font handling routines.
     421 *
     422 *  @{ */
     423__extern caca_charfont_t *caca_load_charfont(void const *, size_t);
     424__extern int caca_free_charfont(caca_charfont_t *);
     425/*  @} */
     426
     427/** \defgroup caca_font libcaca bitmap font handling
     428 *
     429 *  These functions provide bitmap font handling routines and high quality
    419430 *  canvas to bitmap rendering.
    420431 *
  • libcaca/trunk/caca/caca_internals.h

    r4369 r4766  
    2020typedef struct caca_timer caca_timer_t;
    2121typedef struct caca_privevent caca_privevent_t;
    22 typedef struct caca_figfont caca_figfont_t;
    2322
    2423#if !defined(_DOXYGEN_SKIP_ME)
     
    7675
    7776    /* FIGfont management */
    78     caca_figfont_t *ff;
     77    caca_charfont_t *ff;
    7978};
    8079
  • libcaca/trunk/caca/figfont.c

    r4369 r4766  
    3030#include "caca_internals.h"
    3131
    32 struct caca_figfont
     32struct caca_charfont
    3333{
    3434    int term_width;
     
    4848
    4949static uint32_t hsmush(uint32_t ch1, uint32_t ch2, int rule);
    50 static caca_figfont_t * open_figfont(char const *);
    51 static int free_figfont(caca_figfont_t *);
     50static caca_charfont_t * open_charfont(char const *);
     51static int free_charfont(caca_charfont_t *);
    5252
    5353/** \brief load a figfont and attach it to a canvas */
    5454int caca_canvas_set_figfont(caca_canvas_t *cv, char const *path)
    5555{
    56     caca_figfont_t *ff = NULL;
     56    caca_charfont_t *ff = NULL;
    5757
    5858    if(path)
    5959    {
    60         ff = open_figfont(path);
     60        ff = open_charfont(path);
    6161        if(!ff)
    6262            return -1;
     
    6868        free(cv->ff->left);
    6969        free(cv->ff->right);
    70         free_figfont(cv->ff);
     70        free_charfont(cv->ff);
    7171    }
    7272
     
    130130int caca_put_figchar(caca_canvas_t *cv, uint32_t ch)
    131131{
    132     caca_figfont_t *ff = cv->ff;
     132    caca_charfont_t *ff = cv->ff;
    133133    int c, w, h, x, y, overlap, extra, xleft, xright;
    134134
     
    254254int caca_flush_figlet(caca_canvas_t *cv)
    255255{
    256     caca_figfont_t *ff = cv->ff;
     256    caca_charfont_t *ff = cv->ff;
    257257    int x, y;
    258258
     
    288288#define EXT_GLYPHS (STD_GLYPHS + 7)
    289289
    290 static caca_figfont_t * open_figfont(char const *path)
     290static caca_charfont_t * open_charfont(char const *path)
    291291{
    292292#if !defined __KERNEL__ && defined HAVE_SNPRINTF
     
    295295    char buf[2048];
    296296    char hardblank[10];
    297     caca_figfont_t *ff;
     297    caca_charfont_t *ff;
    298298    char *data = NULL;
    299299    caca_file_t *f;
    300300    int i, j, size, comment_lines;
    301301
    302     ff = malloc(sizeof(caca_figfont_t));
     302    ff = malloc(sizeof(caca_charfont_t));
    303303    if(!ff)
    304304    {
     
    485485}
    486486
    487 int free_figfont(caca_figfont_t *ff)
     487int free_charfont(caca_charfont_t *ff)
    488488{
    489489    caca_free_canvas(ff->fontcv);
Note: See TracChangeset for help on using the changeset viewer.