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" ""))))





--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/stencils-with-stroke-thickness-set-to-zero-tp160283.html
Sent from the Bugs mailing list archive at Nabble.com.

_______________________________________________
bug-lilypond mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-lilypond

Reply via email to