Changeset 2110 for libcaca/trunk


Ignore:
Timestamp:
Dec 1, 2007, 6:58:20 PM (13 years ago)
Author:
Sam Hocevar
Message:
  • Implemented cucul_canvas_set_figfont() from TOIlet’s open_font().
Location:
libcaca/trunk
Files:
2 added
7 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/cucul/Makefile.am

    r2109 r2110  
    3030        export.c \
    3131        file.c \
     32        figfont.c \
    3233        $(NULL)
    3334libcucul_la_DEPENDENCIES = \
  • libcaca/trunk/cucul/canvas.c

    r2043 r2110  
    491491    free(cv->frames);
    492492
    493     memcpy(cv, new, sizeof(cucul_canvas_t));
     493    cv->frames = new->frames;
    494494    free(new);
    495495
  • libcaca/trunk/cucul/cucul.c

    r2075 r2110  
    8686    cucul_set_color_ansi(cv, CUCUL_DEFAULT, CUCUL_TRANSPARENT);
    8787
     88    cv->ff = NULL;
     89
    8890    if(cucul_resize(cv, width, height) < 0)
    8991    {
     
    306308        free(cv->frames[f].name);
    307309    }
     310
     311    if(cv->ff)
     312        _cucul_free_figfont(cv->ff);
    308313
    309314    free(cv->frames);
  • libcaca/trunk/cucul/cucul.h

    r2109 r2110  
    279279                                 unsigned int);
    280280__extern int cucul_free_font(cucul_font_t *);
     281/*  @} */
     282
     283/** \defgroup cucul_figfont libcucul FIGfont handling
     284 *
     285 *  These functions provide FIGlet and TOIlet font handling routines.
     286 *
     287 *  @{ */
     288__extern int cucul_canvas_set_figfont(cucul_canvas_t *, char const *);
    281289/*  @} */
    282290
  • libcaca/trunk/cucul/cucul_internals.h

    r2109 r2110  
    2020#endif
    2121
     22typedef struct cucul_figfont cucul_figfont_t;
     23
    2224struct cucul_frame
    2325{
     
    4042struct cucul_canvas
    4143{
     44    /* XXX: look at cucul_set_canvas_boundaries() before adding anything
     45     * to this structure. The function is quite hacky. */
     46
    4247    /* Frame information */
    4348    unsigned int frame, framecount;
     
    5560    uint32_t *attrs;
    5661    uint32_t curattr;
     62
     63    /* FIGfont management */
     64    cucul_figfont_t *ff;
    5765};
    5866
     
    7886extern char *_cucul_file_gets(char *, int, cucul_file_t *);
    7987
     88/* FIGfont functions */
     89extern cucul_figfont_t * _cucul_open_figfont(char const *);
     90extern int _cucul_free_figfont(cucul_figfont_t *);
     91
    8092#endif /* __CUCUL_INTERNALS_H__ */
  • libcaca/trunk/examples/.gitignore

    r2101 r2110  
    77event
    88export
     9figfont
    910font
    1011font2tga
  • libcaca/trunk/examples/Makefile.am

    r2101 r2110  
    33AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/cucul -I$(top_srcdir)/caca -DDATADIR=\"$(pkgdatadir)\"
    44
    5 noinst_PROGRAMS = blit colors cucul demo demo0 dithering event export font font2tga frames fullwidth gamma hsv input spritedit swallow text transform truecolor unicode import
     5noinst_PROGRAMS = blit colors cucul demo demo0 dithering event export figfont font font2tga frames fullwidth gamma hsv input spritedit swallow text transform truecolor unicode import
    66
    77blit_SOURCES = blit.c
     
    3030export_SOURCES = export.c
    3131export_LDADD = ../cucul/libcucul.la
     32
     33figfont_SOURCES = figfont.c
     34figfont_LDADD = ../cucul/libcucul.la
    3235
    3336font_SOURCES = font.c
Note: See TracChangeset for help on using the changeset viewer.