4 texidoc = "The markup-commands @code{\\draw-dashed-line},
5 @code{\\draw-dotted-line} and @code{\\draw-squiggle-line} should print the
6 same visual length as @code{\\draw-line}.
7 Also testing possible overrides for @code{\\draw-squiggle-line}"
10 %% draw-dotted-line and draw-dashed-line
12 #(define-scheme-function (x-nmbr y-nmbr)(number? number?)
15 (let* ((x-lngth (if (positive? x-nmbr)
18 (dest (cons x-lngth y-nmbr))
19 (x-strg (number->string x-lngth))
20 (y-strg (number->string y-nmbr))
23 " \\draw-dotted-line #'("
30 " \\draw-dashed-line #'("
43 #:override '(baseline-skip . 0)
48 ((#:draw-dotted-line dest)
49 #:vcenter (#:fontsize -4 txt-1))
52 ((#:draw-dashed-line dest)
53 #:vcenter (#:fontsize -4 txt-2))
54 ;; default solid-line:
57 #:vcenter (#:fontsize -4 txt-3))
59 (iota (abs x-nmbr)))))
65 \override #'(word-space . 2)
67 \line { \draw-squiggle-line #0.5 #'(6 . 0) ##t \tiny \vcenter "default" }
69 \override #'(orientation . -1) \draw-squiggle-line #0.5 #'(6 . 0) ##t
70 \tiny \vcenter "different orientation"
73 \draw-squiggle-line #0.5 #'(6 . 0) ##f
74 \tiny \vcenter "\"eq-end?\" set #f"
77 \override #'(height . 1) \draw-squiggle-line #0.5 #'(6 . 0) ##t
78 \tiny \vcenter "different height"
81 \override #'(thickness . 5) \draw-squiggle-line #0.5 #'(6 . 0) ##t
82 \tiny \vcenter "different thickness"
85 \override #'(angularity . 2) \draw-squiggle-line #0.5 #'(6 . 0) ##t
86 \tiny \vcenter "different angularity"
90 test-draw-squiggle-line =
91 #(define-scheme-function (steps) (integer?)
92 ;; Puts out a markup combining draw-line-markup and draw-squiggle-line-markup
93 ;; in a helix-like mannor
94 (define (val-pts-list steps)
95 ;; Puts out a list, with each element being a pair of a numerical value
97 ;; The numerical value is used for first-bow-length and its height
98 ;; The number-pair is the destination-point of the line.
99 ;; Those points are on a simple helix around '(0 . 0)
102 (let* ((y (* (sin n) r))
104 (if (< (abs x) 0.00001)
106 (if (< (abs y) 0.00001)
108 (cons (max 0.1 (- 0.5 (/ 1 r))) (cons x y ))))
109 (iota steps 0 (/ TWO-PI steps))
118 \draw-line $(cdr arg)
119 \override #`(height . , (car arg))
124 (val-pts-list steps))))
125 #{ \markup { \hspace #10 \overlay $args \hspace #5 \vcenter \mrkp } #}))
129 \test-draw-squiggle-line #12 #10