[cl-typesetting-devel] Should justification change inter-letterspacing?

Marc Battyani marc.battyani at fractalconcept.com
Mon Mar 27 14:11:37 UTC 2006


"Peter Heslin" <pj at heslin.eclipse.co.uk> wrote:

>A bit of experimentation shows that when setting a pathological
> paragraph with ( :h-align :justified ), cl-typesetting achieves the
> justification not only by stretching the inter-word space, as it
> should do, but also by slightly stretching the inter-letter spacing,
> which seems like very bad practice to me.  TeX never does this --
> instead, it warns you and sticks text into the margin, which makes it
> obvious that there is a problem.
>
> Here is an example.
>
> (defun test ()
>  (with-document ()
>    (draw-pages (compile-text ()
>                              (paragraph (:h-align :justified)
>                                "aaaaaaaaaaaaa"
>                                "aaaaaaaaaaaaaa aaaaaaaaaaaaaaaaa aaaaaaaaa
> aaaaaaaaaaa aaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaa
>  aaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa
>  aaaaaaaaaaaaaaaaaa aaaaaaaaaaaa aaaaaaaaaaaaaaaaaaa aaaaaaaaaaaa
>  aaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaa
> "))
>                :margins '(72 72 72 72))
>    (when pdf:*page* (finalize-page pdf:*page*))
>    (pdf:write-document #P"/tmp/test.pdf")))

Yes, but it's not a bug, it's a feature ;-)
To change it, have a look at #'make-inter-char-glue and set the 
expansibility to 0 for instance.
Maybe I should put this in a special variable.

The fact that TeX sticks text into the margin in case of problems is one of 
the reasons I wrote cl-typesetting for (along with the fact that you can't 
make complex tables in a reasonably usable  way). I mostly use 
cl-typesetting to generate pdf documents in applications and nobody wants to 
have text in the margin ;-)

Marc 





More information about the cl-typesetting-devel mailing list