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.
Back to contents
Back to contents
<?php
//create class instance provided path to images
include("image_font.php");
$imf = new image_font("./digits/");
//provide text
$imf->apply_font("26056123");
//output image to browser
$imf->output();
?>Back to contents
Example scripts provided with package in action:
Back to contents
Back to method list
| Method name | new image_font($source) |
| Description | Create class instance |
| Input parameters | string or array $source - the source of images as array of values with symbols as keys or path to directory, where file names are symbols |
Back to method list
| Method name | set_source($source) |
| Description | Set source where to take images for text |
| Input parameters | string or array $source - the source of images as array of values with symbols as keys or path to directory, where file names are symbols |
Back to method list
| Method name | set_space($px) |
| Description | Set width of space symbol |
| Input parameters | int $px - width of space in pixels |
Back to method list
| Method name | set_letter_spacing($px) |
| Description | Set width of space between symbols |
| Input parameters | int $px - width of space between symbols |
Back to method list
| Method name | set_line_spacing($px) |
| Description | Set width of space between lines |
| Input parameters | int $px - width of space between lines |
Back to method list
| Method name | set_extension($ext) |
| Description | Set extension of file that will be used as letters and as image output extension |
| Input parameters | string $ext - name of extension |
Back to method list
| Method name | apply_font($text, $align = "left", $max = 0) |
| Description | Set text to write with image font |
| Input parameters | string $text - text to write with images
string $align - alignment of text, possible values: left, right, center, justify
int $max - width restriction for text in pixels, 0 equals no restriction |
Back to method list
| Method name | get_width() |
| Description | Get width of image |
Back to method list
| Method name | get_height() |
| Description | Get height of image |
Back to method list
| Method name | output() |
| Description | Output image directly to browser |
Back to method list
| Method name | download($name = "default") |
| Description | Force download of file |
| Input parameters | string $name - name of file to force download |
Back to method list
| Method name | save($filename) |
| Description | Save file to a specified location with specified file name |
| Input parameters | string $filename - path and name of file where to save it |
Back to contents
Image Font class was nominated to Innovation Award and achieved 1st place, thanks everyone for support
Back to contents
None for now