[cl-typesetting-devel] leading/line-spacing and text style

Dmitriy Ivanov divanov at aha.ru
Thu Oct 4 06:09:44 UTC 2007


Hello Cyrus,

| Is there a way to set the vertical spacing between lines on a per-
| style basis? How about adding a line-spacing (or highjacking the
| existing leading) to the style class? Looks (yeah, right) trivial
| enough, but I figured I'd ask if there was a better way first.

IMHO, incorporating *leading-ratio* into the text-style class is quite
reasonable. The use-style method would look like the following:

(defmethod use-style ((style text-style))
  (macrolet ((%use-style% (name var)
        `(let ((style (,name style)))
   (when style (setf ,var style)))))
    ...
    (%use-style% leading-ratio *leading-ratio*))
  (when (and (leading-ratio style) (or (font style)(font-size style)))
    (setf *leading* (* *font-size* *leading-ratio*))))

The other xxx-style methods should also reset the value of *leading*
appropriately. Could you experiment, please?
--
Sincerely,
Dmitriy Ivanov
lisp.ystok.ru




More information about the cl-typesetting-devel mailing list