Center text within a field?

Trevor DeVore lists at mangomultimedia.com
Wed Jun 6 06:43:47 EDT 2007


I'm trying to center text in a field within a graphic (circle). The  
text can be any font and any size.

I've been experimenting with code to center text within the field and  
then set the loc of the circle to the loc of the field. I have yet to  
find a method that perfectly centers text of any given font and any  
given size within a field though.

Among other things I tried using the formattedRect of char X, but  
that doesn't report the true size of the character as it appears on  
the screen (textheight seems to be used for the reported height).  
While this works for some fonts, it doesn't for others.

So I'm wondering if anyone has any ideas or has done this before?

Thanks,

-- 
Trevor DeVore
Blue Mango Learning Systems
www.bluemangolearning.com    -    www.screensteps.com
trevor at bluemangolearning.com



Email has been scanned for viruses by Altman Technologies' email management service - www.altman.co.uk/emailsystems



More information about the use-livecode mailing list