having a bit of a brain melt here and could do with some help on the logic for solving this issue.
im basically going to be creating images that are just text based on a user input.
Image width is fixed, so i need to parse the text so it all fits on the image, but i need to make sure that i only split on a whitespace and not break up words.
like this
after X amount of characters split string on last whitespace.
then after the next X amount of characters repeat.
The only way i can think of doing this is by looping through the text to find the last whitepace before X characters (if x is not a whitespace), splitting the string. and then repeating.
Can anyone think of a more elegant solution or is this probably the best way?