diff options
author | Thomas Morley <thomasmorley65@gmail.com> | 2016-01-05 16:18:53 +0100 |
---|---|---|
committer | Thomas Morley <thomasmorley65@gmail.com> | 2016-01-19 23:15:43 +0100 |
commit | e426ea7b5af83739ab2f3a255e8cbac55b16e6ec (patch) | |
tree | 16ca4a429c34d9f98483221dc1fd11a930d8109e /input | |
parent | 57000058f2521712364faa03b344cc49b193ca75 (diff) |
Issue 4722 Introduce new markup-command draw-squiggle-line.
Change regtest /input/regression/markup-line-styles.ly accordingly
Diffstat (limited to 'input')
-rw-r--r-- | input/regression/markup-line-styles.ly | 75 |
1 files changed, 72 insertions, 3 deletions
diff --git a/input/regression/markup-line-styles.ly b/input/regression/markup-line-styles.ly index ac15fa78ad..aa718e4f5c 100644 --- a/input/regression/markup-line-styles.ly +++ b/input/regression/markup-line-styles.ly @@ -1,11 +1,13 @@ \version "2.19.22" \header { - texidoc = "The markup-commands @code{\\draw-dashed-line} and - @code{\\draw-dotted-line} should print the same visual length as - @code{\\draw-line}." + texidoc = "The markup-commands @code{\\draw-dashed-line}, + @code{\\draw-dotted-line} and @code{\\draw-squiggle-line} should print the + same visual length as @code{\\draw-line}. + Also testing possible overrides for @code{\\draw-squiggle-line}" } +%% draw-dotted-line and draw-dashed-line test = #(define-scheme-function (x-nmbr y-nmbr)(number? number?) (let* ((lst (map @@ -57,4 +59,71 @@ test = (iota (abs x-nmbr))))) lst)) +%% draw-squiggle-line +mrkp = +\markup + \override #'(word-space . 2) + \column { + \line { \draw-squiggle-line #0.5 #'(6 . 0) ##t \tiny \vcenter "default" } + \line { + \override #'(orientation . -1) \draw-squiggle-line #0.5 #'(6 . 0) ##t + \tiny \vcenter "different orientation" + } + \line { + \draw-squiggle-line #0.5 #'(6 . 0) ##f + \tiny \vcenter "\"eq-end?\" set #f" + } + \line { + \override #'(height . 1) \draw-squiggle-line #0.5 #'(6 . 0) ##t + \tiny \vcenter "different height" + } + \line { + \override #'(thickness . 5) \draw-squiggle-line #0.5 #'(6 . 0) ##t + \tiny \vcenter "different thickness" + } + \line { + \override #'(angularity . 2) \draw-squiggle-line #0.5 #'(6 . 0) ##t + \tiny \vcenter "different angularity" + } + } + +test-draw-squiggle-line = +#(define-scheme-function (steps) (integer?) +;; Puts out a markup combining draw-line-markup and draw-squiggle-line-markup +;; in a helix-like mannor + (define (val-pts-list steps) + ;; Puts out a list, with each element being a pair of a numerical value + ;; and a number-pair + ;; The numerical value is used for first-bow-length and its height + ;; The number-pair is the destination-point of the line. + ;; Those points are on a simple helix around '(0 . 0) + (map + (lambda (n r) + (let* ((y (* (sin n) r)) + (x (* (cos n) r))) + (if (< (abs x) 0.00001) + (set! x 0)) + (if (< (abs y) 0.00001) + (set! y 0)) + (cons (max 0.1 (- 0.5 (/ 1 r))) (cons x y )))) + (iota steps 0 (/ TWO-PI steps)) + (iota steps 3 0.5))) + + (let ((args + (map + (lambda (arg) + #{ + \markup + \combine + \draw-line $(cdr arg) + \override #`(height . , (car arg)) + \draw-squiggle-line + #(car arg) + $(cdr arg) ##f + #}) + (val-pts-list steps)))) + #{ \markup { \hspace #10 \overlay $args \hspace #5 \vcenter \mrkp } #})) + \test #15 #0 + +\test-draw-squiggle-line #12 #10 |