bug-lilypond
[Top][All Lists]
Advanced

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

Re: PostScript circle printed with unwanted line


From: pls
Subject: Re: PostScript circle printed with unwanted line
Date: Tue, 5 May 2015 15:59:46 +0200

Hi Arnold,
On 05.05.2015, at 14:42, ArnoldTheresius <address@hidden> wrote:

> pls wrote
>> ...
>> This line doesn’t show when I use Ghostscript 9.14 to interpret the
>> following file (I obviously had to change some values because PostScript
>> normally uses units of "points" for placing graphics on the page (in LP
>> the unit seems to be millimeters) and because the zero coordinates in
>> PostScript are in the bottom left corner of the page):
>> 
>> %!PS
>> 
>> /doACircle
>>  { 0 0 54 0 360 arc stroke } def
>> 
>> %  doACircle
>> 
>>  300 425 translate doACircle
>> 
>> showpage
>> 
>> 
>> So I would think this is a bug.
>> 
>> hth
>> patrick
>> _______________________________________________
>> bug-lilypond mailing list
> 
>> bug-lilypond@
> 
>> https://lists.gnu.org/mailman/listinfo/bug-lilypond
>> 
>> 
>> postscript-circle.pdf (17K)
>> &lt;http://lilypond.1069038.n5.nabble.com/attachment/175881/0/postscript-circle.pdf&gt;
> 
> But, if there is any other graphic command (with a moveto) before your
> doACircle, you will find this line in Ghostscript, too:
> %!PS
> 
> 200 500 moveto
> /Helvetica findfont 10 scalefont setfont
> (doACircle examples) show
> 
> /doACircle 
>  { 0 0 54 0 360 arc stroke } def 
> 
>  300 425 translate doACircle 
> 
>  150 0 translate 0 0 moveto doACircle
> 
> showpage 

True!  But why is the result correct in Ghostscript (but not in LilyPond) when 
I compile the following example?  It doesn’t even contain a moveto command:

%!PS

/doACircle
  { 0 0 54 0 360 arc stroke } def

/doAnEllipse
  { 1 .75 scale
    doACircle
    stroke } def

300 500 translate doACircle

4 { 0 -72 translate
    doAnEllipse } repeat

showpage


And isn’t it strange that these additional lines _only_ appear when circles are 
drawn.  E.g. rectangles are fine in LilyPond as well as directly in Ghostscript:

\version "2.19.15"
\markup {"PostScript square scaled"}
ps-rectangle = #"
  /square
    { newpath
      0 0 moveto
      25 0 lineto
      25 -25 lineto
      0 -25 lineto
      closepath stroke } def

      35 -50 translate
      1.5 1 scale 
      square
"

psrectangle = \markup {
    \postscript #ps-rectangle
}

\markup { 
  \psrectangle
}

\markup {"PostScript square rotated scaled"}
ps-rectangle = #"
  /square
    { newpath
      0 0 moveto
      25 0 lineto
      25 -25 lineto
      0 -25 lineto
      closepath stroke } def
     
      45 -50 translate
      -60 rotate
      1.5 .5 scale 
      square
"

psrectangle = \markup {
    \postscript #ps-rectangle
}

\markup { 
  \psrectangle
}


> 
> So, I think, it would be an enhancement request to invalidate the 'current
> point' whenever
> a \postscript markup starts - but I do not have the postscript command in
> mind which
> will do this.
> 
> Instead you may try this postscript procedure definition:
> /drawACircle % x_origin y_origin radius
>  { 3 copy pop moveto
>    dup 0 rmoveto
>    0 360 arc stroke
>  } def

Thanks for this hint. I need to have a closer look at it.

patrick



reply via email to

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