[GRASS-dev] ps.map: diag_up.eps pattern improve

Glynn Clements glynn at gclements.plus.com
Wed Feb 4 20:08:36 EST 2009


Hamish wrote:

> > because postscript clip with into the boundingbox limit the outside
> > parts are not stroke but this eps make a full diagonal up line.
> 
> I am not at all a PostScript expert - is it valid to place coordinates
> beyond the limits of the bounding box? (similar question for GRASS's
> symbol format)

The PostScript language treats any line beginning with a % as a
comment.

DSC comments (beginning with %%) are used by programs which manipulate
PostScript code, e.g. print spoolers, interactive viewers,
Illustrator, etc.

If you were to embed the EPS file in question into another document,
the software might add a clipping path which matches the %%BoundingBox
comment, or it might not.

I don't know how ps.map handles patterns, but in general you shouldn't
rely upon clipping to the bounding box.

> > Only a question, the diagonal line width is sqrt(2), 
> 
> is it?

I don't think so.

> > a scale of 1/sqrt(2) = 0.71 make the width of the line
> > similar a any horizontal line of width of 1.
> 
> i.e. 0.71 PostScript points? I'm not sure that I follow.
> 
> In the wiki help page I had written "Color and width of patterns are set
> by [vareas] fcolor and width instructions until overwritten in the pattern
> file." Testing it now that doesn't seem to be the case but from memory it
> used to be. ??

I suggest changing the pattern to use filled areas rather than stroked
lines, e.g.:

%!PS-Adobe-2.0 EPSF-1.2
%%BoundingBox: 0 0 10 10
0 0 moveto
0 0.5 lineto
9.5 10 lineto
10 10 lineto
10 9.5 lineto
0.5 0 lineto
closepath
fill
9.5 0 moveto
10 0 lineto
10 0.5 lineto
closepath
fill
0 9.5 moveto
0 10 lineto
0.5 10 lineto
closepath
fill

This doesn't make any assumptions about the line width or clipping.

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-dev mailing list