PHP Classes

Image Fit Text Class: Adjust font size to fit a text in a limited area

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in Bookmark in
  Info   View files View files (3)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings  
2012-08-30 (2 years ago) RSS 2.0 feedNot yet rated by the usersTotal: 513 All time: 5,307 This week: 1,182Up
Version License PHP version Categories  
image-fit-text 0.1Free To Use But R...5.0Algorithms, Graphics, Text processing
Description Author  

This class can adjust font size to fit a text in a limited area.

It can take a given text string and the width and height of an area and tries to fit the text by decreasing the font size.

The class starts from a given initial font size and may stop at a given minimum font size if the text is too large to fit.

The text may wrap around to be split in multiple lines. The length of the wrapped text may be limited to a given minimum.

Innovation Award  
PHP Programming Innovation award nominee
September 2012
Number 5

Prize: One copy of the Zend Studio
Some applications need to dynamically generate images that contain text.

In some cases the images may not be larger than a given width or height.

This class provides a solution to fit a text in an image of limited width reducing the text font size if necessary.

Manuel Lemos
Picture of Kai Ming Choi
Name: Kai Ming Choi <contact>
Classes: 15 packages by
Country: Hong Kong Hong Kong
Age: 22
All time rank: 5213 in Hong Kong Hong Kong
Week rank: 1618 Down9 in Hong Kong Hong Kong Down
Innovation award
Innovation award
Nominee: 3x

  Files folder image Files  
File Role Description
Plain text file imagefittext.class.php Class the class
Accessible without login Plain text file example.php Example example
Accessible without login Plain text file font Data Please find font file for the example before you try it

 Version Control Unique User Downloads Download Rankings  
 0%Total:513All time:5,307
 This week:0This week:1,182Up