source: libcaca/trunk/test/unicode.c @ 562

Last change on this file since 562 was 562, checked in by Sam Hocevar, 14 years ago
  • Added a tiny Unicode test program. Of course it does not work yet, but good to have something to start with.
  • Property svn:keywords set to Id
File size: 1.1 KB
Line 
1/*
2 *  unicode       libcaca Unicode rendering test program
3 *  Copyright (c) 2006 Sam Hocevar <sam@zoy.org>
4 *                All Rights Reserved
5 *
6 *  $Id: unicode.c 562 2006-03-09 12:34:40Z sam $
7 *
8 *  This program is free software; you can redistribute it and/or
9 *  modify it under the terms of the Do What The Fuck You Want To
10 *  Public License, Version 2, as published by Sam Hocevar. See
11 *  http://sam.zoy.org/wtfpl/COPYING for more details.
12 */
13
14#include "config.h"
15
16#if defined(HAVE_INTTYPES_H)
17#   include <inttypes.h>
18#else
19typedef unsigned char uint8_t;
20typedef unsigned short uint16_t;
21typedef unsigned int uint32_t;
22#endif
23
24#include "cucul.h"
25#include "caca.h"
26
27int main(void)
28{
29    cucul_t *qq;
30    caca_t *kk;
31
32    qq = cucul_init();
33    kk = caca_attach(qq);
34
35    cucul_putstr(qq, 1, 1, "This is ASCII:   [ abc DEF 123 !@# ]");
36    cucul_putstr(qq, 1, 2, "This is Unicode: [ äβç ΔЗҒ ░▒▓ ♩♔✈ ]");
37
38    cucul_putstr(qq, 1, 4, "If the two lines do not have the same length, there is a bug somewhere.");
39
40    caca_display(kk);
41
42    while(!caca_get_event(kk, CACA_EVENT_KEY_PRESS));
43
44    caca_detach(kk);
45    cucul_end(qq);
46
47    return 0;
48}
49
Note: See TracBrowser for help on using the repository browser.