]> git.donarmstrong.com Git - lilypond.git/commitdiff
SVG backend: clean up indentation.
authorPatrick McCarty <pnorcks@gmail.com>
Mon, 10 Aug 2009 02:31:46 +0000 (19:31 -0700)
committerPatrick McCarty <pnorcks@gmail.com>
Mon, 10 Aug 2009 02:45:07 +0000 (19:45 -0700)
scm/framework-svg.scm
scm/output-svg.scm

index 22cd6160e1d4211546f490291523e65e7a666779..1868057b25fcf4cf6309fceb6051ba834098da2c 100644 (file)
@@ -56,8 +56,7 @@
     (dump (apply eo 'svg (svg-header paper unit-length)))
     (dump (comment (format "Page: ~S/~S" page-number page-count)))
     (ly:outputter-output-scheme outputter
-                               `(begin (set! lily-unit-length
-                                             ,unit-length)
+                               `(begin (set! lily-unit-length ,unit-length)
                                        ""))
     (ly:outputter-dump-stencil outputter page)
     (dump (ec 'svg))
index 8a52ed6a3d25a016bd788b592286a1abdb05fb0c..0d5dda4e95e19d43cf118f8225b99b40ced64459 100644 (file)
 
 (define (dispatch expr)
   (let ((keyword (car expr)))
-    (cond
-     ((eq? keyword 'some-func) "")
-     (else
-      (if (module-defined? this-module keyword)
-         (apply (eval keyword this-module) (cdr expr))
-         (begin
-           (ly:warning (_ "undefined: ~S") keyword)
-           ""))))))
+    (cond ((eq? keyword 'some-func) "")
+         (else (if (module-defined? this-module keyword)
+                   (apply (eval keyword this-module) (cdr expr))
+                   (begin (ly:warning (_ "undefined: ~S") keyword)
+                          ""))))))
 
 ;; Helper functions
 (define-public (attributes attributes-alist)
   (define alist '())
   (define (set-attribute attr val)
     (set! alist (assoc-set! alist attr val)))
-  (let*
-    ((match-1 (regexp-exec pango-description-regexp-comma str))
-     (match-2 (regexp-exec pango-description-regexp-nocomma str))
-     (match (if match-1
-               match-1
-               match-2)))
+  (let* ((match-1 (regexp-exec pango-description-regexp-comma str))
+        (match-2 (regexp-exec pango-description-regexp-nocomma str))
+        (match (if match-1 match-1 match-2)))
 
     (if (regexp-match? match)
        (begin
 
 (define (circle radius thick is-filled)
   (entity
-   'circle ""
-   '(stroke-linejoin . "round")
-   '(stroke-linecap . "round")
-   `(fill . ,(if is-filled "currentColor" "none"))
-   `(stroke . "currentColor")
-   `(stroke-width . ,thick)
-   `(r . ,radius)))
+    'circle ""
+    '(stroke-linejoin . "round")
+    '(stroke-linecap . "round")
+    `(fill . ,(if is-filled "currentColor" "none"))
+    `(stroke . "currentColor")
+    `(stroke-width . ,thick)
+    `(r . ,radius)))
 
 (define (dashed-line thick on off dx dy phase)
   (draw-line thick 0 0 dx dy
 (define (draw-line thick x1 y1 x2 y2 . alist)
   (apply entity 'line ""
         (append
-         `((stroke-linejoin . "round")
-           (stroke-linecap . "round")
-           (stroke-width . ,thick)
-           (stroke . "currentColor")
-           (x1 . ,x1)
-           (y1 . ,(- y1))
-           (x2 . ,x2)
-           (y2 . ,(- y2)))
-         alist)))
+          `((stroke-linejoin . "round")
+            (stroke-linecap . "round")
+            (stroke-width . ,thick)
+            (stroke . "currentColor")
+            (x1 . ,x1)
+            (y1 . ,(- y1))
+            (x2 . ,x2)
+            (y2 . ,(- y2)))
+          alist)))
 
 (define (ellipse x-radius y-radius thick is-filled)
   (entity
-   'ellipse ""
-   '(stroke-linejoin . "round")
-   '(stroke-linecap . "round")
-   `(fill . ,(if is-filled "currentColor" "none"))
-   `(stroke . "currentColor")
-   `(stroke-width . ,thick)
-   `(rx . ,x-radius)
-   `(ry . ,y-radius)))
+    'ellipse ""
+    '(stroke-linejoin . "round")
+    '(stroke-linecap . "round")
+    `(fill . ,(if is-filled "currentColor" "none"))
+    `(stroke . "currentColor")
+    `(stroke-width . ,thick)
+    `(rx . ,x-radius)
+    `(ry . ,y-radius)))
 
 (define (embedded-svg string)
   string)
 
 (define (oval x-radius y-radius thick is-filled)
   (let ((x-max x-radius)
-        (x-min (- x-radius))
-        (y-max y-radius)
-        (y-min (- y-radius)))
+       (x-min (- x-radius))
+       (y-max y-radius)
+       (y-min (- y-radius)))
     (entity
-     'path ""
-     '(stroke-linejoin . "round")
-     '(stroke-linecap . "round")
-     `(fill . ,(if is-filled "currentColor" "none"))
-     `(stroke . "currentColor")
-     `(stroke-width . ,thick)
-     `(d . ,(ly:format "M~4f ~4fC~4f ~4f ~4f ~4f ~4f ~4fS~4f ~4f ~4f ~4fz"
-               x-max 0
-               x-max y-max
-               x-min y-max
-               x-min 0
-               x-max y-min
-               x-max 0)))))
+      'path ""
+      '(stroke-linejoin . "round")
+      '(stroke-linecap . "round")
+      `(fill . ,(if is-filled "currentColor" "none"))
+      `(stroke . "currentColor")
+      `(stroke-width . ,thick)
+      `(d . ,(ly:format "M~4f ~4fC~4f ~4f ~4f ~4f ~4f ~4fS~4f ~4f ~4f ~4fz"
+                       x-max 0
+                       x-max y-max
+                       x-min y-max
+                       x-min 0
+                       x-max y-min
+                       x-max 0)))))
 
 (define (path thick commands)
   (define (convert-path-exps exps)
                                  (closepath . z))
                                "")))
 
-         (cons (format "~a~a"
-                       svg-head (number-list->point args))
+         (cons (format "~a~a" svg-head (number-list->point args))
                (convert-path-exps (drop rest arity))))
        '()))
 
 
 (define (polygon coords blot-diameter is-filled)
   (entity
-   'polygon ""
-   '(stroke-linejoin . "round")
-   '(stroke-linecap . "round")
-   `(stroke-width . ,blot-diameter)
-   `(fill . ,(if is-filled "currentColor" "none"))
-   '(stroke . "currentColor")
-   `(points . ,(string-join
-               (map offset->point (ly:list->offsets '() coords))))))
+    'polygon ""
+    '(stroke-linejoin . "round")
+    '(stroke-linecap . "round")
+    `(stroke-width . ,blot-diameter)
+    `(fill . ,(if is-filled "currentColor" "none"))
+    '(stroke . "currentColor")
+    `(points . ,(string-join
+                 (map offset->point (ly:list->offsets '() coords))))))
 
 (define (repeat-slash width slope thickness)
   (define (euclidean-length x y)
   "</g>\n")
 
 (define (round-filled-box breapth width depth height blot-diameter)
-  (entity 'rect ""
-         ;; The stroke will stick out.  To use stroke,
-         ;; the stroke-width must be subtracted from all other dimensions.
-         ;;'(stroke-linejoin . "round")
-         ;;'(stroke-linecap . "round")
-         ;;`(stroke-width . ,blot)
-         ;;'(stroke . "red")
-         ;;'(fill . "orange")
-
-         `(x . ,(- breapth))
-         `(y . ,(- height))
-         `(width . ,(+ breapth width))
-         `(height . ,(+ depth height))
-         `(ry . ,(/ blot-diameter 2))
-         '(fill . "currentColor")))
+  (entity
+    'rect ""
+    ;; The stroke will stick out.  To use stroke,
+    ;; the stroke-width must be subtracted from all other dimensions.
+    ;;'(stroke-linejoin . "round")
+    ;;'(stroke-linecap . "round")
+    ;;`(stroke-width . ,blot)
+    ;;'(stroke . "red")
+    ;;'(fill . "orange")
+
+    `(x . ,(- breapth))
+    `(y . ,(- height))
+    `(width . ,(+ breapth width))
+    `(height . ,(+ depth height))
+    `(ry . ,(/ blot-diameter 2))
+    '(fill . "currentColor")))
 
 (define (setcolor r g b)
   (format "<g color=\"rgb(~a%, ~a%, ~a%)\">\n"