]> git.donarmstrong.com Git - lilypond.git/commitdiff
Remove traces of 'connected-shape.
authorPatrick McCarty <pnorcks@gmail.com>
Fri, 13 Aug 2010 19:17:18 +0000 (12:17 -0700)
committerPatrick McCarty <pnorcks@gmail.com>
Fri, 13 Aug 2010 22:03:08 +0000 (15:03 -0700)
Since 'path is a superset of the functionality provided by
'connected-shape, we no longer need 'connected-shape.

ps/music-drawing-routines.ps
scm/define-markup-commands.scm
scm/define-stencil-commands.scm
scm/define-woodwind-diagrams.scm
scm/output-ps.scm
scm/output-svg.scm
scm/stencil.scm

index 7ea8c0fb90a5e33fe1eda30984b06a9187f4f461..ccaf6b3dcc55195fcfe5fc0172f3300801108653 100644 (file)
@@ -232,24 +232,6 @@ bind def
   grestore
 } bind def
 
-/draw_connected_shape
-{
-  gsave
-  currentpoint translate
-  /filled exch def
-  /connect exch def
-  /savematrix matrix currentmatrix def
-  setlinewidth
-  scale
-  /arlen exch def
-  arlen {
-    /shlen exch def
-    shlen { } repeat shlen 2 eq { lineto } { curveto } ifelse
-  } repeat connect { closepath } if
-  savematrix setmatrix filled { stroke_and_fill } { stroke } ifelse
-  grestore
-} bind def
-
 /draw_line % dx dy x1 y1 thickness draw_line
 {
        setlinewidth % dx dy x1 y1
index 30e5a71e4a05b2486feb8bee8fd481752918a73f..e37ca634db0debe8d0331e89642f04ed426ab487 100644 (file)
@@ -726,13 +726,13 @@ samplePath =
                                ;; see `without-closepath'.
                                (else x)))
                            commands))
-        ;; connected-shape-min-max does not accept 0-arg lists,
+        ;; path-min-max does not accept 0-arg lists,
         ;; and since closepath does not affect extents, filter
         ;; out those commands here.
         (without-closepath (filter (lambda (x)
                                      (not (equal? 'closepath (car x))))
                                    new-commands))
-        (extents (connected-shape-min-max
+        (extents (path-min-max
                    ;; set the origin to the first moveto
                    (list (list-ref (car without-closepath) 0)
                          (list-ref (car without-closepath) 1))
index c1452128af49a92e27067064d42ef54c03589a25..07f3463828fc9552bc3b184c57d074ef6c42214e 100644 (file)
@@ -27,7 +27,6 @@ defined in the output modules (output-*.scm)"
     bracket
     char
     circle
-    connected-shape
     dashed-line
     dashed-slur
     dot
index 604395e4deabf1911dbc8d912b087918d97e9ec9..c74d63853e3e5b3d242a32d89cb61d5226bb584e 100644 (file)
   (reduce + 0 (map (lambda (x) (if x 1 0)) input-list)))
 
 (define (bezier-head-for-stencil bezier cut-point)
-  "Prepares a split-bezier to be used in a connected shape stencil."
+  "Prepares a split-bezier to be used in a connected path stencil."
   (list-tail (flatten-list (car (split-bezier bezier cut-point))) 2))
 
 ;; Translators for keys
 (define (gray-colorize stencil)
   (apply ly:stencil-in-color (cons stencil (x11-color 'grey))))
 
-; A connected shape stencil that is surrounded by proc
-(define (rich-mcs-stencil ls x-stretch y-stretch proc)
+; A connected path stencil that is surrounded by proc
+(define (rich-path-stencil ls x-stretch y-stretch proc)
   (lambda (radius thick fill layout props)
     (let*
       ((fill-translate (key-fill-translate fill))
      (ly:stencil-add
       ((if gray? gray-colorize identity)
       (proc
-        (make-connected-shape-stencil
+        (make-connected-path-stencil
         ls
         thick
         (* x-stretch radius)
         (if gray? #t fill-translate))))
       (if (not gray?)
           empty-stencil
-          ((rich-mcs-stencil ls x-stretch y-stretch proc)
+          ((rich-path-stencil ls x-stretch y-stretch proc)
            radius
            thick
            1
            layout
            props))))))
 
-; A connected shape stencil without a surrounding proc
-(define (standard-mcs-stencil ls x-stretch y-stretch)
-  (rich-mcs-stencil ls x-stretch y-stretch identity))
+; A connected path stencil without a surrounding proc
+(define (standard-path-stencil ls x-stretch y-stretch)
+  (rich-path-stencil ls x-stretch y-stretch identity))
 
 ; An ellipse stencil that is surrounded by a proc
 (define (rich-pe-stencil x-stretch y-stretch start end proc)
   (let*
    ((xmove (lambda (x) (+ tailw (+ 0.2 (* bodyw (- x 0.2))))))
     (ymove (lambda (x) (+ (- tailh) (+ -0.05 (* bodyh (+ x 0.05)))))))
-  (standard-mcs-stencil
+  (standard-path-stencil
     `((,(xmove 0.7)
        ,(ymove -0.2)
        ,(xmove 1.0)
 ;;; Flute family stencils
 
 (define flute-lh-b-key-stencil
-  (standard-mcs-stencil
+  (standard-path-stencil
     '((0 1.3)
       (0 1.625 -0.125 1.75 -0.25 1.75)
       (-0.55 1.75 -0.55 0.95 -0.25 0.7)
     1.55))
 
 (define flute-lh-bes-key-stencil
-  (standard-mcs-stencil
+  (standard-path-stencil
     '((0 1.3)
       (0 1.625 -0.125 1.75 -0.25 1.75)
       (-0.55 1.75 -0.55 0.95 -0.25 0.7)
     1.3))
 
 (define (flute-lh-gis-rh-bes-key-stencil deg)
-  (rich-mcs-stencil
+  (rich-path-stencil
     '((0.1 0.1 0.2 0.4 0.3 0.6)
       (0.3 1.0 0.8 1.0 0.8 0.7)
       (0.8 0.3 0.5 0.3 0 0))
 (define flute-rh-dis-key-stencil little-elliptical-key-stencil)
 
 (define flute-rh-ees-key-stencil
-  (standard-mcs-stencil
+  (standard-path-stencil
     '((0.8 0) (1.1 0 1.1 0.75 0.7 0.75) (0.5 0.75) (0.15 0.75 0.1 0.2 0 0))
     -2.38
     1.4))
 (define flute-lower-row-stretch 1.4)
 
 (define flute-rh-cis-key-stencil
-  (standard-mcs-stencil
+  (standard-path-stencil
     '((0 0.75) (-0.8 0.75 -0.8 0 0 0))
     flute-lower-row-stretch
     flute-lower-row-stretch))
 
 (define flute-rh-c-key-stencil
-  (standard-mcs-stencil
+  (standard-path-stencil
     '((0 0.75) (0.4 0.75) (0.4 0) (0 0))
     flute-lower-row-stretch
     flute-lower-row-stretch))
 
 (define flute-rh-b-key-stencil
-  (standard-mcs-stencil
+  (standard-path-stencil
     '((0 0.75) (0.25 0.75) (0.25 0) (0 0))
     flute-lower-row-stretch
     flute-lower-row-stretch))
 
 (define flute-rh-gz-key-stencil
-  (rich-mcs-stencil
+  (rich-path-stencil
       '((0.1 0.1 0.4 0.2 0.6 0.3)
         (1.0 0.3 1.0 0.8 0.7 0.8)
         (0.3 0.8 0.3 0.5 0 0))
            `((,x . 0.0) (,x . ,(- y)) (0.0 . ,(- y)) (0.0 . 0.0))
            0.2))))
     (if gis?
-      (standard-mcs-stencil
+      (standard-path-stencil
         (append
           (append
             `((0.25 ,(/ y -2) 0.75 ,(/ y -2) 1.0 0.0))
           `((0.75 ,(/ y -2) 0.25 ,(/ y -2) 0.0 0.0)))
         scaling-factor
         scaling-factor)
-      (standard-mcs-stencil
+      (standard-path-stencil
         (map (lambda (l)
                (flatten-list
                  (map (lambda (x)
 (define oboe-lh-low-b-key-stencil (oboe-lh-gis-lh-low-b-key-stencil #f))
 
 (define (oboe-lh-ees-lh-bes-key-stencil ees?)
-  (standard-mcs-stencil
+  (standard-path-stencil
     `((0 1.5)
       (0 1.625 -0.125 1.75 -0.25 1.75)
       (-0.5 1.75 -0.5 0.816 -0.25 0.5)
 
 (define (oboe-lh-octave-key-stencil long?)
   (let* ((h (if long? 1.4 1.2)))
-    (standard-mcs-stencil
+    (standard-path-stencil
     `((-0.4 0 -0.4 1.0 -0.1 1.0)
       (-0.1 ,h)
       (0.1 ,h)
 (define oboe-rh-f-key-stencil little-elliptical-key-stencil)
 
 (define (oboe-rh-c-rh-ees-key-stencil c?)
-  (rich-mcs-stencil
+  (rich-path-stencil
     '((1.0 0.0 1.0 0.70 1.5 0.70)
       (2.25 0.70 2.25 -0.4 1.5 -0.4)
       (1.0 -0.4 1.0 0 0 0)
 (define oboe-rh-c-key-stencil (oboe-rh-c-rh-ees-key-stencil #t))
 
 (define oboe-rh-cis-key-stencil
-  (rich-mcs-stencil
+  (rich-path-stencil
     '((0.6 0.0 0.6 0.50 1.25 0.50)
       (2.25 0.50 2.25 -0.4 1.25 -0.4)
       (0.6 -0.4 0.6 0 0 0))
     (height (*
       halfbase
       (/ (sin (/ (* 4 PI) 10)) (cos (/ (* 4 PI) 10))))))
-   (standard-mcs-stencil
+   (standard-path-stencil
       `(
         (0 ,(/ -4.0 3.0) -2.0 ,(/ -4.0 3.0) -2.0 0.0)
         (-1.5 ,(* 0.5 height) -1.25 ,(* 0.75 height) -1.0 ,height)
 (define clarinet-lh-d-key-stencil (standard-e-stencil 1.0 0.4))
 
 (define clarinet-rh-low-c-key-stencil
-  (standard-mcs-stencil
+  (standard-path-stencil
     '((0.0 1.5)
       (0.0 2.5 -1.0 2.5 -1.0 0.75)
       (-1.0 0.1 0.0 0.25 0.0 0.3)
     0.8))
 
 (define clarinet-rh-low-cis-key-stencil
-  (standard-mcs-stencil
+  (standard-path-stencil
     '((0.0 1.17)
       (0.0 1.67 -1.0 1.67 -1.0 0.92)
       (-1.0 0.47 0.0 0.52 0.0 0.62)
     0.8))
 
 (define clarinet-rh-low-d-key-stencil
-  (standard-mcs-stencil
+  (standard-path-stencil
     '((0.0 1.05)
       (0.0 1.55 -1.0 1.55 -1.0 0.8)
       (-1.0 0.35 0.0 0.4 0.0 0.5)
 ; changes, all change...
 
 (define clarinet-rh-fis-key-stencil
-  (standard-mcs-stencil
+  (standard-path-stencil
     `(,(bezier-head-for-stencil
         '((0.0 . 0.0) (0.0 . -1.0) (1.0 . -1.0) (1.0 . 0.0))
         0.5)
       CL-RH-V-STRETCH))
 
 (define clarinet-rh-e-key-stencil
-  (standard-mcs-stencil
+  (standard-path-stencil
     '((0.0 1.0 1.0 1.0 1.0 0.0) (1.0 -1.0 0.0 -1.0 0.0 0.0))
     CL-RH-H-STRETCH
     CL-RH-V-STRETCH))
 
 (define clarinet-rh-ees-key-stencil
-  (standard-mcs-stencil
+  (standard-path-stencil
     `(,(bezier-head-for-stencil
         '((0.0 .  0.0) (0.0 . -1.0) (1.0 . -1.0) (1.0 . 0.0))
         0.5)
 (define clarinet-rh-gis-key-stencil clarinet-rh-e-key-stencil)
 
 (define bass-clarinet-rh-f-key-stencil
-  (standard-mcs-stencil
+  (standard-path-stencil
     `(,(bezier-head-for-stencil
         '((0.0 . 0.0) (0.0 . -1.0) (1.0 . -1.0) (1.0 . 0.0))
         0.5)
 (define saxophone-lh-T-key-stencil (standard-e-stencil 0.75 0.75))
 
 (define saxophone-lh-gis-key-stencil
-  (standard-mcs-stencil
+  (standard-path-stencil
     '((0.0 0.4)
       (0.0 0.8 3.0 0.8 3.0 0.4)
       (3.0 0.0)
     0.8))
 
 (define (saxophone-lh-b-cis-key-stencil flip?)
-  (standard-mcs-stencil
+  (standard-path-stencil
     '((0.0 1.0)
       (0.4 1.0 0.8 0.9 1.35 0.8)
       (1.35 0.0)
 (define saxophone-lh-b-key-stencil (saxophone-lh-b-cis-key-stencil #f))
 
 (define saxophone-lh-low-bes-key-stencil
-  (standard-mcs-stencil
+  (standard-path-stencil
     '((3.0 0.0) (3.0 -1.5 0.0 -1.5 0.0 0.0))
     0.8
     0.8))
 
 (define (saxophone-rh-side-key-stencil width height)
-  (standard-mcs-stencil
+  (standard-path-stencil
     `((0.0 ,height)
     (0.05 ,(+ height 0.05) 0.1 ,(+ height 0.1) 0.15 ,(+ height 0.15))
     (,(- width 0.15) ,(+ height 0.15))
 (define saxophone-rh-bes-key-stencil (saxophone-rh-side-key-stencil 0.9 0.45))
 
 (define saxophone-rh-high-fis-key-stencil
-  (standard-mcs-stencil
+  (standard-path-stencil
     (append
       '((0.0 1.0) (0.0 1.4 0.6 1.4 0.6 1.0) (0.6 0.0))
       (map (lambda (l)
 (define saxophone-rh-ees-key-stencil (standard-e-stencil 1.2 0.5))
 
 (define saxophone-rh-low-c-key-stencil
-  (standard-mcs-stencil
+  (standard-path-stencil
     '((3.0 0.0) (3.0 -1.5 0.0 -1.5 0.0 0.0))
     0.8
     0.8))
    (second-bezier (cadr info-list))
    (slope-offset1 (caddr info-list))
    (slope-offset2 (cadddr info-list)))
-  (rich-mcs-stencil
+  (rich-path-stencil
     (append
       `((0.0 ,(+ height gap))
       ,(list-tail first-bezier 2))
   (rich-pe-stencil 1.0 1.0 135 315 identity))
 
 (define bassoon-lh-ld-key-stencil
-  (standard-mcs-stencil
+  (standard-path-stencil
     '((-0.8 4.0 1.4 4.0 0.6 0.0)
       (0.5 -0.5 0.5 -0.8 0.6 -1.0)
       (0.7 -1.2 0.8 -1.3 0.8 -1.8)
 
 (define bassoon-lh-d-flick-key-stencil
   (let ((height 3.0))
-    (standard-mcs-stencil
+    (standard-path-stencil
       `((0.0 ,height)
        (0.2 ,(+ height 1.6) 0.8 ,(+ height 1.8) 1.0 ,(+ height 1.8))
        (1.4 ,(+ height 1.8) 1.9 ,(+ height 1.3) 1.9 ,(+ height 1.0))
 
 (define bassoon-lh-c-flick-key-stencil
   (let ((height 3.0))
-    (standard-mcs-stencil
+    (standard-path-stencil
       `((0.0 ,height)
          (0.0 ,(+ height 1.6) 0.4 ,(+ height 1.8) 0.5 ,(+ height 1.8))
          (0.7 ,(+ height 1.8) 0.9 ,(+ height 1.3) 0.9 ,(+ height 1.0))
     (second-bezier (cadr info-list))
     (slope-offset1 (caddr info-list))
     (slope-offset2 (cadddr info-list)))
-  (standard-mcs-stencil
+  (standard-path-stencil
     (append
       (map
         (lambda (l)
   (bassoon-uber-key-stencil 1.0 1.2 0.9 1.0 0.7 0.7))
 
 (define bassoon-rh-thumb-gis-key-stencil
-  (bassoon-uber-key-stencil 1.2 0.8 0.9 0.4 0.7 0.7))
\ No newline at end of file
+  (bassoon-uber-key-stencil 1.2 0.8 0.9 0.4 0.7 0.7))
index 16f62012d9846a3ca7e5690c76b0004e7056c037..723a616369bd5f7a4b37243c30dc4506a9f05e2e 100644 (file)
          (- x2 x1) (- y2 y1)
          x1 y1 thick))
 
-(define (connected-shape pointlist thick x-scale y-scale connect fill)
-  (ly:format "~a~4f ~4f ~4f ~4f ~a ~a draw_connected_shape"
-    (string-concatenate
-      (map (lambda (x)
-             (apply (if (eq? (length x) 6)
-                        (lambda (x1 x2 x3 x4 x5 x6)
-                          (ly:format "~4f ~4f ~4f ~4f ~4f ~4f 6 "
-                                     x1
-                                     x2
-                                     x3
-                                     x4
-                                     x5
-                                     x6))
-                        (lambda (x1 x2)
-                           (ly:format "~4f ~4f 2 " x1 x2)))
-                    x))
-           (reverse pointlist)))
-      (length pointlist)
-      x-scale
-      y-scale
-      thick
-      (if connect "true" "false")
-      (if fill "true" "false")))
-
 (define (partial-ellipse x-radius y-radius start-angle end-angle thick connect fill)
   (ly:format "~a ~a ~4f ~4f ~4f ~4f ~4f draw_partial_ellipse"
         (if fill "true" "false")
index 8d4248fb4333fed586fd12d3153502895b3f1ccb..238819552866dd420a54b5c0d1876444e87b2d8b 100644 (file)
                            (- (* start-radius (sin new-start-angle))))
                 "")))))))
 
-(define (connected-shape pointlist thick x-scale y-scale connect fill)
-  (entity
-    'path ""
-    `(fill . ,(if fill "currentColor" "none"))
-    `(stroke . "currentColor")
-    `(stroke-width . ,thick)
-    '(stroke-linejoin . "round")
-    '(stroke-linecap . "round")
-    (cons
-      'd
-      (ly:format
-        "M0 0~a ~a"
-        (string-concatenate
-          (map (lambda (x)
-                 (apply
-                   (if (eq? (length x) 6)
-                       (lambda (x1 x2 x3 x4 x5 x6)
-                         (ly:format "C~4f ~4f ~4f ~4f ~4f ~4f"
-                                    (* x1 x-scale)
-                                    (- (* x2 y-scale))
-                                    (* x3 x-scale)
-                                    (- (* x4 y-scale))
-                                    (* x5 x-scale)
-                                    (- (* x6 y-scale))))
-                       (lambda (x1 x2)
-                         (ly:format "L~4f ~4f"
-                                    (* x-scale x1)
-                                    (- (* y-scale x2)))))
-                   x))
-               pointlist))
-        (if connect "z " "")))))
-
 (define (embedded-svg string)
   string)
 
index 7f4cbaa657d1be647200a8b2ab6a21a9268352e7..4a0a26bd6cd342186fc6150e679d5e69bc541071 100644 (file)
@@ -291,7 +291,7 @@ the more angular the shape of the parenthesis."
       (cons (min-max-crawler min cddr possible-extrema)
             (min-max-crawler max cddr possible-extrema)))))
 
-(define (connected-shape-min-max origin pointlist)
+(define (path-min-max origin pointlist)
 
   (define (line-part-min-max x1 x2)
     (list (min x1 x2) (max x1 x2)))
@@ -356,17 +356,17 @@ the more angular the shape of the parenthesis."
              (append (list origin)
                      (reverse (cdr (reverse pointlist)))) pointlist))))
 
-(define-public (make-connected-shape-stencil pointlist thickness
-                                             x-scale y-scale connect fill)
-  "Make a connected shape described by the list @var{pointlist}, with
+(define-public (make-connected-path-stencil pointlist thickness
+                                           x-scale y-scale connect fill)
+  "Make a connected path described by the list @var{pointlist}, with
 thickness @var{thickness}, and scaled by @var{x-scale} in the X direction
 and @var{y-scale} in the Y direction.  @var{connect} and @var{fill} are
-boolean arguments that specify if the shape should be connected or filled,
+boolean arguments that specify if the path should be connected or filled,
 respectively."
 
-  ;; a connected shape path must begin at point '(0 . 0)
+  ;; paths using this routine are designed to begin at point '(0 . 0)
   (let* ((origin (list 0 0))
-        (boundlist (connected-shape-min-max origin pointlist))
+        (boundlist (path-min-max origin pointlist))
         ;; modify pointlist to scale the coordinates
         (path (map (lambda (x)
                      (apply
@@ -387,7 +387,7 @@ respectively."
                    pointlist))
         ;; a path must begin with a `moveto'
         (prepend-origin (apply list (cons 'moveto origin) path))
-        ;; if this shape is connected, add closepath to the end
+        ;; if this path is connected, add closepath to the end
         (final-path (if connect
                         (append prepend-origin (list 'closepath))
                         prepend-origin))