]> git.donarmstrong.com Git - lilypond.git/blob - input/regression/apply-output.ly
Add a hack to packed spacing to work around extra columns.
[lilypond.git] / input / regression / apply-output.ly
1 \version "2.11.51"
2
3 \header {
4   texidoc = "The @code{\applyOutput} expression is the most flexible way to
5 tune properties for individual grobs.
6
7 Here, the layout of a note head is changed depending on its vertical
8 position.
9 "
10 }
11
12 \layout {
13   ragged-right = ##t
14 }
15
16 #(define (mc-squared gr org cur)
17   (let*
18    (
19      (ifs (ly:grob-interfaces gr))
20      (sp (ly:grob-property gr 'staff-position))
21    )
22    (if (memq 'note-head-interface ifs)
23     (begin
24      (ly:grob-set-property! gr 'stencil ly:text-interface::print)
25      (ly:grob-set-property! gr 'font-family 'roman)
26      (ly:grob-set-property! gr 'text
27       (make-raise-markup -0.5
28        (case sp
29         ((-5) (make-simple-markup "m"))
30         ((-3) (make-simple-markup "c "))
31         ((-2) (make-smaller-markup (make-bold-markup "2")))
32         (else (make-simple-markup "bla"))
33       ))))
34   )))
35
36 \context Voice \relative c' {
37   \stemUp
38   \set autoBeaming = ##f
39
40   { <d f g b>8
41
42     \applyOutput #'Voice #mc-squared
43     <d f g b>
44   }
45 }
46
47 % EOF