groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Groff] Rules drawn with \D are rounded


From: Werner LEMBERG
Subject: Re: [Groff] Rules drawn with \D are rounded
Date: Wed, 19 Jul 2006 19:42:06 +0200 (CEST)

> > Well, it is justifiable, but it isn't documented correctly.
>
> The only justification I can think of is that this way it is
> not apparent when a closed curve isn't closed properly (in the
> Postscript sense).  This shouldn't happen in a Postscript-aware
> application, however.

I don't think so.  Consider for example a rectangle, with border,
where the left half of the interior is coloured green, and the right
half is coloured red.  This can be most easily done with

  \Z'\D'p 2 0   0 1   -2 0''\
  \M[green]\
  \Z'\D'P 1 0   0 1   -1 0''\
  \h'1'
  \M[red]\
  \Z'\D'P 1 0   0 1   -1 0''

If the \D'P...' command drew a border also, I would have to set the
border width to zero before filling the interior.

> The PS prologue file contains "1 setlinecap 1 setlinejoin" in the
> begin-page procedure BP, which means that your custom settings will
> be overwritten on the beginning of a new page.

Hmm, yes.  Not the most clever design, I admit.

> (By the way, I've also added a line "DEFS /BPhook known { DEFS begin
> BPhook end } if" to BP, which lets me define a custom Postscript
> beginning-of-page function BPhook in the document (with "ps: def")
> that gets executed before groff prints anything on the page.  This
> is useful for watermarks or colored backgrounds.)

Sounds useful.  Can you provide a patch, with documentation?

> > An unfilled polygon uses strokes to connect the points; those
> > strokes obey the settings of PS functions `setlinecap' and
> > `setlinejoin', which are both activated.  On the other hand, a
> > filled polygon simply fills the area defined by straight lines
> > which connect its corner coordinates.
>
> Note that this means that a filled and an unfilled polygon have a
> different size (unless maybe the line width is zero).

Exactly.  I've already documented that.


    Werner




reply via email to

[Prev in Thread] Current Thread [Next in Thread]