bug-lilypond
[Top][All Lists]
Advanced

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

Re: stencils with stroke-thickness set to zero


From: Ralph Palmer
Subject: Re: stencils with stroke-thickness set to zero
Date: Tue, 11 Mar 2014 09:31:07 -0400

On Mon, Mar 10, 2014 at 8:11 AM, lpietsch <address@hidden> wrote:

> There seems to be an inconsistency between the PS and the SVG backends in
> the
> treatment of path stencils. In PS, it seems to be impossible to create a
> filled shape with no visible contour line, whereas in SVG this is possible.
> If you create a stencil with the thickness parameter set to zero (via
> "make-path-stencil" or via "(ly:make-stencil ('path ..."), the SVG backend
> will do just that: no visible contour stroke, just a filled shape. The PS
> backend will add a visible hairline around the stencil, giving it at least
> one pixel in extra width. This may result in quite a visible difference
> between the two results, at least in screen display and with small or thin
> shapes.
>
> Test snippet:
>
> #(define teststencil (make-path-stencil
>     '(moveto 0  0 lineto 0 1 lineto 0.05 1 lineto 0.05 0 closepath)
>      0 1 1 #t))
> \markup { \stencil #teststencil }
>
> This will result in a markedly thicker line on screen in the PS output than
> in the SVG output.
>
> To bring the PS behaviour in line with the SVG behaviour (which I find more
> intuitive and more logical), change the path function in scm/output-ps.scm
> so as to omit the "stroke" command if the "fill" parameter is #t and the
> "thickness" parameter is zero. Change l.286-294 from:
>
>      (ly:format
>       "gsave currentpoint translate
> ~a setlinecap ~a setlinejoin ~a setlinewidth
> ~l gsave stroke grestore ~a grestore"
>       cap-numeric
>       join-numeric
>       thickness
>       (convert-path-exps exps)
>       (if fill? "fill" ""))))
>
> to:
>
>      (ly:format
>       "gsave currentpoint translate
> ~a setlinecap ~a setlinejoin ~a setlinewidth
> ~l ~a ~a grestore"
>       cap-numeric
>       join-numeric
>       thickness
>       (convert-path-exps exps)
>       (if (or (not fill?)(> thickness 0)) "gsave stroke grestore" "")
>       (if fill? "fill" ""))))
>

Greetings, Lukas - This has been submitted as Issue 3882 :
https://code.google.com/p/lilypond/issues/detail?id=3882

Ralph


reply via email to

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