Changeset 4766
- Timestamp:
- Feb 13, 2011, 1:48:50 PM (11 years ago)
- Location:
- libcaca/trunk/caca
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/caca/caca.h
r4677 r4766 50 50 /** dither structure */ 51 51 typedef struct caca_dither caca_dither_t; 52 /** font structure */ 52 /** character font structure */ 53 typedef struct caca_charfont caca_charfont_t; 54 /** bitmap font structure */ 53 55 typedef struct caca_font caca_font_t; 54 56 /** file handle structure */ … … 414 416 /* @} */ 415 417 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 419 430 * canvas to bitmap rendering. 420 431 * -
libcaca/trunk/caca/caca_internals.h
r4369 r4766 20 20 typedef struct caca_timer caca_timer_t; 21 21 typedef struct caca_privevent caca_privevent_t; 22 typedef struct caca_figfont caca_figfont_t;23 22 24 23 #if !defined(_DOXYGEN_SKIP_ME) … … 76 75 77 76 /* FIGfont management */ 78 caca_ figfont_t *ff;77 caca_charfont_t *ff; 79 78 }; 80 79 -
libcaca/trunk/caca/figfont.c
r4369 r4766 30 30 #include "caca_internals.h" 31 31 32 struct caca_ figfont32 struct caca_charfont 33 33 { 34 34 int term_width; … … 48 48 49 49 static 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 *);50 static caca_charfont_t * open_charfont(char const *); 51 static int free_charfont(caca_charfont_t *); 52 52 53 53 /** \brief load a figfont and attach it to a canvas */ 54 54 int caca_canvas_set_figfont(caca_canvas_t *cv, char const *path) 55 55 { 56 caca_ figfont_t *ff = NULL;56 caca_charfont_t *ff = NULL; 57 57 58 58 if(path) 59 59 { 60 ff = open_ figfont(path);60 ff = open_charfont(path); 61 61 if(!ff) 62 62 return -1; … … 68 68 free(cv->ff->left); 69 69 free(cv->ff->right); 70 free_ figfont(cv->ff);70 free_charfont(cv->ff); 71 71 } 72 72 … … 130 130 int caca_put_figchar(caca_canvas_t *cv, uint32_t ch) 131 131 { 132 caca_ figfont_t *ff = cv->ff;132 caca_charfont_t *ff = cv->ff; 133 133 int c, w, h, x, y, overlap, extra, xleft, xright; 134 134 … … 254 254 int caca_flush_figlet(caca_canvas_t *cv) 255 255 { 256 caca_ figfont_t *ff = cv->ff;256 caca_charfont_t *ff = cv->ff; 257 257 int x, y; 258 258 … … 288 288 #define EXT_GLYPHS (STD_GLYPHS + 7) 289 289 290 static caca_ figfont_t * open_figfont(char const *path)290 static caca_charfont_t * open_charfont(char const *path) 291 291 { 292 292 #if !defined __KERNEL__ && defined HAVE_SNPRINTF … … 295 295 char buf[2048]; 296 296 char hardblank[10]; 297 caca_ figfont_t *ff;297 caca_charfont_t *ff; 298 298 char *data = NULL; 299 299 caca_file_t *f; 300 300 int i, j, size, comment_lines; 301 301 302 ff = malloc(sizeof(caca_ figfont_t));302 ff = malloc(sizeof(caca_charfont_t)); 303 303 if(!ff) 304 304 { … … 485 485 } 486 486 487 int free_ figfont(caca_figfont_t *ff)487 int free_charfont(caca_charfont_t *ff) 488 488 { 489 489 caca_free_canvas(ff->fontcv);
Note: See TracChangeset
for help on using the changeset viewer.