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

Peter Heslin pj at heslin.eclipse.co.uk
Mon Mar 27 20:57:30 UTC 2006


On Mon, Mar 27, 2006 at 04:11:37PM +0200, Marc Battyani wrote:
> 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.

Thanks for the tip -- this does what I want:

(defun make-inter-char-glue ()
  (make-instance 'hglue :dx 0 
		 :max-expansion 0
		 :max-compression 0
		 :expansibility 0 :compressibility 0))

Is it possible to have cl-typesetting signal a warning when the
inter-word spacing stretches more than a certain amount?

> 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 ;-)

Well, it's not that text in the margin is a good outcome, it's that
for many people, letter-spacing text is not an acceptable way to solve
the problem.  Many good books on typographical design, such as
Bringhurst's _The Elements of Typographical Style_, recommend strongly
against ever, ever letter-spacing lower-case text.  Goudy once
famously compared the practice to stealing sheep.

On a different but related matter, I have another problem for you.

Here is another sample document:

(defun test ()
  (with-document ()
    (draw-pages (compile-text ()
                              (paragraph (:h-align :justified)
                                (enumerate ()
                                    (item () "foo")
                                    (item () "bar"
                                          (enumerate ()
                                            (item () "a")
                                            (item () "b")))
                                    (item () "baz"))))
                :margins '(72 72 72 72)
                )
    (when pdf:*page* (finalize-page pdf:*page*))
    (pdf:write-document #P"/tmp/test.pdf")))

When you compile this, note that the word "bar" is in the wrong
place.  If you change the alignment of the paragraph to :left, then
the problem goes away.

I think that the reason the word "bar" is in the wrong place is that
inter-word space is being added between the number "2." and the word
"bar" in an effort to justify the text.  But it shouldn't stretch the
inter-word space in that position -- it should act as if the word
"bar" is at the start of a line.  Is there any way to fix this?

Thanks for all your help,

Peter

-- 
Peter Heslin (http://www.dur.ac.uk/p.j.heslin)



More information about the cl-typesetting-devel mailing list