You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

71 lines
1.6 KiB

  1. /*
  2. * fullwidth libcaca fullwidth Unicode characters test program
  3. * Copyright (c) 2006 Sam Hocevar <sam@zoy.org>
  4. * All Rights Reserved
  5. *
  6. * $Id$
  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. #include "config.h"
  14. #include "common.h"
  15. #if !defined(__KERNEL__)
  16. # if defined(HAVE_INTTYPES_H)
  17. # include <inttypes.h>
  18. # endif
  19. # include <stdio.h>
  20. #endif
  21. #include "cucul.h"
  22. #include "caca.h"
  23. #define CACA "쫊쫊쫊쫊쫊쫊쫊쫊쫊쫊쫊쫊쫊쫊쫊"
  24. int main(int argc, char *argv[])
  25. {
  26. cucul_canvas_t *cv, *caca;
  27. caca_display_t *dp;
  28. unsigned int i;
  29. cv = cucul_create_canvas(0, 0);
  30. dp = caca_create_display(cv);
  31. caca = cucul_create_canvas(6, 10);
  32. for(i = 0; i < 10; i++)
  33. {
  34. cucul_set_color(caca, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLUE);
  35. cucul_putstr(caca, 0, i, CACA);
  36. cucul_set_color(caca, CUCUL_COLOR_WHITE, CUCUL_COLOR_RED);
  37. cucul_putchar(caca, i - 2, i, 'x');
  38. }
  39. cucul_blit(cv, 1, 1, caca, NULL);
  40. for(i = 0; i < 10; i++)
  41. {
  42. cucul_set_color(caca, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLUE);
  43. cucul_putstr(caca, 0, i, CACA);
  44. cucul_set_color(caca, CUCUL_COLOR_WHITE, CUCUL_COLOR_GREEN);
  45. cucul_putstr(caca, i - 2, i, "ホ");
  46. }
  47. cucul_blit(cv, 15, 1, caca, NULL);
  48. caca_refresh_display(dp);
  49. caca_get_event(dp, CACA_EVENT_KEY_PRESS, NULL, -1);
  50. caca_free_display(dp);
  51. cucul_free_canvas(cv);
  52. return 0;
  53. }