PHP Classes

File: fontdemo.php

Recommend this page to a friend!
  Classes of Lucas Baltes   PHP Figlet   fontdemo.php   Download  
File: fontdemo.php
Role: Example script
Content type: text/plain
Description: Script demoing all fonts
Class: PHP Figlet
Draw text strings using ASCII art fonts
Author: By
Last change: no userlogin required
Date: 20 years ago
Size: 819 bytes
 

Contents

Class file image Download
<?php
/* _ _____ _ _ _
 * ___ | |_ ___ | __||_| ___ | | ___ | |_
 * | . || || . || __|| || . || || -_|| _|
 * | _||_|_|| _||__| |_||_ ||_||___||_|
 * |_| |_| |___|
 *
 * This script opens the supplied font directory and
 * shows a line of text in every available font
 *
 */

require("phpfiglet_class.php");

$out = "";

$phpFiglet = new phpFiglet();

if (
$handle = opendir('fonts')) {

    while (
false !== ($file = readdir($handle)))
    {
        if (
$file != "." && $file != "..") {
            if (
$phpFiglet->loadFont("fonts/" . $file)) {
               
$out .= $file . "\n";
               
$out .= $phpFiglet->fetch("Hello World");
               
$out .= "\n\n";
            }
        }
    }
   
closedir($handle);
}
?>
<html>
<body>
<pre>
<?php print $out; ?>
<pre>
</body>
</html>