Monkey Font Generator
Monkey Forums/Monkey Code/Monkey Font Generator
| ||
Thought it would be nice to have a resource place on here where people can dump monkey fonts they've made for others to use, it can be kind of a time sink to make a new monkey font so all my fonts that i use i am going to start dumping here. Arkitech Font 96 chars 12x12 ![]() |
| ||
NVM i just made a php script that will generate a monkey font here http://vigilsoft.net/monkeyfonts/monkeyfontgen.php ALSO in case my site goes down Form <html> <head> <title>Monkey Font Generator!</title> </head> <body> <h2>Monkey Font Generator</h2> <hr/> <form method="post" action="makemonkeyfont.php"> Font:<br/> <select name="fontfile"> <?php $dir = scandir("."); foreach ($dir as $file) { $ext = pathinfo($file, PATHINFO_EXTENSION); if(strtolower($ext)=="ttf") { echo '<option value="'.$file.'">'.strtolower($file).'</option>'; } } ?> </select><br/> Size:<br/> <input type="text" name="fontsize" value="12" /><br/> Use Shadow: <input type="checkbox" name="fontshadow" value="1" /><br/> Font Color: <br/> <input type="text" name="fontcolor" value="0,0,0" /> <i> comma seperated rgb values (0-255)</i><br/> BG Color: <br/> <input type="text" name="fontbgcolor" value="255,255,255" /> <i> comma seperated rgb values (0-255)</i><br/> <input type="submit" value="Make Monkey Font!" /> </form> </body> </html> makemonkeyfont.php <?php // Set the content-type header('Content-Type: image/png'); // Create the image $im = imagecreatetruecolor(($_POST['fontsize']+2)*96, $_POST['fontsize']+6); $fontc = explode(",",$_POST['fontcolor']); $fontb = explode(",",$_POST['fontbgcolor']); // Create some colors $white = imagecolorallocate($im, $fontb[0], $fontb[1], $fontb[2]); $shadow = imagecolorallocate($im, 128, 128, 128); $fontcolor = imagecolorallocate($im, $fontc[0], $fontc[1], $fontc[2]); imagefilledrectangle($im, 0, 0, ($_POST['fontsize']+2)*96, $_POST['fontsize']+6, $white); // The text to draw $text = 'Testing...'; // Replace path by your own font path $font = $_POST['fontfile']; for ($i = 0; $i < 96; $i++) { if($_POST['fontshadow']==1) { imagettftext($im, $_POST['fontsize'], 0, $i*($_POST['fontsize']+2)+1, $_POST['fontsize']+1, $shadow, $font, chr ( $i+32 )); } imagettftext($im, $_POST['fontsize'], 0, $i*($_POST['fontsize']+2), $_POST['fontsize'], $fontcolor, $font, chr ( $i+32 )); } // Add some shadow to the text // Add the text //imagettftext($im, 20, 0, 10, 20, $black, $font, $text); // Using imagepng() results in clearer text compared with imagejpeg() imagepng($im); imagedestroy($im); ?> |