Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

fullwidth.php 1.9 KiB

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