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.
 
 
 
 
 
 

89 lines
2.1 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, *line;
  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. line = cucul_create_canvas(2, 1);
  33. /* Line of x's */
  34. for(i = 0; i < 10; i++)
  35. {
  36. cucul_set_color_ansi(caca, CUCUL_WHITE, CUCUL_BLUE);
  37. cucul_put_str(caca, 0, i, CACA);
  38. cucul_set_color_ansi(caca, CUCUL_WHITE, CUCUL_RED);
  39. cucul_put_char(caca, i - 2, i, 'x');
  40. }
  41. cucul_blit(cv, 1, 1, caca, NULL);
  42. /* Line of ホ's */
  43. for(i = 0; i < 10; i++)
  44. {
  45. cucul_set_color_ansi(caca, CUCUL_WHITE, CUCUL_BLUE);
  46. cucul_put_str(caca, 0, i, CACA);
  47. cucul_set_color_ansi(caca, CUCUL_WHITE, CUCUL_GREEN);
  48. cucul_put_str(caca, i - 2, i, "ホ");
  49. }
  50. cucul_blit(cv, 15, 1, caca, NULL);
  51. /* Line of canvas */
  52. cucul_set_color_ansi(line, CUCUL_WHITE, CUCUL_MAGENTA);
  53. cucul_put_str(line, 0, 0, "ほ");
  54. for(i = 0; i < 10; i++)
  55. {
  56. cucul_set_color_ansi(caca, CUCUL_WHITE, CUCUL_BLUE);
  57. cucul_put_str(caca, 0, i, CACA);
  58. cucul_blit(caca, i - 2, i, line, NULL);
  59. }
  60. cucul_blit(cv, 29, 1, caca, NULL);
  61. caca_refresh_display(dp);
  62. caca_get_event(dp, CACA_EVENT_KEY_PRESS, NULL, -1);
  63. caca_free_display(dp);
  64. cucul_free_canvas(line);
  65. cucul_free_canvas(caca);
  66. cucul_free_canvas(cv);
  67. return 0;
  68. }