summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Pietsch <lukas.pietsch@freenet.de>2015-03-08 10:34:32 +0000
committerJames Lowe <pkx166h@gmail.com>2015-03-08 10:39:06 +0000
commitb7fdbfc2ceb805cfca5b386b43e1dec831702b17 (patch)
treefd82cb4649481191b582b8a5dd291e27bf59ff1e
parentc11939121bddf230fb48dc951c0bd01e7e55cbe0 (diff)
Add support for stencils with stroke-thickness set to zero
Issue 3882 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.
-rw-r--r--scm/output-ps.scm21
1 files changed, 13 insertions, 8 deletions
diff --git a/scm/output-ps.scm b/scm/output-ps.scm
index c4c0a4da07..70b13848e4 100644
--- a/scm/output-ps.scm
+++ b/scm/output-ps.scm
@@ -295,15 +295,20 @@
(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 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
+ (cond ((not fill?) "stroke")
+ ((positive? thickness) "gsave stroke grestore fill")
+ (else "fill")))))
+
(define (setscale x y)
(ly:format "gsave ~4l scale\n"