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.
 
 
 
 
 
 

90 line
2.2 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. It comes without any warranty, to
  9. * the extent permitted by applicable law. You can redistribute it
  10. * and/or modify it under the terms of the Do What The Fuck You Want
  11. * To Public License, Version 2, as published by Sam Hocevar. See
  12. * http://sam.zoy.org/wtfpl/COPYING for more details.
  13. */
  14. #include "config.h"
  15. #include "common.h"
  16. #if !defined(__KERNEL__)
  17. # if defined(HAVE_INTTYPES_H)
  18. # include <inttypes.h>
  19. # endif
  20. # include <stdio.h>
  21. #endif
  22. #include "cucul.h"
  23. #include "caca.h"
  24. #define CACA "쫊쫊쫊쫊쫊쫊쫊쫊쫊쫊쫊쫊쫊쫊쫊"
  25. int main(int argc, char *argv[])
  26. {
  27. cucul_canvas_t *cv, *caca, *line;
  28. caca_display_t *dp;
  29. unsigned int i;
  30. cv = cucul_create_canvas(0, 0);
  31. dp = caca_create_display(cv);
  32. caca = cucul_create_canvas(6, 10);
  33. line = cucul_create_canvas(2, 1);
  34. /* Line of x's */
  35. for(i = 0; i < 10; i++)
  36. {
  37. cucul_set_color_ansi(caca, CUCUL_WHITE, CUCUL_BLUE);
  38. cucul_put_str(caca, 0, i, CACA);
  39. cucul_set_color_ansi(caca, CUCUL_WHITE, CUCUL_RED);
  40. cucul_put_char(caca, i - 2, i, 'x');
  41. }
  42. cucul_blit(cv, 1, 1, caca, NULL);
  43. /* Line of ホ's */
  44. for(i = 0; i < 10; i++)
  45. {
  46. cucul_set_color_ansi(caca, CUCUL_WHITE, CUCUL_BLUE);
  47. cucul_put_str(caca, 0, i, CACA);
  48. cucul_set_color_ansi(caca, CUCUL_WHITE, CUCUL_GREEN);
  49. cucul_put_str(caca, i - 2, i, "ホ");
  50. }
  51. cucul_blit(cv, 15, 1, caca, NULL);
  52. /* Line of canvas */
  53. cucul_set_color_ansi(line, CUCUL_WHITE, CUCUL_MAGENTA);
  54. cucul_put_str(line, 0, 0, "ほ");
  55. for(i = 0; i < 10; i++)
  56. {
  57. cucul_set_color_ansi(caca, CUCUL_WHITE, CUCUL_BLUE);
  58. cucul_put_str(caca, 0, i, CACA);
  59. cucul_blit(caca, i - 2, i, line, NULL);
  60. }
  61. cucul_blit(cv, 29, 1, caca, NULL);
  62. caca_refresh_display(dp);
  63. caca_get_event(dp, CACA_EVENT_KEY_PRESS, NULL, -1);
  64. caca_free_display(dp);
  65. cucul_free_canvas(line);
  66. cucul_free_canvas(caca);
  67. cucul_free_canvas(cv);
  68. return 0;
  69. }