in reply to Newline in GD?
So.... you could write a simple loop, to make your string fit the width of the graphic, and when it approaches the limit, shift your next string down by 1.5 times the height of your font, which you can obtain from $gd_text->get('height').$gd_text->width(string) return the length of a string in pixels, without changing the current value of the text. Returns the width of string rendered in the cur rent font and size. On failure, returns undef.
You should be able to print nicely wrapped text, breaking on whole words, with a clever loop to construct and test current string width in pixels.
|
|---|