選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 
 
 
 

84 行
2.1 KiB

  1. <?php
  2. header('Content-Type: text/html; charset=UTF-8');
  3. ?>
  4. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  5. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  6. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  7. <?php
  8. /*
  9. * fullwidth libcaca fullwidth Unicode characters test program
  10. * Copyright (c) 2008 Benjamin C. Wiley Sittler <bsittler@gmail.com>
  11. *
  12. * This file is a Php port of "examples/fullwidth.c"
  13. * which is:
  14. * Copyright (c) 2006 Sam Hocevar <sam@zoy.org>
  15. * All Rights Reserved
  16. *
  17. * $Id$
  18. *
  19. * This program is free software. It comes without any warranty, to
  20. * the extent permitted by applicable law. You can redistribute it
  21. * and/or modify it under the terms of the Do What The Fuck You Want
  22. * To Public License, Version 2, as published by Sam Hocevar. See
  23. * http://sam.zoy.org/wtfpl/COPYING for more details.
  24. */
  25. ?>
  26. <head>
  27. <title>sample program for libcaca php binding</title>
  28. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  29. </head>
  30. <body text="silver" bgcolor="black">
  31. <?php
  32. define('CACA', "쫊쫊쫊쫊쫊쫊쫊쫊쫊쫊쫊쫊쫊쫊쫊");
  33. $cv = caca_create_canvas(36, 12);
  34. if(! $cv)
  35. {
  36. die("Can't created canvas\n");
  37. }
  38. $caca = caca_create_canvas(6, 10);
  39. $line = caca_create_canvas(2, 1);
  40. /* Line of x's */
  41. for($i = 0; $i < 10; $i++)
  42. {
  43. caca_set_color_ansi($caca, CACA_WHITE, CACA_BLUE);
  44. caca_put_str($caca, 0, $i, CACA);
  45. caca_set_color_ansi($caca, CACA_WHITE, CACA_RED);
  46. caca_put_char($caca, $i - 2, $i, ord('x'));
  47. }
  48. caca_blit($cv, 1, 1, $caca);
  49. /* Line of ホ's */
  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_set_color_ansi($caca, CACA_WHITE, CACA_GREEN);
  55. caca_put_str($caca, $i - 2, $i, "ホ");
  56. }
  57. caca_blit($cv, 15, 1, $caca);
  58. /* Line of canvas */
  59. caca_set_color_ansi($line, CACA_WHITE, CACA_MAGENTA);
  60. caca_put_str($line, 0, 0, "ほ");
  61. for($i = 0; $i < 10; $i++)
  62. {
  63. caca_set_color_ansi($caca, CACA_WHITE, CACA_BLUE);
  64. caca_put_str($caca, 0, $i, CACA);
  65. caca_blit($caca, $i - 2, $i, $line);
  66. }
  67. caca_blit($cv, 29, 1, $caca);
  68. echo caca_export_string($cv, "html3");
  69. ?>
  70. </body>
  71. </html>