Vertically aligning text in a field

Terence Heaford t.heaford at btinternet.com
Thu Dec 18 02:26:30 EST 2014


Have Runrev been requested to provide vertically aligned text as part of LC as I presume they have ALL the dimensional information available to calculate this?

All the best

Terry


> On 16 Dec 2014, at 11:04, Mark Schonewille <m.schonewille at economy-x-talk.com> wrote:
> 
> Hi Terry,
> 
> There's a long discussion about this on the forum. I believe I did a good attempt, but Bernd's solution was probably the most reliable.
> 
> --
> Best regards,
> 
> Mark Schonewille
> 
> Economy-x-Talk Consulting and Software Engineering
> Homepage: http://economy-x-talk.com
> Twitter: http://twitter.com/xtalkprogrammer
> KvK: 50277553
> 
> Installer Maker for LiveCode:
> http://qery.us/468
> 
> Buy my new book "Programming LiveCode for the Real Beginner" http://qery.us/3fi
> 
> LiveCode on Facebook:
> https://www.facebook.com/groups/runrev/
> 
> On 12/16/2014 11:54, Terence Heaford wrote:
>> Is there a definitive calculation that correctly sets the position of text vertically in a field?
>> 
>> I am using LC 6.7.
>> 
>> I have come across a few ideas like the one below that all appear to use an arbitrary offset to the margins, is there a method to calculate this accurately?
>> 
>>    put the effective textSize of fld id tID into tTextSize
>>    --   put round (((tTextSize - 22) * 1/3)) into tOffset
>>    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
>> 
>> All the best
>> 
>> Terry
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list