PHP Classes

File: example_from_array.php

Recommend this page to a friend!
  Classes of Arturs Sosins  >  Image Font  >  example_from_array.php  >  Download  
File: example_from_array.php
Role: Example script
Content type: text/plain
Description: Example loading images from array
Class: Image Font
Render images with text using graphics as fonts
Author: By
Last change:
Date: 4 years ago
Size: 1,312 bytes


Class file image Download
 * This script is developed by Arturs Sosins aka ar2rsawseen,
 * Feel free to distribute and modify code, but keep reference to its creator
 * Image Font class can generate text taking images of symbols as font.
 * You can provide path to directory with images, using symbols as file names,
 * or you can provide and array with symbols as keys and paths to images as values.
 * It is also possible to set a maximal width restriction and alignment of text.
 * For more information, examples and online documentation visit:

//array with symbol images
$symbols = array(
"0" => "./digits/0.png",
"1" => "./digits/1.png",
"2" => "./digits/2.png",
"3" => "./digits/3.png",
"4" => "./digits/4.png",
"5" => "./digits/5.png",
"6" => "./digits/6.png",
"7" => "./digits/7.png",
"8" => "./digits/8.png",
"9" => "./digits/9.png"

//create class instance with symbol array
$imf = new image_font($symbols);

//provide text

//output image to browser