Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 
 
 

93 lignes
3.6 KiB

  1. /*
  2. * unicode libcaca Unicode rendering 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. #if defined(HAVE_INTTYPES_H)
  15. # include <inttypes.h>
  16. #else
  17. typedef unsigned char uint8_t;
  18. typedef unsigned short uint16_t;
  19. typedef unsigned int uint32_t;
  20. #endif
  21. #include "cucul.h"
  22. #include "caca.h"
  23. int main(void)
  24. {
  25. cucul_t *qq;
  26. caca_t *kk;
  27. qq = cucul_init();
  28. kk = caca_attach(qq);
  29. cucul_set_color(qq, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLUE);
  30. cucul_putstr(qq, 1, 1, "Basic Unicode support");
  31. cucul_set_color(qq, CUCUL_COLOR_LIGHTGRAY, CUCUL_COLOR_BLACK);
  32. cucul_putstr(qq, 1, 2, "This is ASCII: | abc DEF 123 !@# |");
  33. cucul_putstr(qq, 1, 3, "This is Unicode: | äßç δεφ ☺♥♀ ╞╬╗ |");
  34. cucul_putstr(qq, 1, 4, "And this is, too: | ἀβϛ ΔЗҒ ᚴᛒᛯ ♩♔✈ |");
  35. cucul_putstr(qq, 1, 5, "If the three lines do not have the same length, there is a bug somewhere.");
  36. cucul_set_color(qq, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLUE);
  37. cucul_putstr(qq, 1, 7, "Gradient glyphs");
  38. cucul_set_color(qq, CUCUL_COLOR_LIGHTGRAY, CUCUL_COLOR_BLACK);
  39. cucul_putstr(qq, 31, 8, " 0%");
  40. cucul_putstr(qq, 31, 9, " 25%");
  41. cucul_putstr(qq, 31, 10, " 50%");
  42. cucul_putstr(qq, 31, 11, " 75%");
  43. cucul_putstr(qq, 31, 12, "100%");
  44. cucul_set_color(qq, CUCUL_COLOR_LIGHTRED, CUCUL_COLOR_LIGHTGREEN);
  45. cucul_putstr(qq, 1, 8, " ");
  46. cucul_putstr(qq, 1, 9, "░░░░░░░░░░░░░░░░░░░░░░░░░░░░░");
  47. cucul_putstr(qq, 1, 10, "▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒");
  48. cucul_putstr(qq, 1, 11, "▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓");
  49. cucul_putstr(qq, 1, 12, "█████████████████████████████");
  50. cucul_set_color(qq, CUCUL_COLOR_LIGHTGREEN, CUCUL_COLOR_LIGHTRED);
  51. cucul_putstr(qq, 36, 8, "█████████████████████████████");
  52. cucul_putstr(qq, 36, 9, "▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓");
  53. cucul_putstr(qq, 36, 10, "▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒");
  54. cucul_putstr(qq, 36, 11, "░░░░░░░░░░░░░░░░░░░░░░░░░░░░░");
  55. cucul_putstr(qq, 36, 12, " ");
  56. cucul_set_color(qq, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLUE);
  57. cucul_putstr(qq, 1, 14, "Double width characters");
  58. cucul_set_color(qq, CUCUL_COLOR_LIGHTRED, CUCUL_COLOR_BLACK);
  59. cucul_putstr(qq, 1, 15, "| ドラゴン ボーレ |");
  60. cucul_set_color(qq, CUCUL_COLOR_LIGHTGRAY, CUCUL_COLOR_BLACK);
  61. cucul_putstr(qq, 1, 16, "| ()()()() ()()() |");
  62. cucul_set_color(qq, CUCUL_COLOR_YELLOW, CUCUL_COLOR_BLACK);
  63. cucul_putstr(qq, 1, 17, "| ドラゴン");
  64. cucul_putstr(qq, 10, 17, "ボーレ |");
  65. cucul_set_color(qq, CUCUL_COLOR_LIGHTGRAY, CUCUL_COLOR_BLACK);
  66. cucul_putstr(qq, 1, 18, "If the three lines do not have the same length, there is a bug somewhere.");
  67. caca_display(kk);
  68. while(!caca_get_event(kk, CACA_EVENT_KEY_PRESS));
  69. caca_detach(kk);
  70. cucul_end(qq);
  71. return 0;
  72. }