This isn't a "upload image, get it converted into text" type site. Instead, you type in some text, and the script makes a larger version of the same text out of symbols.
PHP Code:
[...]
<?php
include('font.php');
@$text = $_POST['text'];
if($_POST['fontsize'] != '') $fontsize = $_POST['fontsize']; else $fontsize = 9;
if($_POST['spacing'] != '') $spacing = $_POST['spacing']; else $spacing = 9;
if(!isset($text))
{
$text = 'you forgot to enter some text!';
}
if(!isset($fontsize))
{
$fontsize = 9;
}
if(!isset($spacing))
{
$spacing = 9;
}
$lines = array(
0 => '',
1 => '',
2 => '',
3 => '',
4 => '',
5 => '',
);
for($i = 0; $i < strlen($text); $i++)
{
$char = strtolower($text{$i});
if(array_key_exists($char, $font))
{
$bigchar = explode("\n", $font[$char]);
$longestline = 0;
for($j = 0; $j < 6; $j++)
{
for($k = 0; $k < strlen($bigchar[$j]); $k++)
{
if(strlen($bigchar[$j]) > $longestline)
{
$longestline = strlen($bigchar[$j]);
}
}
}
for($j = 0; $j < 6; $j++)
{
for($k = 0; $k < strlen($bigchar[$j]); $k++)
{
if(strlen($bigchar[$j]) < $longestline)
{
for($l = strlen($bigchar[$j]); $l < $longestline; $l++)
{
$bigchar[$j] .= ' ';
}
}
}
$lines[$j] .= $bigchar[$j];
}
}
}
echo '
<h1>Your textified text</h1>
<div style="white-space: nowrap; font-family: Monaco; font-size: '.$fontsize.'px; line-height: '.$spacing.'px; overflow: scroll; width: 100%; padding-bottom: 10px;">
';
for($i = 0; $i < 6; $i++)
{
echo str_replace(' ', ' ', $lines[$i])."<br/>";
}
echo '</div><h1>How to use it</h1>
Copy the text from the box above. If using it in HTML, make sure you replace all the spaces with &nbsp; (or you can copy the source code of this page). The font should be something monospaced (here it is Monaco).
';
?>
[...]
It is mostly a simple script, except that when I made the font (a PHP array in a separate file) I didn't add spaces at the end of each line of the characters, so I had to write 24 extra lines of code (4 nested for loops at one point...), to fix the problem. If you want to try it out, it's at
http://textify.1scripts.net/.