[thelist] setting the wrap width of rendered text usng php gd

Dunstan Orchard dunstan at 1976design.com
Sun Oct 13 19:06:01 CDT 2002

Hi again,

does anyone know how to limit the width of text when writing it to an image in

I am writing text to an image 300px wide, so I want to wrap the text display
at something like 280px - but I can't figure out how?

See an example of my text not wrapping here:


My plan is to limit the text width, then work out the height of the text box
using imagettfbbox() then create the image with the height set to accomodate
the text...

Any help gratefully received,

thanks as always,

- dunstan

Dorset, England

More information about the thelist mailing list