]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/output-svg.scm
Support configurable join and cap styles for 'path.
[lilypond.git] / scm / output-svg.scm
index 3a82c6f81507750df8fe9a639919acf19bcd2062..40aafb420f18d0348eada77f15a0a2b8e10781b0 100644 (file)
@@ -29,6 +29,7 @@
   (guile)
   (ice-9 regex)
   (ice-9 format)
+  (ice-9 optargs)
   (lily)
   (srfi srfi-1)
   (srfi srfi-13))
                        x-max y-min
                        x-max 0)))))
 
-(define (path thick commands)
+(define* (path thick commands #:optional (cap 'round) (join 'round) (fill? #f))
   (define (convert-path-exps exps)
     (if (pair? exps)
        (let*
 
   (entity 'path ""
          `(stroke-width . ,thick)
-         '(stroke-linejoin . "round")
-         '(stroke-linecap . "round")
+         `(stroke-linejoin . ,(symbol->string join))
+         `(stroke-linecap . ,(symbol->string cap))
          '(stroke . "currentColor")
-         '(fill . "none")
+         `(fill . ,(if fill? "currentColor" "none"))
          `(d . ,(apply string-append (convert-path-exps commands)))))
 
 (define (placebox x y expr)