Changeset 3281 for libcaca


Ignore:
Timestamp:
Nov 4, 2008, 6:28:03 AM (11 years ago)
Author:
bsittler
Message:

htmlification

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/caca-php/examples/www/unicode.php

    • Property svn:executable deleted
    r3280 r3281  
    1 #!/usr/bin/php5
     1<?php
     2header('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
     7<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    28<?php
    39/*
     
    1824 *  http://sam.zoy.org/wtfpl/COPYING for more details.
    1925 */
     26?>
     27<head>
     28<title>libcaca Unicode rendering test program</title>
     29<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
     30</head>
     31<body text="silver" bgcolor="black">
     32<?php
    2033
    21 if (php_sapi_name() != "cli") {
    22         die("You have to run this program with php-cli!\n");
    23 }
    24 
    25 $cv = caca_create_canvas(0, 0);
     34$cv = caca_create_canvas(80, 25);
    2635if(! $cv)
    2736{
    2837        die("Can't created canvas\n");
    29 }
    30 $dp = caca_create_display($cv);
    31 if(! $dp)
    32 {
    33         die("Can't create display\n");
    3438}
    3539caca_set_color_ansi($cv, CACA_WHITE, CACA_BLUE);
     
    8791caca_put_str($cv, 1, 24, "misc Unicode: ● ☭ ☮ ☯ ♔ ♛ ♙ ♞ ⚒ ⚓ ⚠");
    8892
    89 caca_refresh_display($dp);
    90 
    91 caca_get_event($dp, CACA_EVENT_KEY_PRESS, -1);
     93echo caca_export_string($cv, "html3");
    9294
    9395?>
     96</body>
     97</html>
Note: See TracChangeset for help on using the changeset viewer.