Trying to use imagettftext to draw text on an image. The width and height is fixed. I'm having trouble calculating the basepoint of the first character (x and y). The text is supplied by the user so sometimes I can do one line and sometimes as many as three lines. Someone must have done this before and have a good algorithm. Or is this the wrong function to use?