[cl-typesetting-devel] Q: Reference points absolute coordinates?

Dmitri Ivanov divanov at aha.ru
Wed Nov 3 16:57:54 UTC 2004


Hello Marc,

|> Is it possible to find the absolute coordinates of a ref-point on the
|> page?
| Generally it's not possible as an arbitrary transformation can be
| there. If you just want to go up one level, that is getting the
| top-left coordinates of the cell in the document referential it should
| be possible to modify stroke table to put the stroke of the cell
| content outside the pdf:translate thus staying in the document
| referential.

As we have the specials *table* and *table-row* anyhow, I suggest binding
them inside
stroke-table, e.g.

(defun stroke-table (table x y rows dy)
  (let* ((*table* table))
   ...
    (loop ...
          for row in (append (header table) rows (footer table))
          for row-y = (- y padding border) then (- row-y height
full-size-offset)
          and height = (height row)
          and *table-row* = row
        ...
))

That could facilitate computing absolute cell coordinates via
add-contextual-action, e.g.

(let ((row-heights ()))
  (tt:compile-text ()
    (tt:mark-ref-point 'table-top)
    (tt:table (:col-widths '(100 150))
         (tt:row (:height min-row-height)
           (tt:cell ()
            ...
             (tt:add-contextual-action
                (lambda () (push (+ (tt::height tt::*table-row*)
                                           (* 2 (tt::cell-padding tt::*table*)))))
                        row-heights))))
      ...))))

--
Sincerely,
Dmitri Ivanov
lisp.ystok.ru





More information about the cl-typesetting-devel mailing list