variable length string using GD (word wrap, carriage return, word/character count)?
here's the problem
i'm trying to take elements of an array (each element is a separate string) and trying to render the strings with imagettftext
the problem is of course gd only renders so many pixels based on the width and height of the initial image so if i try to output a string that exceeds that width it gets cut off
in theory i could use strpos to cut it pieces for output
or i could use str_word_count() to break it into words and output so many
words per line by concatinating them with a separating " "
however both options only work if the text is static and always will have the same amount of total characters and the same sized words or one iteration might look fine and another might have words chopped off in the middle
perhaps somehow a combination of both? or does gdlib have a way of emulating word wrap?
edit: p.s. i have 40 columns to play with
nvm i seem to have figured it out, if anyone can suggest how to improve uppon this method i would appreciate it ;)
|All times are GMT -5. The time now is 01:23 PM.|