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.
 
 
 
 
 
 

72 lines
1.7 KiB

  1. #!/usr/bin/php5
  2. <?php
  3. /*
  4. * fullwidth libcaca fullwidth Unicode characters test program
  5. * Copyright (c) 2006 Sam Hocevar <sam@zoy.org>
  6. * All Rights Reserved
  7. *
  8. * $Id$
  9. *
  10. * This program is free software. It comes without any warranty, to
  11. * the extent permitted by applicable law. You can redistribute it
  12. * and/or modify it under the terms of the Do What The Fuck You Want
  13. * To Public License, Version 2, as published by Sam Hocevar. See
  14. * http://sam.zoy.org/wtfpl/COPYING for more details.
  15. */
  16. define('CACA', "쫊쫊쫊쫊쫊쫊쫊쫊쫊쫊쫊쫊쫊쫊쫊");
  17. $cv = caca_create_canvas(0, 0);
  18. if(! $cv)
  19. {
  20. die("Can't created canvas\n");
  21. }
  22. $dp = caca_create_display($cv);
  23. if(! $dp)
  24. {
  25. die("Can't create display\n");
  26. }
  27. $caca = caca_create_canvas(6, 10);
  28. $line = caca_create_canvas(2, 1);
  29. /* Line of x's */
  30. for($i = 0; $i < 10; $i++)
  31. {
  32. caca_set_color_ansi($caca, CACA_WHITE, CACA_BLUE);
  33. caca_put_str($caca, 0, $i, CACA);
  34. caca_set_color_ansi($caca, CACA_WHITE, CACA_RED);
  35. caca_put_char($caca, $i - 2, $i, ord('x'));
  36. }
  37. caca_blit($cv, 1, 1, $caca);
  38. /* Line of ホ's */
  39. for($i = 0; $i < 10; $i++)
  40. {
  41. caca_set_color_ansi($caca, CACA_WHITE, CACA_BLUE);
  42. caca_put_str($caca, 0, $i, CACA);
  43. caca_set_color_ansi($caca, CACA_WHITE, CACA_GREEN);
  44. caca_put_str($caca, $i - 2, $i, "ホ");
  45. }
  46. caca_blit($cv, 15, 1, $caca);
  47. /* Line of canvas */
  48. caca_set_color_ansi($line, CACA_WHITE, CACA_MAGENTA);
  49. caca_put_str($line, 0, 0, "ほ");
  50. for($i = 0; $i < 10; $i++)
  51. {
  52. caca_set_color_ansi($caca, CACA_WHITE, CACA_BLUE);
  53. caca_put_str($caca, 0, $i, CACA);
  54. caca_blit($caca, $i - 2, $i, $line);
  55. }
  56. caca_blit($cv, 29, 1, $caca);
  57. caca_refresh_display($dp);
  58. caca_get_event($dp, CACA_EVENT_KEY_PRESS, -1);
  59. ?>