lilypond-devel
[Top][All Lists]
Advanced

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

Re: Patch for issue 3882: stencils with stroke-thickness set to zero (is


From: luk . pietsch
Subject: Re: Patch for issue 3882: stencils with stroke-thickness set to zero (issue 201520044 by address@hidden)
Date: Wed, 25 Feb 2015 23:04:13 +0000

Reviewers: dak,

Message:
On 2015/02/25 20:25:25, dak wrote:
That sounds like unnecessary effort in some cases.  How about
           (cond ((not fill?) "stroke")
                 ((positive? thickness) "gsave stroke grestore fill")
                 (else "fill")))

You're right, that's more elegant.

Zero thickness without fill seems a bit awkward.  It's the odd man out
after
this change.

No-fill contours with thickness set to zero seem to be a well-defined
construct in Postscript; apparently they are supposed to be rendered as
a one-pixel hairline, so I guess we might want to continue supporting
that as an option.


Description:
Patch for issue 3882: stencils with stroke-thickness set to zero

Bring PS output in line with SVG output, so that it becomes possible
to define path stencil expressions with a filled contour but no
outline stroke. (This is necessary for consistent support of
user-defined glyphs defined as path stencils, to be used for
planned mensural notation extensions)

Please review this at https://codereview.appspot.com/201520044/

Affected files (+12, -8 lines):
  M scm/output-ps.scm


Index: scm/output-ps.scm
diff --git a/scm/output-ps.scm b/scm/output-ps.scm
index c4c0a4da07bb93d1547927c3a2be119a407031c6..bb4ee254603a2babfbf2f8b0c8b70ddf11cf39f6 100644
--- a/scm/output-ps.scm
+++ b/scm/output-ps.scm
@@ -295,15 +295,19 @@
(ly:warning (_ "unknown line-join-style: ~S")
                                                 (symbol->string join))
                                     1)))))
-    (ly:format
-     "gsave currentpoint translate
+     (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" ""))))
+~l ~a ~a grestore"
+      cap-numeric
+      join-numeric
+      thickness
+      (convert-path-exps exps)
+      ;; print outline contour only if there is no fill or if
+      ;; contour is explicitly requested with a thickness > 0
+      (if (or (not fill?)(> thickness 0)) "gsave stroke grestore" "")
+      (if fill? "fill" ""))))
+

 (define (setscale x y)
   (ly:format "gsave ~4l scale\n"





reply via email to

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