source: trunk/tools/make-font.cpp @ 85

Last change on this file since 85 was 85, checked in by sam, 10 years ago

Simple tool to create a font file.

  • Property svn:keywords set to Id
File size: 484 bytes
Line 
1
2#include <caca.h>
3
4#include <cstdlib>
5#include <cstdio>
6
7int main(void)
8{
9    caca_canvas_t *cv = caca_create_canvas(16, 16);
10    caca_set_color_ansi(cv, CACA_WHITE, CACA_TRANSPARENT);
11
12    for (unsigned int n = 0; n < 256; n++)
13        caca_put_char(cv, n % 16, n / 16, n);
14
15    size_t len;
16    void *buffer = caca_export_canvas_to_memory(cv, "tga", &len);
17    fwrite(buffer, len, 1, stdout);
18    free(buffer);
19
20    /* Free everything */
21    caca_free_canvas(cv);
22
23    return 0;
24}
25
Note: See TracBrowser for help on using the repository browser.