Justify text in a field - THE SOLUTION!!!

MisterX b.xavier at internet.lu
Thu Jul 28 10:02:31 EDT 2005


Actually IT IS POSSIBLE!!!

Jonathan flipped my mind switch back in gear ;)

Give a field's width w and the formattedwidth of the text in line l...
you might have to add each word's formattedwith (and get pissed off
at the definition of a word in rev) - then divide the difference by 
the number of words in the line and then insert "tiny" spaces in between
the words... This should do the trick...

By tiny spaces, i mean that they have to be small enough to
fit the line without over flowing it. so reducing their size 
should help... you can't simulate kerning or letter width scaling
but you can simulate variable word spacing...

hope that helps...
Xavier
http://monsieurx.com

 

> -----Original Message-----
> From: use-revolution-bounces at lists.runrev.com 
> [mailto:use-revolution-bounces at lists.runrev.com] On Behalf Of 
> Lynch, Jonathan
> Sent: Thursday, July 28, 2005 15:43
> To: How to use Revolution
> Subject: RE: Justify text in a field
> 
> 
> >Do you mean the formattedrect of a single line?
> 
> 
> Certainly - You can do formattedrect for any chunk of a 
> field, be it lines, characters, words, etc...
> 
> >if i remember well, Colin inserted spaces between words, and set the 
> >styles of words to extended and condensed, but i could not find his 
> >code now. :-(
> 
> This sounds like it would be designed not for centering, but 
> for having the line spread out evenly from right to left (I 
> forget what that is called). Is that what you need? The 
> calculations would be a bit more complex, but still quite doable.
> 
> >In scrolling fields this could take a while.
> >Did you had some timings available for this technique? In this way i 
> >could know beforehand if it is user's friendly.
> 
> Ah - you are not just talking about centering a single line, 
> you are talking about having all lines spread out evenly. The 
> would get a bit tricky. Once you did this, you would not 
> really be able to properly type in that field, without it 
> doing weird stuff.
>  
> >This idea is fine and very precise,
> >but what will happen if you had to
> >copy and paste this text elsewhere.
> 
> If you pasted it into another field in Rev, with the same 
> settings and dimensions, it should work fine. However, pasted 
> somewhere else that was not in Rev, or in a Rev field with 
> different settings, it would be a mess.
> 
> >You'll be carrying a lot of empty space with the copied text, unless 
> >you perform some cleaning up in copied text. :-(
> 
> I think perhaps I was confused by what you mean by the word 
> 'Justify' - I think of that as a word to go with left, right, 
> and center justification. I just looked it up, and the evenly 
> spread out type is called 'double justification'. In html, 
> you would do something like:
> <div align="justify">blah blah blah</div> to give it double 
> justification.
> 
> I think, for what it sounds like you are doing, you really 
> need something like that. Unfortunately, Rev doesn't give 
> that option - yet.
> 
> As long as a field is wide enough, and a given screen line 
> contains enough words, manipulating expanded and condensed 
> characters should make this possible - sounds kind of difficult to me.
> 		
> ____________________________________________________
> Start your day with Yahoo! - make it your home page 
> http://www.yahoo.com/r/hs 
>  
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage 
> your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
> 
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage 
> your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
> 




More information about the use-livecode mailing list