No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

fullwidth.c 2.1 KiB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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(caca, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLUE);
  37. cucul_putstr(caca, 0, i, CACA);
  38. cucul_set_color(caca, CUCUL_COLOR_WHITE, CUCUL_COLOR_RED);
  39. cucul_putchar(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(caca, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLUE);
  46. cucul_putstr(caca, 0, i, CACA);
  47. cucul_set_color(caca, CUCUL_COLOR_WHITE, CUCUL_COLOR_GREEN);
  48. cucul_putstr(caca, i - 2, i, "ホ");
  49. }
  50. cucul_blit(cv, 15, 1, caca, NULL);
  51. /* Line of canvas */
  52. cucul_set_color(line, CUCUL_COLOR_WHITE, CUCUL_COLOR_MAGENTA);
  53. cucul_putstr(line, 0, 0, "ほ");
  54. for(i = 0; i < 10; i++)
  55. {
  56. cucul_set_color(caca, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLUE);
  57. cucul_putstr(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. }