[REBOL] Re: Justifying text
From: greggirwin:mindspring at: 13-Dec-2002 11:19
Hi Carl,
CR> How were you hoping to display the text? Something specific (as
CR> apposed to general-purpose) mightn't be that hard to put together
CR> using a list (perhaps).
I was thinking, that you could do it yourself, though it would
probably be hideously slow one way, and complex the other way.
If you could get the lines, as wrapped, for a face (but I don't know
that you can as line-list doesn't always seem to be set), then you
could iterate over them, find the actual width for each line, take
that from the width you want, giving you a width delta, then count
words and add (delta/word-count) to each offset, using either draw
commands or faces. Faces would be bad unless you only need a few.
Alternately, on Windows, you could call the DRAWTEXT API to render the
text to a DC and then grab the DC as an image and display it, but that
would be a big pain IMO.
-- Gregg