justify text
xbury.cs at clearstream.com
xbury.cs at clearstream.com
Tue Nov 23 10:10:47 EST 2004
Andrew,
I gave it a try to see...
First, if your line is wrapped (and assume we have 2 paragraphs wrapped
over
5 lines), line 2 corresponds to paragraph 2. And wrapped line is not a
line!
You can get the length of any part of the field (word, items) with some
exceptions
put the formattedwidth of word 3 of fld 1
so you can recurse and find what you need.
But after line 1... you have to fake the justification by breaking
paragraph 1 into
it's line components. Then adjust the formattedwidth of each line by
inserting
spaces between the words (will look ugly!) so it matches the "effective
formattedwidth" of the field.
If you resize the field, it's all broken, start over...
It's easy with monospace fonts and a fixed width.
But other factors such as the runrev definition of a word (which grabs any
chars
together regardless of punctuation, or grammar rules as a single word)
will make
this a nightmare to parse! Option-space (non-breakable spaces or in
html)
will make it harder still...
Better of waiting until RunRev makes a better styled field with paragraph
independent
styling and alignment...
cheers
Xavier
On 23.11.2004 15:48:03 use-revolution-bounces wrote:
>if we had a stringwidth function like some xtalks and once was there via
an
>xcmd, it could be done but slow...its was a key part of Postscript to do
full
>justification...you have to space words and letters recursively to do
>right..its math and cpu intenstive. I would love to see more Postscript
like
>functions
>in Transcript..been wanting this stuff for many years ;-)
>
>Andrew
>_______________________________________________
>use-revolution mailing list
>use-revolution at lists.runrev.com
>http://lists.runrev.com/mailman/listinfo/use-revolution
-----------------------------------------
Visit us at http://www.clearstream.com
IMPORTANT MESSAGE Internet communications are not secure and therefore
Clearstream International does not accept legal responsibility for the
contents of this message. The information contained in this e-mail is
confidential and may be legally privileged. It is intended solely for the
addressee. If you are not the intended recipient, any disclosure, copying,
distribution or any action taken or omitted to be taken in reliance on it,
is prohibited and may be unlawful. Any views expressed in this e-mail are
those of the individual sender, except where the sender specifically states
them to be the views of Clearstream International or of any of its
affiliates or subsidiaries. END OF DISCLAIMER
More information about the use-livecode
mailing list