[REBOL] Re: Justifying text
From: carl:cybercraft at: 15-Dec-2002 23:36
On 15-Dec-02, Gabriele Santilli wrote:
> Hi Carl,
> On Sunday, December 15, 2002, 1:02:33 AM, you wrote:
>> And that simplified things a lot, as did adding background
>> the text faces so I could see exactly what was
>> happening.
> Why are you using two faces per line?
Consider a line of 10 characters that's five pixels short of the width
you want the line to be. If you set font/space to 1x0, that'd add
nine pixels to the width of the line, (1 between each character),
which would make it too wide.
What you need to do is add 1 pixel between the first six characters
and leave the following four spaces at 0x0 - hence the need for two
faces. And using two faces means you need padding between them as
well.
Does that make sense? (:
There's a lot of other ways you could do this I guess, such as a face
per word and using the padding between them to get the width right,
but that'd mean much more than two faces per line in most cases.
--
Carl Read