Login   Register  
PHP Classes
elePHPant
Icontem

Image Font: Render images with text using graphics as fonts

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Info   View files Example   View files View files (15)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings  
2012-01-16 (2 years ago) RSS 2.0 feedNot enough user ratingsTotal: 594 All time: 4,759 This week: 1,475Up
Version License PHP version Categories  
image-font 1.0BSD License5.0PHP 5, Graphics, Text processing
Description Author  

This class can render images with text using graphics as fonts.

It takes a text string and creates an image on which the characters of the string are displayed using separate image files to render each character.

The text may be aligned to the left, right, center or be justified.

The image width may be limited so the text is wrapped if it exceeds that width limit.

The character graphics may be mapped to image files with the same base name in a given directory. Alternatively an array may be passed to define the paths of the character image files.

The generated image may be saved to a file or displayed as the current script output in any of the formats supported by the PHP GD image extension.

Innovation Award  
PHP Programming Innovation award winner
January 2012
Winner


Prize: One downloadable e-book of choice by O'Reilly
Some applications need to use buttons or other types of images on which a given text message is rendered.

If there is no font with characters with a certain aspect that you want to use, you can always create images in PHP by pasting other images that represent the text characters of the message you want to display.

In some cases you may need to render text formatted with special justification.

This class provides solution to render text on images using separate image files as font characters.

You can format the text using several types of justification, in such way that if the text does not fit a given limit width, it can nicely wrap the text around multiple lines.

Manuel Lemos
Picture of Arturs Sosins
Name: Arturs Sosins <contact>
Classes: 22 packages by
Country: Latvia Latvia
Age: 26
All time rank: 821 in Latvia Latvia
Week rank: 20 Up1 in Latvia Latvia Equal
Innovation award
Innovation award
Nominee: 13x

Winner: 2x

  Files folder image Files  
File Role Description
Files folder imagedigits (10 files)
Plain text file image_font.php Class Main class source
Accessible without login Plain text file example_from_array.php Example Example loading images from array
Accessible without login Plain text file example_from_directory.php Example Example loading images from directory
Accessible without login Plain text file example_images.html Data Example with multiline text and alignments
Accessible without login Plain text file example_image_generator.php Example Generating images for example file

  Files folder image Files  /  digits  
File Role Description
  Accessible without login Image file 0.png Data Image for 0 digit
  Accessible without login Image file 1.png Data Image for 1 digit
  Accessible without login Image file 2.png Data Image for 2 digits
  Accessible without login Image file 3.png Data Image for 3 digit
  Accessible without login Image file 4.png Data Image for 4 digit
  Accessible without login Image file 5.png Data Image for 5 digit
  Accessible without login Image file 6.png Data Image for 6 digit
  Accessible without login Image file 7.png Data Image for 7 digit
  Accessible without login Image file 8.png Data Image for 8 digit
  Accessible without login Image file 9.png Data Image for 9 digit

 Version Control Unique User Downloads Download Rankings  
 0%Total:594All time:4,759
 This week:0This week:1,475Up