Full justification

Ken Ray kray at sonsothunder.com
Sat Jul 30 23:27:43 EDT 2005


On 7/30/05 9:06 AM, "Jim Hurley" <jhurley at infostations.com> wrote:

> Perhaps another way to approach the problem of full justification for
> non-proportional fonts is to insert spaces whose width is set to 1
> point.
> 
> It turns out that the formatted width of the 2 point space character,
> with the points size set to 2 pts, (at least in Times font)  is 1
> point. (Pardon the dual use of the word "point.")
> 
> If the width needed to fill in the line, so that the text is also
> right-justified, is say N points, then one might distribute N spaces
> between intervening words (each insert is one point in width.)
> 
> (I ran into one of the few instances where recursion is truly
> useful--beside fractals and the Tower of Hanoi.)
> 
> To see this try (in the message box):
> 
> go stack url "http://home.infostations.net/jhurley/JustifyText.rev"

Nicely done, Jim! Now is there was some way to determine the number of
points needed based on different fonts and sizes, we could have a general
purpose justification routine!


Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: kray at sonsothunder.com





More information about the use-livecode mailing list