]> git.donarmstrong.com Git - lilypond.git/blob - input/regression/markup-line-styles.ly
Enhancement: 2 new markup-cmds: draw-dashed-line; draw-dotted-line
[lilypond.git] / input / regression / markup-line-styles.ly
1 \version "2.17.10"
2
3 \header {
4   texidoc = "The markup-commands @code{\\draw-dashed-line} and
5   @code{\\draw-dotted-line} should print the same visual length as
6   @code{\\draw-line}."
7 }
8
9 test =
10 #(define-scheme-function (parser location x-nmbr y-nmbr)(number? number?)
11  (let* ((lst (map
12                (lambda (x)
13                  (let* ((x-lngth (if (positive? x-nmbr)
14                                      (* x 0.75)
15                                      (* x -0.75)))
16                         (dest (cons x-lngth y-nmbr))
17                         (x-strg (number->string x-lngth))
18                         (y-strg (number->string y-nmbr))
19                         (txt-1 (markup
20                                #:concat (
21                                    " \\draw-dotted-line #'("
22                                    x-strg
23                                    " . "
24                                    y-strg
25                                    ")")))
26                         (txt-2 (markup
27                                #:concat (
28                                    " \\draw-dashed-line #'("
29                                    x-strg
30                                    " . "
31                                    y-strg
32                                    ")")))
33                         (txt-3 (markup
34                                #:concat (
35                                    " \\draw-line #'("
36                                    x-strg
37                                    " . "
38                                    y-strg
39                                    ")"))))
40                     (markup
41                        #:override '(baseline-skip . 0)
42                        #:left-column
43                          (
44                          ;; dotted-line
45                          #:line
46                            ((#:draw-dotted-line dest)
47                              #:vcenter (#:fontsize -4 txt-1))
48                          ;; dashed-line
49                          #:line
50                            ((#:draw-dashed-line dest)
51                              #:vcenter (#:fontsize -4 txt-2))
52                          ;; default solid-line:
53                          #:line
54                            ((#:draw-line dest)
55                              #:vcenter (#:fontsize -4 txt-3))
56                          #:vspace 0.5))))
57                   (iota (abs x-nmbr)))))
58         lst))
59
60 \test #15 #0