On Tue, 26 Mar 2002, Fabio Spinelli wrote:
> Hi all, I'm writing a script that generate invoices in a PNG files.
> My problem is that I have to write the numbers aligned to the right.
> I'm using the funciotn ImageTTFText and it haven't a parm that tells the
> I looked at the IMAGE functions list in www.php.net but I didn't found
> nothing about the alignment.
> Does anyone know if there's a function or a parameter to write with TTF
> fonts aligned to the RIGHT?
First call the function ImageTTFBBox with your text. The array you receive
in response will contain the information you need to calculate the width
of the text ($a - $a). Then just subtract that from your desired
right margin when you draw the text with ImageTTFText.
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php