On 16 June 2011 23:59, Brian Dunning <br...@briandunning.com> wrote:
> Hey all -
> I need to create PNG images with transparent backgrounds that contain text. 
> The text will come from four fields in a database, and needs to be centered, 
> and text wrapped. The fields are going to be of varying lengths, so each 
> block of text (which will be shown in a different font size) will flow onto 
> an unknown number of lines, and I want to start the next line right below, 
> wherever it is.
> Unfortunately I have come up against some restrictions.
>        - I will not be able to use ImageMagick.
>        - I have Ghostscript, but only version 7.07.
>        - The server is Red Hat 4.x with PHP 5.2 and installing new software 
> is unlikely.
> Can anyone suggest a tool to make this easiest?
> :-(
> - Brian

Do you have the image extension loaded?

A LONG time ago (nearly 7 years ago - just when I first started using
PHP - so please forgive the code), I built a script to take words and
scale them to fill a box.

The technique of getting the size of the text could still be useful here.

It was in response to a question on Experts Exchange

The code is awful by my current standards. But it worked. So there
must be something in that.

I'll send you the code directly as, frankly, it is embarrassing to see today.

Richard Quadling
Twitter : EE : Zend : PHPDoc
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to