Trevor DeVore wrote:
On Jun 6, 2007, at 3:43 AM, Trevor DeVore wrote:

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

Update - I haven't been able to find a reliable means of calculating the center of text using any field properties so I resorted to exporting a snapshot of the field (opaque = false) to an image, grabbing the alphadata of the image and determining extreme left, top, right, bottom of the text by looping through it.

Does this work? :

on mouseUp
  set the width of fld 1 to the width of grc 1 -- the circle
  get the textsize of fld 1
  set the textheight of fld 1 to it + (it div 3)
  set the height of fld 1 to the formattedheight of fld 1
  set the margins of fld 1 to the textheight of fld 1 div 3
  set the loc of fld 1 to the loc of grc 1
end mouseUp

The field must have fixedLineHeight set to false. You might have to jiggle the margins and textheight calcs a little bit.

--
Jacqueline Landman Gay         |     [EMAIL PROTECTED]
HyperActive Software           |     http://www.hyperactivesw.com
_______________________________________________
use-revolution mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to