source: www/toilet.html @ 1168

Last change on this file since 1168 was 1168, checked in by Sam Hocevar, 17 years ago
  • Use escapeshellarg() instead of escapeshellcmd().
  • Increased input string limit to 40.
  • Property svn:keywords set to Id
File size: 2.9 KB
Line 
1<?php header("Content-Type: text/html; charset=utf-8"); ?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
3       "http://www.w3.org/TR/xhtml1/DTD/xhtml11.dtd">
4
5<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
6
7<head>
8   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
9   <meta name="GENERATOR" content="vim" />
10   <meta name="Author" content="sam@zoy.org (Sam Hocevar)" />
11   <meta name="Description" content="libcaca - TOIlet" />
12   <meta name="Keywords" content="libcaca, ASCII, ASCII ART, console, text mode, ncurses, slang, AAlib" />
13   <title>libcaca - TOIlet</title>
14   <link rel="icon" type="image/x-icon" href="/favicon.ico" />
15   <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />
16   <link rel="stylesheet" type="text/css" href="/main.css" />
17</head>
18
19<body>
20
21<?php include($_SERVER["DOCUMENT_ROOT"]."/header.inc"); ?>
22
23<h2> TOIlet </h2>
24
25<p> The TOIlet project attempts to create a free replacement for the <a
26href="http://www.figlet.org/">FIGlet</a> utility. TOIlet stands for “The
27Other Implementation’s letters”, coined after FIGlet’s “Frank, Ian and
28Glen’s letters”. </p>
29
30<p> TOIlet is in its very early development phase. It uses the powerful
31<i>libcucul</i> library to achieve various text-based effects. TOIlet
32implements or plans to implement the following features: </p>
33
34<ul>
35  <li> The ability to load FIGlet fonts </li>
36  <li> Support for Unicode input and output </li>
37  <li> Support for colour output </li>
38  <li> Support for various output formats: HTML, IRC, ANSI... </li>
39</ul>
40
41<p> TOIlet also aims for full FIGlet compatibility. It is currently only able
42to load FIGlet fonts and render text on a single line, without vertical or
43horizontal smushing. </p>
44
45<h2> Live test </h2>
46
47<? $submit = $_POST['submit'];
48   $text = substr(stripslashes($_POST['text']), 0, 40);
49   $font = $_POST['font'];
50   $fontlist = array('emboss', 'emboss2', 'smbraille');
51   $path = "/tmp/trunk-toilet"; ?>
52
53<form method="post" action="toilet.html">
54  <p>
55    <select name="font">
56      <? foreach($fontlist as $i => $name) { ?>
57        <option value="<?php echo $i; ?>"<? if($i == $font) echo ' selected="selected"';?>><?php echo $name; ?></option>
58      <? } ?>
59    </select>
60    <input type="text" size="50" name="text"
61           value="<? if($text) echo htmlspecialchars($text); ?>" />
62    <input type="submit" name="submit" value="Generate" />
63  </p>
64</form>
65
66<? if($submit) { ?>
67  <blockquote>
68    <p><pre>
69      <? exec($path.'/src/toilet -d '.$path.'/fonts -f "'.$fontlist[$font].'" '.escapeshellarg($text).' | sed "s/\x1b[^m]*m//g"', &$result);
70         foreach($result as $line)
71             echo "\n".htmlspecialchars($line);
72      ?>
73    </pre></p>
74  </blockquote>
75<? } ?>
76
77<h2> Screenshot </h2>
78
79<p style="text-align: center;"><img src="toilet-sample.png" width="570"
80height="372" alt="TOIlet sample" /></p>
81
82<?php $rev = '$Id: toilet.html 1168 2006-09-30 21:46:04Z sam $';
83      include($_SERVER['DOCUMENT_ROOT'].'/footer.inc'); ?>
84
85</body>
86</html>
Note: See TracBrowser for help on using the repository browser.