From: Patrick McCarty Date: Fri, 13 Aug 2010 19:17:18 +0000 (-0700) Subject: Remove traces of 'connected-shape. X-Git-Tag: release/2.13.31-1~73 X-Git-Url: https://git.donarmstrong.com/?p=lilypond.git;a=commitdiff_plain;h=8a104f4a3f020c9fcd6ebbb1c9c4cf88f1020371 Remove traces of 'connected-shape. Since 'path is a superset of the functionality provided by 'connected-shape, we no longer need 'connected-shape. --- diff --git a/ps/music-drawing-routines.ps b/ps/music-drawing-routines.ps index 7ea8c0fb90..ccaf6b3dcc 100644 --- a/ps/music-drawing-routines.ps +++ b/ps/music-drawing-routines.ps @@ -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 diff --git a/scm/define-markup-commands.scm b/scm/define-markup-commands.scm index 30e5a71e4a..e37ca634db 100644 --- a/scm/define-markup-commands.scm +++ b/scm/define-markup-commands.scm @@ -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)) diff --git a/scm/define-stencil-commands.scm b/scm/define-stencil-commands.scm index c1452128af..07f3463828 100644 --- a/scm/define-stencil-commands.scm +++ b/scm/define-stencil-commands.scm @@ -27,7 +27,6 @@ defined in the output modules (output-*.scm)" bracket char circle - connected-shape dashed-line dashed-slur dot diff --git a/scm/define-woodwind-diagrams.scm b/scm/define-woodwind-diagrams.scm index 604395e4de..c74d63853e 100644 --- a/scm/define-woodwind-diagrams.scm +++ b/scm/define-woodwind-diagrams.scm @@ -101,7 +101,7 @@ (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 @@ -134,8 +134,8 @@ (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)) @@ -143,7 +143,7 @@ (ly:stencil-add ((if gray? gray-colorize identity) (proc - (make-connected-shape-stencil + (make-connected-path-stencil ls thick (* x-stretch radius) @@ -152,16 +152,16 @@ (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) @@ -416,7 +416,7 @@ (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) @@ -558,7 +558,7 @@ ;;; 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) @@ -567,7 +567,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) @@ -576,7 +576,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)) @@ -593,7 +593,7 @@ (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)) @@ -614,25 +614,25 @@ (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)) @@ -658,7 +658,7 @@ `((,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)) @@ -674,7 +674,7 @@ `((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) @@ -691,7 +691,7 @@ (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) @@ -708,7 +708,7 @@ (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) @@ -740,7 +740,7 @@ (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) @@ -754,7 +754,7 @@ (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)) @@ -774,7 +774,7 @@ (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) @@ -805,7 +805,7 @@ (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) @@ -814,7 +814,7 @@ 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) @@ -823,7 +823,7 @@ 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) @@ -852,7 +852,7 @@ ; 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) @@ -864,13 +864,13 @@ 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) @@ -889,7 +889,7 @@ (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) @@ -919,7 +919,7 @@ (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) @@ -928,7 +928,7 @@ 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) @@ -941,13 +941,13 @@ (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)) @@ -971,7 +971,7 @@ (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) @@ -990,7 +990,7 @@ (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)) @@ -1080,7 +1080,7 @@ (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)) @@ -1129,7 +1129,7 @@ (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) @@ -1141,7 +1141,7 @@ (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)) @@ -1154,7 +1154,7 @@ (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)) @@ -1196,7 +1196,7 @@ (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) @@ -1227,4 +1227,4 @@ (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)) diff --git a/scm/output-ps.scm b/scm/output-ps.scm index 16f62012d9..723a616369 100644 --- a/scm/output-ps.scm +++ b/scm/output-ps.scm @@ -103,30 +103,6 @@ (- 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") diff --git a/scm/output-svg.scm b/scm/output-svg.scm index 8d4248fb43..2388195528 100644 --- a/scm/output-svg.scm +++ b/scm/output-svg.scm @@ -431,38 +431,6 @@ (- (* 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) diff --git a/scm/stencil.scm b/scm/stencil.scm index 7f4cbaa657..4a0a26bd6c 100644 --- a/scm/stencil.scm +++ b/scm/stencil.scm @@ -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))