[cl-typesetting-devel] Decorations and change bars

Marc Battyani marc.battyani at fractalconcept.com
Thu Apr 22 10:57:07 UTC 2004


"Klaus Weidner" <kw at w-m-p.com> wrote:

> On Wed, Apr 21, 2004 at 03:50:57PM -0500, Klaus Weidner wrote:
> > Hmmm, one approach would be to support a function-valued style
parameter,
> > which is called when the character is stroked and can add whatever
> > decoration it wants, based on the box geometry. Ideally this would be
> > stackable, so that for example colored backgrounds don't get turned off
> > when an underline is added in a subsidiary span.
>
> Done, see attached patch. It adds pre-decoration and post-decoration
> styles, which can be keywords (not used at this time) or functions that
> are called before or after drawing characters.
>
> One thing that kept me busy debugging for some time was the effect that
> whenever a style property is NIL, any value assigned to it will be
> permanent since the NIL will not be restored. I've added a comment about
> that in specials.lisp.
>
> A small change to top-level.lisp was needed to support a :finalize-fn
> argument for a function that is called on each complete page.
> Implementing change bars was almost trivial after that, including
> left/right margin alteration for even/odd pages. And that's something
> that apparently isn't even possible in LaTeX...

Yeah I like that! (Stuff not possible with LaTeX)

> With these two changes, I got the fancy change markings I wanted :-) See
> attached PDF and tt-render.lisp. The latter is just a demo and too messy
> for inclusion, I'll try to find the time to clean it up when I'm less
> tired. This is addictive.

Great!

I know it's messy but I feel it's better to publish it anyway so that others
can try and test it. So for now I left all the new code in a
kw-extensions.lisp file but I will dispatch it to better locations later. I
will also change the test example to show the new possibilities. (and move
your tests functions to there)

I've merged all this in the repository and the tarball.

Marc





More information about the cl-typesetting-devel mailing list