whiteout: override stencil, not markup-command
[opus_libre.git] / bin / text.scm
blobca7b1ae16ec3bf7b3d3f4939440bf2f86b26d028
1 ;------------------------------------------------------------------;
2 ; opus_libre -- text.scm                                           ;
3 ;                                                                  ;
4 ; (c) 2008-2010 Valentin Villenave <valentin@villenave.net>        ;
5 ;                                                                  ;
6 ;     opus_libre is a free framework for GNU LilyPond: you may     ;
7 ; redistribute it and/or modify it under the terms of the GNU      ;
8 ; General Public License, version 3 or later: gnu.org/licenses     ;
9 ;                                                                  ;
10 ;------------------------------------------------------------------;
12 ;; Macros for entering text elements.
14 (load "../lib/libtext.scm")
16 ;; Composite dynamics ---------------------------------------------;
17 (define dyn
18   ;;syntax: -\dyn instead of \dyn (see Issue #1264).
19   (define-music-function (parser location arg) (markup?)
20     (make-music 'AbsoluteDynamicEvent
21                 'text (cond
22                        ((string? arg)
23                         (if (string-every char-set:dynamics arg)
24                             arg
25                             (markup #:dynamic-string arg)))
26                        (else arg)))))
28 (define startText
29   (define-music-function (location parser txt) (markup?)
30      (make-text-span txt)))
32 ;; for consistency only.
33 (define stopText
34   stopTextSpan)
36 (define ten
37   (define-music-function (parser location music) (ly:music?)
38     (if
39      (equal? (ly:music-property music 'name) 'EventChord)
40      (set! (ly:music-property music 'elements)
41            (append (ly:music-property music 'elements)
42                    (list (make-music 'TextScriptEvent 'text
43                                      ;; ugh. Haphazard alignment.
44                                      (markup #:translate-scaled (cons 4 0)
45                                              #:indic "(ten.)"))))))
46     music))