Full justification

Jim Hurley jhurley at infostations.com
Sat Jul 30 10:06:17 EDT 2005


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"

Jim

P.S. Thanks to Phil Davis for pointing out that the formattedText of 
a field separates the lines. Thanks Phil.



More information about the use-livecode mailing list