Use imagettfbbox().  This function calculates the bounding box given the
font, size and actual text within which that text would fit.

-Rasmus

On Fri, 17 May 2002, Anzak Wolf wrote:

> I'm working on getting some image creation scripts done and I have one
> requirement that I'm not sure how to handle.  I have a base image that I can
> create with no problem.  The problem comes in that I want to set some text
> in the exact center of the image.  Is there some sort of formula I can use
> for finding the x,y point to start from based on a string and which font and
> angle I use in to create it so that I can get the text correctly centered?
>
> -Jim
>
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to