Vertically aligning text in a field

Terence Heaford t.heaford at btinternet.com
Fri Dec 19 15:17:00 EST 2014


I think we are on a different wavelength here.

The code I was originally using from the forum was:

   --   put the effective textSize of fld id tID into tTextSize
   --   put round (((tTextSize - 24) * 1/3)) into tOffset
   --   put the formattedheight of char 1 to - 1 of fld id tID into tFormattedHeight
   --   put round((the height of fld id tID - tFormattedHeight) / 2) into tVerticalMargins
   --   put tVerticalMargins - tOffset into tTopMargin
   --   put tVerticalMargins + tOffset into tBottomMargin
   --   set the margins of fld id tID to 8,tTopMargin,8,tBottomMargin


This is the line I had to adjust

   --   put round (((tTextSize - 24) * 1/3)) into tOffset

I think it was originally 22 not 24.

Was this code yours or Bernd's.

Not sure how I seemed to have upset you but that was not my intention.

All the best

Terry


> On 19 Dec 2014, at 19:57, Geoff Canyon <gcanyon at gmail.com> wrote:
> 
> What requirement am I missing that this isn't sufficient -- and capable of
> handling multiple fonts and font sizes throughout the text?




More information about the use-livecode mailing list