]> git.donarmstrong.com Git - lilypond.git/blob - scm/define-grobs.scm
New engraver for braces.
[lilypond.git] / scm / define-grobs.scm
1 ;;;; This file is part of LilyPond, the GNU music typesetter.
2 ;;;;
3 ;;;; Copyright (C) 1998--2011 Han-Wen Nienhuys <hanwen@xs4all.nl>
4 ;;;;                 Jan Nieuwenhuizen <janneke@gnu.org>
5 ;;;;
6 ;;;; LilyPond is free software: you can redistribute it and/or modify
7 ;;;; it under the terms of the GNU General Public License as published by
8 ;;;; the Free Software Foundation, either version 3 of the License, or
9 ;;;; (at your option) any later version.
10 ;;;;
11 ;;;; LilyPond is distributed in the hope that it will be useful,
12 ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 ;;;; GNU General Public License for more details.
15 ;;;;
16 ;;;; You should have received a copy of the GNU General Public License
17 ;;;; along with LilyPond.  If not, see <http://www.gnu.org/licenses/>.
18
19 ;;;; distances are given in line-thickness (thicknesses) and
20 ;;;; staff-space (distances)
21
22 ;;;; WARNING: the meta field should be the last one.
23 ;;;; WARNING: don't use anonymous functions for initialization.
24
25 ;; TODO: junk the meta field in favor of something more compact?
26
27 (define-public all-grob-descriptions
28   `(
29     (Accidental
30      . (
31         (alteration . ,accidental-interface::calc-alteration)
32         (avoid-slur . inside)
33         (glyph-name-alist . ,standard-alteration-glyph-name-alist)
34         (stencil . ,ly:accidental-interface::print)
35         (X-extent . ,ly:accidental-interface::width)
36         (Y-extent . ,ly:accidental-interface::height)
37         (meta . ((class . Item)
38                  (interfaces . (accidental-interface
39                                 inline-accidental-interface
40                                 font-interface))))))
41
42     (AccidentalCautionary
43      . (
44         (alteration . ,accidental-interface::calc-alteration)
45         (avoid-slur . inside)
46         (glyph-name-alist . ,standard-alteration-glyph-name-alist)
47         (parenthesized . #t)
48         (stencil . ,ly:accidental-interface::print)
49         (Y-extent . ,ly:accidental-interface::height)
50         (meta . ((class . Item)
51                  (interfaces . (accidental-interface
52                                 inline-accidental-interface
53                                 font-interface))))))
54
55     (AccidentalPlacement
56      . (
57         (direction .  ,LEFT)
58         (positioning-done . ,ly:accidental-placement::calc-positioning-done)
59
60         ;; this is quite small, but it is very ugly to have
61         ;; accs closer to the previous note than to the next one.
62         (right-padding . 0.15)
63
64         ;; for horizontally stacked scripts.
65         (script-priority .  -100)
66
67         (X-extent . ,ly:axis-group-interface::width)
68         (meta . ((class . Item)
69                  (interfaces . (accidental-placement-interface))))))
70
71     (AccidentalSuggestion
72      . (
73         (alteration . ,accidental-interface::calc-alteration)
74         (direction . ,UP)
75         (font-size . -2)
76         (glyph-name-alist . ,standard-alteration-glyph-name-alist)
77         (outside-staff-priority . 0)
78         (script-priority . 0)
79         (self-alignment-X . ,CENTER)
80         (side-axis . ,Y)
81         (staff-padding . 0.25)
82         (stencil . ,ly:accidental-interface::print)
83         (X-extent . ,ly:accidental-interface::width)
84         (X-offset . ,(ly:make-simple-closure
85                       `(,+
86                         ,(ly:make-simple-closure
87                           (list ly:self-alignment-interface::centered-on-x-parent))
88                         ,(ly:make-simple-closure
89                           (list ly:self-alignment-interface::x-aligned-on-self)))))
90         (Y-extent . ,ly:accidental-interface::height)
91         (Y-offset . ,ly:side-position-interface::y-aligned-side)
92         (meta . ((class . Item)
93                  (interfaces . (accidental-interface
94                                 accidental-suggestion-interface
95                                 font-interface
96                                 script-interface
97                                 self-alignment-interface
98                                 side-position-interface))))))
99
100     (Ambitus
101      . (
102         (axes . (,X ,Y))
103         (break-align-symbol . ambitus)
104         (break-visibility . ,begin-of-line-visible)
105         (non-musical . #t)
106         (space-alist . (
107                         (cue-end-clef . (extra-space . 0.5))
108                         (clef . (extra-space . 0.5))
109                         (cue-clef . (extra-space . 0.5))
110                         (key-signature . (extra-space . 0.0))
111                         (staff-bar . (extra-space . 0.0))
112                         (time-signature . (extra-space . 0.0))
113                         (first-note . (fixed-space . 0.0))))
114         (X-extent . ,ly:axis-group-interface::width)
115         (Y-extent . ,ly:axis-group-interface::height)
116         (meta . ((class . Item)
117                  (object-callbacks . ((pure-Y-common . ,ly:axis-group-interface::calc-pure-y-common)
118                                       (pure-relevant-grobs . ,ly:axis-group-interface::calc-pure-relevant-grobs)))
119                  (interfaces . (ambitus-interface
120                                 axis-group-interface
121                                 break-aligned-interface))))))
122
123     (AmbitusAccidental
124      . (
125         (direction . ,LEFT)
126         (glyph-name-alist . ,standard-alteration-glyph-name-alist)
127         (padding . 0.5)
128         (side-axis . ,X)
129         (stencil . ,ly:accidental-interface::print)
130         (X-offset . ,ly:side-position-interface::x-aligned-side)
131         (Y-extent . ,ly:accidental-interface::height)
132         (meta . ((class . Item)
133                  (interfaces . (accidental-interface
134                                 break-aligned-interface
135                                 font-interface
136                                 side-position-interface))))))
137
138     (AmbitusLine
139      . (
140         (gap . 0.35)
141         (stencil . ,ambitus::print)
142         (thickness . 2)
143         (X-offset . ,ly:self-alignment-interface::centered-on-x-parent)
144         (meta . ((class . Item)
145                  (interfaces . (ambitus-interface
146                                 font-interface))))))
147
148     (AmbitusNoteHead
149      . (
150         (duration-log . 2)
151         (glyph-name . ,note-head::calc-glyph-name)
152         (stencil . ,ly:note-head::print)
153         (Y-offset . ,ly:staff-symbol-referencer::callback)
154         (meta . ((class . Item)
155                  (interfaces . (ambitus-interface
156                                 font-interface
157                                 ledgered-interface
158                                 note-head-interface
159                                 rhythmic-head-interface
160                                 staff-symbol-referencer-interface))))))
161
162     (Arpeggio
163      . (
164         (direction . ,LEFT)
165         (padding . 0.5)
166         (positions . ,ly:arpeggio::calc-positions)
167         (script-priority . 0)
168         (side-axis . ,X)
169         (staff-position . 0.0)
170         (stencil . ,ly:arpeggio::print)
171         (X-extent . ,ly:arpeggio::width)
172         (X-offset . ,ly:side-position-interface::x-aligned-side)
173         (Y-offset . ,ly:staff-symbol-referencer::callback)
174         (meta . ((class . Item)
175                  (interfaces . (arpeggio-interface
176                                 font-interface
177                                 side-position-interface
178                                 staff-symbol-referencer-interface))))))
179
180     (BalloonTextItem
181      . (
182         (annotation-balloon . #t)
183         (annotation-line . #t)
184         (stencil . ,ly:balloon-interface::print)
185         (text . ,(grob::calc-property-by-copy 'text))
186         (X-offset . ,(grob::calc-property-by-copy 'X-offset))
187         (Y-offset . ,(grob::calc-property-by-copy 'Y-offset))
188         (meta . ((class . Item)
189                  (interfaces . (balloon-interface
190                                 font-interface
191                                 text-interface))))))
192
193     (BarLine
194      . (
195         (allow-span-bar . #t)
196         (bar-extent . ,ly:bar-line::calc-bar-extent)
197         (break-align-anchor . ,ly:bar-line::calc-anchor)
198         (break-align-symbol . staff-bar)
199         (break-visibility . ,bar-line::calc-break-visibility)
200         (gap . 0.4)
201         (glyph . "|")
202         (glyph-name . ,bar-line::calc-glyph-name)
203
204         ;;
205         ;; Ross. page 151 lists other values, we opt for a leaner look
206         ;;
207         ;; TODO:
208         ;; kern should scale with line-thickness too.
209         (kern . 3.0)
210         (thin-kern . 3.0)
211         (hair-thickness . 1.9)
212         (thick-thickness . 6.0)
213
214         (layer . 0)
215         (non-musical . #t)
216         (space-alist . (
217                         (time-signature . (extra-space . 0.75))
218                         (custos . (minimum-space . 2.0))
219                         (clef . (minimum-space . 1.0))
220                         (key-signature . (extra-space . 1.0))
221                         (key-cancellation . (extra-space . 1.0))
222                         (first-note . (fixed-space . 1.3))
223                         (next-note . (semi-fixed-space . 0.9))
224                         (right-edge . (extra-space . 0.0))))
225         (stencil . ,ly:bar-line::print)
226         (meta . ((class . Item)
227                  (interfaces . (bar-line-interface
228                                 break-aligned-interface
229                                 font-interface))))))
230
231     (BarNumber
232      . (
233         (after-line-breaking . ,ly:side-position-interface::move-to-extremal-staff)
234         ;; want the bar number before the clef at line start.
235         (break-align-symbols . (left-edge staff-bar))
236
237         (break-visibility . ,begin-of-line-visible)
238         (direction . ,UP)
239         (font-family . roman)
240         (font-size . -2)
241         (non-musical . #t)
242         (outside-staff-priority . 100)
243         (padding . 1.0)
244         (self-alignment-X . ,RIGHT)
245         (side-axis . ,Y)
246         (stencil . ,ly:text-interface::print)
247         (X-offset . ,(ly:make-simple-closure
248                       `(,+
249                         ,(ly:make-simple-closure
250                           (list ly:break-alignable-interface::self-align-callback))
251                         ,(ly:make-simple-closure
252                           (list ly:self-alignment-interface::x-aligned-on-self)))))
253         (Y-offset . ,ly:side-position-interface::y-aligned-side)
254         (meta .
255               ((class . Item)
256                (interfaces . (break-alignable-interface
257                               font-interface
258                               self-alignment-interface
259                               side-position-interface
260                               text-interface))))))
261
262     (BassFigure
263      . (
264         (stencil . ,ly:text-interface::print)
265         (meta . ((class . Item)
266                  (interfaces . (bass-figure-interface
267                                 font-interface
268                                 rhythmic-grob-interface
269                                 text-interface))))))
270
271     (BassFigureAlignment
272      . (
273         (axes . (,Y))
274         (padding . 0.2)
275         (positioning-done . ,ly:align-interface::align-to-minimum-distances)
276         (stacking-dir . ,DOWN)
277         (Y-extent . ,ly:axis-group-interface::height)
278         (meta . ((class . Spanner)
279                  (object-callbacks . ((pure-Y-common . ,ly:axis-group-interface::calc-pure-y-common)
280                                       (pure-relevant-grobs . ,ly:axis-group-interface::calc-pure-relevant-grobs)))
281                  (interfaces . (align-interface
282                                 axis-group-interface
283                                 bass-figure-alignment-interface))))))
284
285     (BassFigureAlignmentPositioning
286      . (
287         (axes . (,Y))
288         (direction . ,UP)
289         (padding . 0.5)
290         (side-axis . ,Y)
291         (staff-padding . 1.0)
292         (Y-extent . ,ly:axis-group-interface::height)
293         (Y-offset . ,ly:side-position-interface::y-aligned-side)
294         (meta . ((class . Spanner)
295                  (object-callbacks . ((pure-Y-common . ,ly:axis-group-interface::calc-pure-y-common)
296                                       (pure-relevant-grobs . ,ly:axis-group-interface::calc-pure-relevant-grobs)))
297                  (interfaces . (axis-group-interface
298                                 side-position-interface))))))
299
300     (BassFigureBracket
301      . (
302         (edge-height . (0.2 . 0.2))
303         (stencil . ,ly:enclosing-bracket::print)
304         (X-extent . ,ly:enclosing-bracket::width)
305         (meta . ((class . Item)
306                  (interfaces . (enclosing-bracket-interface))))))
307
308     (BassFigureContinuation
309      . (
310         (stencil . ,ly:figured-bass-continuation::print)
311         (Y-offset . ,ly:figured-bass-continuation::center-on-figures)
312         (meta . ((class . Spanner)
313                  (interfaces . (figured-bass-continuation-interface))))))
314
315     (BassFigureLine
316      . (
317         (adjacent-pure-heights . ,ly:axis-group-interface::adjacent-pure-heights)
318         (axes . (,Y))
319         (vertical-skylines . ,ly:axis-group-interface::calc-skylines)
320         (Y-extent . ,ly:axis-group-interface::height)
321         (meta . ((class . Spanner)
322                  (object-callbacks . ((pure-Y-common . ,ly:axis-group-interface::calc-pure-y-common)
323                                       (pure-relevant-grobs . ,ly:axis-group-interface::calc-pure-relevant-grobs)))
324                  (interfaces . (axis-group-interface))))))
325
326
327     (Beam
328      . (
329         ;; todo: clean this up a bit: the list is getting
330         ;; rather long.
331         (auto-knee-gap . 5.5)
332         (beam-thickness . 0.48) ; in staff-space
333
334         ;; We have some unreferenced problems here.
335         ;;
336         ;; If we shorten beamed stems less than normal stems (1 staff-space),
337         ;; or high order less than 8th beams, patterns like
338         ;;     c''4 [c''8 c''] c''4 [c''16 c]
339         ;; are ugly (different stem lengths).
340         ;;
341         ;; But if we shorten 16th beams as much as 8th beams, a single
342         ;; forced 16th beam looks *very* short.
343
344         ;; We choose to shorten 8th beams the same as single stems,
345         ;; and high order beams less than 8th beams, so that all
346         ;; isolated shortened beams look nice and a bit shortened,
347         ;; sadly possibly breaking patterns with high order beams.
348         (beamed-stem-shorten . (1.0 0.5 0.25))
349
350         (beaming . ,ly:beam::calc-beaming)
351         (clip-edges . #t)
352         (collision-interfaces . (beam-interface
353                                  clef-interface
354                                  inline-accidental-interface
355                                  key-signature-interface
356                                  note-head-interface
357                                  stem-interface
358                                  time-signature-interface))
359         (concaveness . ,ly:beam::calc-concaveness)
360         (cross-staff . ,ly:beam::calc-cross-staff)
361         (damping . 1)
362         (details
363          .(
364            (secondary-beam-demerit . 10)
365            (stem-length-demerit-factor . 5)
366            (region-size . 2)
367            (beam-eps . 0.001)
368            (stem-length-limit-penalty . 5000)
369            (damping-direction-penalty . 800)
370            (hint-direction-penalty . 20)
371            (musical-direction-factor . 400)
372            (ideal-slope-factor . 10)
373            (collision-penalty . 500)
374            (collision-padding . 0.35)
375            (round-to-zero-slope . 0.02)))
376         (direction . ,ly:beam::calc-direction)
377
378         (normalized-endpoints . ,ly:spanner::calc-normalized-endpoints)
379         ;; only for debugging.
380         (font-family . roman)
381
382         (gap . 0.8)
383         (neutral-direction . ,DOWN)
384         (positions .  ,(ly:make-simple-closure
385                         (ly:make-simple-closure
386                          (list chain-grob-member-functions
387                            `(,cons 0 0)
388                            ly:beam::calc-least-squares-positions
389                            ly:beam::slope-damping
390                            ly:beam::shift-region-to-valid
391                            ly:beam::quanting
392                            ))))
393
394         ;; this is a hack to set stem lengths, if positions is set.
395         (quantized-positions . ,ly:beam::set-stem-lengths)
396
397         (shorten . ,ly:beam::calc-stem-shorten)
398         (stencil . ,ly:beam::print)
399
400         (meta . ((class . Spanner)
401                  (object-callbacks . ((normal-stems . ,ly:beam::calc-normal-stems)))
402                  (interfaces . (beam-interface
403                                 font-interface
404                                 staff-symbol-referencer-interface
405                                 unbreakable-spanner-interface))))))
406
407     (BendAfter
408      . (
409         (minimum-length . 0.5)
410         (stencil . ,bend::print)
411         (thickness . 2.0)
412         (meta . ((class . Spanner)
413                  (interfaces . (bend-after-interface
414                                 spanner-interface))))))
415
416     (BreakAlignGroup
417      . (
418         (axes . (,X))
419         (break-align-anchor . ,ly:break-aligned-interface::calc-average-anchor)
420         (break-visibility . ,ly:break-aligned-interface::calc-break-visibility)
421         (X-extent . ,ly:axis-group-interface::width)
422         (meta . ((class . Item)
423                  (interfaces . (axis-group-interface
424                                 break-aligned-interface))))))
425
426     (BreakAlignment
427      . (
428         (axes . (,X))
429         (break-align-orders . ;; end of line
430                             #((
431                                left-edge
432                                cue-end-clef
433                                ambitus
434                                breathing-sign
435                                clef
436                                cue-clef
437                                staff-bar
438                                key-cancellation
439                                key-signature
440                                time-signature
441                                custos)
442
443                               ;; unbroken
444                               (
445                                left-edge
446                                cue-end-clef
447                                ambitus
448                                breathing-sign
449                                clef
450                                cue-clef
451                                staff-bar
452                                key-cancellation
453                                key-signature
454                                time-signature
455                                custos)
456
457                               ;; begin of line
458                               (
459                                left-edge
460                                ambitus
461                                breathing-sign
462                                clef
463                                key-cancellation
464                                key-signature
465                                staff-bar
466                                time-signature
467                                cue-clef
468                                custos)))
469         (non-musical . #t)
470         (positioning-done . ,ly:break-alignment-interface::calc-positioning-done)
471         (stacking-dir . 1)
472         (X-extent . ,ly:axis-group-interface::width)
473         (meta . ((class . Item)
474                  (interfaces . (axis-group-interface
475                                 break-alignment-interface))))))
476
477     (BreathingSign
478      . (
479         (break-align-symbol . breathing-sign)
480         (break-visibility . ,begin-of-line-invisible)
481         (non-musical . #t)
482         (space-alist . (
483                         (ambitus . (extra-space . 2.0))
484                         (custos . (minimum-space . 1.0))
485                         (key-signature . (minimum-space . 1.5))
486                         (time-signature . (minimum-space . 1.5))
487                         (staff-bar . (minimum-space . 1.5))
488                         (clef . (minimum-space . 2.0))
489                         (cue-clef . (minimum-space . 2.0))
490                         (cue-end-clef . (minimum-space . 2.0))
491                         (first-note . (fixed-space . 1.0)) ;huh?
492                         (right-edge . (extra-space . 0.1))))
493         (stencil . ,ly:text-interface::print)
494         (text . ,(make-musicglyph-markup "scripts.rcomma"))
495         (Y-offset . ,ly:breathing-sign::offset-callback)
496         (meta . ((class . Item)
497                  (interfaces . (break-aligned-interface
498                                 breathing-sign-interface
499                                 font-interface
500                                 text-interface))))))
501
502     (Brace
503      . (
504         (direction . ,LEFT)
505         (font-encoding . fetaBraces)
506         (minimum-brace-height . 95)
507         (padding . 0.5)
508         (positions . ,ly:arpeggio::calc-positions)
509         (script-priority . 0)
510         (side-axis . ,X)
511         (staff-position . 0.0)
512         (stencil . ,ly:arpeggio::brew-chord-brace)
513         (X-extent . (-1 . 0))
514         (X-offset . ,ly:side-position-interface::x-aligned-side)
515         (Y-offset . ,ly:staff-symbol-referencer::callback)
516         (meta . ((class . Item)
517                  (interfaces . (arpeggio-interface
518                                 brace-interface
519                                 font-interface
520                                 side-position-interface
521                                 staff-symbol-referencer-interface))))))
522
523     (ChordName
524      . (
525         (after-line-breaking . ,ly:chord-name::after-line-breaking)
526         (font-family . sans)
527         (font-size . 1.5)
528         (stencil . ,ly:text-interface::print)
529         (extra-spacing-height . (0.2 . -0.2))
530         (word-space . 0.0)
531         (meta . ((class . Item)
532                  (interfaces . (chord-name-interface
533                                 font-interface
534                                 rhythmic-grob-interface
535                                 text-interface))))))
536
537     (Clef
538      . (
539         (avoid-slur . inside)
540         (break-align-anchor . ,ly:break-aligned-interface::calc-extent-aligned-anchor)
541         (break-align-symbol . clef)
542         (break-visibility . ,begin-of-line-visible)
543         (glyph-name . ,ly:clef::calc-glyph-name)
544         (non-musical . #t)
545         (space-alist . ((cue-clef . (extra-space . 2.0))
546                         (staff-bar . (extra-space . 0.7))
547                         (key-cancellation . (minimum-space . 3.5))
548                         (key-signature . (minimum-space . 3.5))
549                         (time-signature . (minimum-space . 4.2))
550                         (first-note . (minimum-fixed-space . 5.0))
551                         (next-note . (extra-space . 0.5))
552                         (right-edge . (extra-space . 0.5))))
553         (stencil . ,ly:clef::print)
554         (Y-offset . ,ly:staff-symbol-referencer::callback)
555         (meta . ((class . Item)
556                  (interfaces . (break-aligned-interface
557                                 clef-interface
558                                 font-interface
559                                 staff-symbol-referencer-interface))))))
560
561     (ClusterSpanner
562      . (
563         (cross-staff . ,ly:cluster::calc-cross-staff)
564         (minimum-length . 0.0)
565         (padding . 0.25)
566         (springs-and-rods . ,ly:spanner::set-spacing-rods)
567         (stencil . ,ly:cluster::print)
568         (style . ramp)
569         (meta . ((class . Spanner)
570                  (interfaces . (cluster-interface))))))
571
572     (ClusterSpannerBeacon
573      . (
574         (Y-extent . ,ly:cluster-beacon::height)
575         (meta . ((class . Item)
576                  (interfaces . (cluster-beacon-interface
577                                 rhythmic-grob-interface))))))
578
579     (CombineTextScript
580      . (
581         (avoid-slur . outside)
582         (baseline-skip . 2)
583         (direction . ,UP)
584         (extra-spacing-width . (+inf.0 . -inf.0))
585         (font-series . bold)
586         (outside-staff-priority . 450)
587         (padding . 0.5)
588         (script-priority . 200)
589         (side-axis . ,Y)
590         (staff-padding . 0.5)
591         ;; todo: add X self alignment?
592         (stencil . ,ly:text-interface::print)
593         (X-offset . ,ly:self-alignment-interface::x-aligned-on-self)
594         (Y-offset . ,ly:side-position-interface::y-aligned-side)
595         (meta . ((class . Item)
596                  (interfaces . (font-interface
597                                 side-position-interface
598                                 text-interface
599                                 text-script-interface))))))
600
601     (CueClef
602      . (
603         (avoid-slur . inside)
604         (break-align-anchor . ,ly:break-aligned-interface::calc-extent-aligned-anchor)
605         (break-align-symbol . cue-clef)
606         (break-visibility . ,begin-of-line-visible)
607         (font-size . -4)
608         (glyph-name . ,ly:clef::calc-glyph-name)
609         (non-musical . #t)
610         (full-size-change . #t)
611         (space-alist . ((staff-bar . (minimum-space . 2.7))
612                         (key-cancellation . (minimum-space . 3.5))
613                         (key-signature . (minimum-space . 3.5))
614                         (time-signature . (minimum-space . 4.2))
615                         (custos . (minimum-space . 0.0))
616                         (first-note . (minimum-fixed-space . 3.0))
617                         (next-note . (extra-space . 0.5))
618                         (right-edge . (extra-space . 0.5))))
619         (stencil . ,ly:clef::print)
620         (Y-offset . ,ly:staff-symbol-referencer::callback)
621         (meta . ((class . Item)
622                  (interfaces . (break-aligned-interface
623                                 clef-interface
624                                 font-interface
625                                 staff-symbol-referencer-interface))))))
626
627     (CueEndClef
628      . (
629         (avoid-slur . inside)
630         (break-align-anchor . ,ly:break-aligned-interface::calc-extent-aligned-anchor)
631         (break-align-symbol . cue-end-clef)
632         (break-visibility . ,begin-of-line-invisible)
633         (font-size . -4)
634         (glyph-name . ,ly:clef::calc-glyph-name)
635         (non-musical . #t)
636         (full-size-change . #t)
637         (space-alist . ((clef . (extra-space . 0.7))
638                         (cue-clef . (extra-space . 0.7))
639                         (staff-bar . (extra-space . 0.7))
640                         (key-cancellation . (minimum-space . 3.5))
641                         (key-signature . (minimum-space . 3.5))
642                         (time-signature . (minimum-space . 4.2))
643                         (first-note . (minimum-fixed-space . 5.0))
644                         (next-note . (extra-space . 0.5))
645                         (right-edge . (extra-space . 0.5))))
646         (stencil . ,ly:clef::print)
647         (Y-offset . ,ly:staff-symbol-referencer::callback)
648         (meta . ((class . Item)
649                  (interfaces . (break-aligned-interface
650                                 clef-interface
651                                 font-interface
652                                 staff-symbol-referencer-interface))))))
653
654     (Custos
655      . (
656         (break-align-symbol . custos)
657         (break-visibility . ,end-of-line-visible)
658         (neutral-direction . ,DOWN)
659         (non-musical . #t)
660         (space-alist . (
661                         (first-note . (minimum-fixed-space . 0.0))
662                         (right-edge . (extra-space . 0.1))))
663         (stencil . ,ly:custos::print)
664         (style . vaticana)
665         (Y-offset . ,ly:staff-symbol-referencer::callback)
666         (meta . ((class . Item)
667                  (interfaces  . (break-aligned-interface
668                                  custos-interface
669                                  font-interface
670                                  staff-symbol-referencer-interface))))))
671
672     (DotColumn
673      . (
674         (axes . (,X))
675         (direction . ,RIGHT)
676         (positioning-done . ,ly:dot-column::calc-positioning-done)
677         (X-extent . ,ly:axis-group-interface::width)
678         (meta . ((class . Item)
679                  (interfaces . (axis-group-interface
680                                 dot-column-interface))))))
681
682     (Dots
683      . (
684         (dot-count . ,dots::calc-dot-count)
685         (staff-position . ,dots::calc-staff-position)
686         (stencil . ,ly:dots::print)
687         (extra-spacing-height . (-0.5 . 0.5))
688         (meta . ((class . Item)
689                  (interfaces . (dots-interface
690                                 font-interface
691                                 staff-symbol-referencer-interface))))))
692
693     (DoublePercentRepeat
694      . (
695         (break-align-symbol . staff-bar)
696         (break-visibility . ,begin-of-line-invisible)
697         (dot-negative-kern . 0.75)
698         (font-encoding . fetaMusic)
699         (non-musical . #t)
700         (slash-negative-kern . 1.6)
701         (slope . 1.0)
702         (stencil . ,ly:percent-repeat-item-interface::double-percent)
703         (thickness . 0.48)
704         (meta . ((class . Item)
705                  (interfaces . (break-aligned-interface
706                                 font-interface
707                                 percent-repeat-interface
708                                 percent-repeat-item-interface))))))
709
710     (DoublePercentRepeatCounter
711      . (
712         (direction . ,UP)
713         (font-encoding . fetaText)
714         (font-size . -2)
715         (padding . 0.2)
716         (self-alignment-X . ,CENTER)
717         (side-axis . ,Y)
718         (staff-padding . 0.25)
719         (stencil . ,ly:text-interface::print)
720         (X-offset . ,(ly:make-simple-closure
721                       `(,+
722                         ,(ly:make-simple-closure
723                           (list ly:self-alignment-interface::centered-on-y-parent))
724                         ,(ly:make-simple-closure
725                           (list ly:self-alignment-interface::x-aligned-on-self)))))
726         (Y-offset . ,ly:side-position-interface::y-aligned-side)
727         (meta . ((class . Item)
728                  (interfaces . (font-interface
729                                 percent-repeat-interface
730                                 percent-repeat-item-interface
731                                 self-alignment-interface
732                                 side-position-interface
733                                 text-interface))))))
734
735     (DoubleRepeatSlash
736      . (
737         (dot-negative-kern . 0.75)
738         (font-encoding . fetaMusic)
739         (slash-negative-kern . 1.6)
740         (slope . 1.0)
741         (stencil . ,ly:percent-repeat-item-interface::beat-slash)
742         (thickness . 0.48)
743         (meta . ((class . Item)
744                  (interfaces . (font-interface
745                                 percent-repeat-interface
746                                 percent-repeat-item-interface
747                                 rhythmic-grob-interface))))))
748
749     (DynamicLineSpanner
750      . (
751         (axes . (,Y))
752         (cross-staff . ,ly:side-position-interface::calc-cross-staff)
753         (direction . ,DOWN)
754         (minimum-space . 1.2)
755         (outside-staff-priority . 250)
756         (padding . 0.6)
757         (side-axis . ,Y)
758         (slur-padding . 0.3)
759         (staff-padding . 0.1)
760         (X-extent . ,ly:axis-group-interface::width)
761         (Y-extent . ,ly:axis-group-interface::height)
762         (Y-offset . ,ly:side-position-interface::y-aligned-side)
763         (meta . ((class . Spanner)
764                  (object-callbacks . ((pure-Y-common . ,ly:axis-group-interface::calc-pure-y-common)
765                                       (pure-relevant-grobs . ,ly:axis-group-interface::calc-pure-relevant-grobs)))
766                  (interfaces . (axis-group-interface
767                                 dynamic-interface
768                                 dynamic-line-spanner-interface
769                                 side-position-interface))))))
770
771     (DynamicText
772      . (
773
774         ;; todo.
775
776         (direction . ,ly:script-interface::calc-direction)
777         (extra-spacing-width . (+inf.0 . -inf.0))
778         (font-encoding . fetaText)
779         (font-series . bold)
780         (font-shape . italic)
781         (outside-staff-priority . 250)
782         (positioning-done . ,ly:script-interface::calc-positioning-done)
783         (right-padding . 0.5)
784         (self-alignment-X . ,CENTER)
785         (self-alignment-Y . ,CENTER)
786         (stencil . ,ly:text-interface::print)
787         (X-offset . ,ly:self-alignment-interface::x-aligned-on-self)
788         (Y-offset . ,ly:self-alignment-interface::y-aligned-on-self)
789         (meta . ((class . Item)
790                  (interfaces . (dynamic-interface
791                                 dynamic-text-interface
792                                 font-interface
793                                 script-interface
794                                 self-alignment-interface
795                                 text-interface))))))
796
797     (DynamicTextSpanner
798      . (
799         (before-line-breaking . ,dynamic-text-spanner::before-line-breaking)
800         (bound-details . ((right . ((attach-dir .  ,LEFT)
801                                     (Y . 0)
802                                     (padding . 0.75)
803                                     ))
804                           (right-broken . ((attach-dir .  ,RIGHT)
805                                     (padding . 0.0)
806                                     ))
807
808                           (left . ((attach-dir .  ,LEFT)
809                                    (Y . 0)
810                                    (stencil-offset . (-0.75 . -0.5))
811                                    (padding . 0.75)
812                                    ))
813                           (left-broken . ((attach-dir .  ,RIGHT)
814                                    ))
815                           ))
816         (dash-fraction . 0.2)
817         (dash-period . 3.0)
818
819         ;; rather ugh with NCSB
820         ;; (font-series . bold)
821         (font-shape . italic)
822
823         ;; need to blend with dynamic texts.
824         (font-size . 1)
825
826         (left-bound-info . ,ly:line-spanner::calc-left-bound-info-and-text)
827
828         (minimum-length . 2.0)
829         ;; make sure the spanner doesn't get too close to notes
830         (minimum-Y-extent . (-1 . 1))
831
832         (right-bound-info . ,ly:line-spanner::calc-right-bound-info)
833         (springs-and-rods . ,ly:spanner::set-spacing-rods)
834         (stencil . ,ly:line-spanner::print)
835         (style . dashed-line)
836         (meta . ((class . Spanner)
837                  (interfaces . (dynamic-interface
838                                 dynamic-text-spanner-interface
839                                 font-interface
840                                 line-interface
841                                 line-spanner-interface
842                                 spanner-interface
843                                 text-interface))))))
844
845
846     (Episema
847      . (
848         (bound-details . ((left . ((Y . 0)
849                                    (padding . 0)
850                                    (attach-dir . ,LEFT)
851                                    ))
852                           (right . ((Y . 0)
853                                     (padding . 0)
854                                     (attach-dir . ,RIGHT)
855                                     ))
856                           ))
857         (direction . ,UP)
858         (left-bound-info . ,ly:line-spanner::calc-left-bound-info)
859         (quantize-position . #t)
860         (right-bound-info . ,ly:line-spanner::calc-right-bound-info)
861         (side-axis . ,Y)
862         (stencil . ,ly:line-spanner::print)
863         (style . line)
864         (Y-offset . ,ly:side-position-interface::y-aligned-side)
865         (meta . ((class . Spanner)
866                  (interfaces . (episema-interface
867                                 font-interface
868                                 line-interface
869                                 line-spanner-interface
870                                 side-position-interface))))))
871
872
873     (Fingering
874      . (
875
876         ;; sync with TextScript (?)
877
878         (avoid-slur . around)
879         (cross-staff . ,ly:side-position-interface::calc-cross-staff)
880         (direction . ,ly:script-interface::calc-direction)
881         (font-encoding . fetaText)
882         (font-size . -5)                ; don't overlap when next to heads.
883         (padding . 0.5)
884         (positioning-done . ,ly:script-interface::calc-positioning-done)
885         (script-priority . 100)
886         (self-alignment-X . ,CENTER)
887         (self-alignment-Y . ,CENTER)
888         (slur-padding . 0.2)
889         (staff-padding . 0.5)
890         (stencil . ,ly:text-interface::print)
891         (text . ,fingering::calc-text)
892         (meta . ((class . Item)
893                  (interfaces . (finger-interface
894                                 font-interface
895                                 self-alignment-interface
896                                 side-position-interface
897                                 text-interface
898                                 text-script-interface))))))
899
900     (FootnoteItem
901      . (
902         (annotation-balloon . #f)
903         (annotation-line . #t)
904         (break-visibility . ,inherit-y-parent-visibility)
905         (footnote-text . ,(grob::calc-property-by-copy 'footnote-text))
906         (stencil . ,ly:balloon-interface::print)
907         (text . ,(grob::calc-property-by-copy 'text))
908         (X-extent . #f)
909         (Y-extent . #f)
910         (X-offset . ,(grob::calc-property-by-copy 'X-offset))
911         (Y-offset . ,(grob::calc-property-by-copy 'Y-offset))
912         (meta . ((class . Item)
913                  (interfaces . (balloon-interface
914                                 footnote-interface
915                                 font-interface
916                                 text-interface))))))
917
918     (FootnoteSpanner
919      . (
920         (annotation-balloon . #f)
921         (annotation-line . #t)
922         (footnote-text . ,(grob::calc-property-by-copy 'footnote-text))
923         (spanner-placement . ,LEFT)
924         (stencil . ,ly:balloon-interface::print-spanner)
925         (text . ,(grob::calc-property-by-copy 'text))
926         (X-extent . #f)
927         (Y-extent . #f)
928         (X-offset . ,(grob::calc-property-by-copy 'X-offset))
929         (Y-offset . ,(grob::calc-property-by-copy 'Y-offset))
930         (meta . ((class . Spanner)
931                  (interfaces . (balloon-interface
932                                 footnote-interface
933                                 footnote-spanner-interface
934                                 font-interface
935                                 text-interface))))))
936
937     (FretBoard
938      . (
939         (after-line-breaking . ,ly:chord-name::after-line-breaking)
940         (fret-diagram-details . ((finger-code . below-string)))
941         (stencil . ,fret-board::calc-stencil)
942         (extra-spacing-height . (0.2 . -0.2))
943         (meta . ((class . Item)
944                  (interfaces . (chord-name-interface
945                                 font-interface
946                                 fret-diagram-interface
947                                 rhythmic-grob-interface))))))
948
949
950     (Glissando
951      . (
952         (after-line-breaking . ,ly:spanner::kill-zero-spanned-time)
953         (bound-details . ((right . ((attach-dir .  ,CENTER)
954                                     (padding . 1.5)
955                                       ))
956                           (left . ((attach-dir .  ,CENTER)
957                                    (padding . 1.5)
958                                       ))
959                           ))
960         (gap . 0.5)
961         (left-bound-info . ,ly:line-spanner::calc-left-bound-info)
962         (normalized-endpoints . ,ly:spanner::calc-normalized-endpoints)
963         (right-bound-info . ,ly:line-spanner::calc-right-bound-info)
964         (simple-Y . #t)
965         (stencil . ,ly:line-spanner::print)
966         (style . line)
967         (X-extent . #f)
968         (Y-extent . #f)
969         (zigzag-width . 0.75)
970         (meta . ((class . Spanner)
971                  (interfaces . (glissando-interface
972                                 line-interface
973                                 line-spanner-interface
974                                 unbreakable-spanner-interface))))))
975
976     (GraceSpacing
977      . (
978         (common-shortest-duration . ,grace-spacing::calc-shortest-duration)
979         (shortest-duration-space . 1.6)
980         (spacing-increment . 0.8)
981         (meta . ((class . Spanner)
982                  (interfaces . (grace-spacing-interface
983                                 spacing-options-interface
984                                 spanner-interface))))))
985
986     (GridLine
987      . (
988         (layer . 0)
989         (self-alignment-X . ,CENTER)
990         (stencil . ,ly:grid-line-interface::print)
991         (X-extent  . ,ly:grid-line-interface::width)
992         (X-offset . ,(ly:make-simple-closure
993                       `(,+
994                         ,(ly:make-simple-closure
995                           (list ly:self-alignment-interface::centered-on-x-parent))
996                         ,(ly:make-simple-closure
997                           (list ly:self-alignment-interface::x-aligned-on-self)))))
998         (meta . ((class . Item)
999                  (interfaces . (grid-line-interface
1000                                 self-alignment-interface))))))
1001
1002     (GridPoint
1003      . (
1004         (X-extent . (0 . 0))
1005         (Y-extent . (0 . 0))
1006         (meta . ((class . Item)
1007                  (interfaces . (grid-point-interface))))))
1008
1009
1010     (Hairpin
1011      . (
1012         (after-line-breaking . ,ly:spanner::kill-zero-spanned-time)
1013         (bound-padding . 1.0)
1014         (circled-tip . #f)
1015         (grow-direction . ,hairpin::calc-grow-direction)
1016         (height . 0.6666)
1017         (minimum-length . 2.0)
1018         (self-alignment-Y . ,CENTER)
1019         (springs-and-rods . ,ly:spanner::set-spacing-rods)
1020         (stencil . ,ly:hairpin::print)
1021         (thickness . 1.0)
1022         (to-barline . #t)
1023         (Y-offset . ,ly:self-alignment-interface::y-aligned-on-self)
1024         (meta . ((class . Spanner)
1025                  (interfaces . (dynamic-interface
1026                                 hairpin-interface
1027                                 line-interface
1028                                 self-alignment-interface
1029                                 spanner-interface))))))
1030
1031     (HorizontalBracket
1032      . (
1033         (bracket-flare . (0.5 . 0.5))
1034         (connect-to-neighbor . ,ly:tuplet-bracket::calc-connect-to-neighbors)
1035         (direction . ,DOWN)
1036         (padding . 0.2)
1037         (side-axis . ,Y)
1038         (staff-padding . 0.2)
1039         (stencil . ,ly:horizontal-bracket::print)
1040         (thickness . 1.0)
1041         (Y-offset . ,ly:side-position-interface::y-aligned-side)
1042         (meta . ((class . Spanner)
1043                  (interfaces . (horizontal-bracket-interface
1044                                 line-interface
1045                                 side-position-interface
1046                                 spanner-interface))))))
1047
1048
1049     (InstrumentName
1050      . (
1051         (direction . ,LEFT)
1052         (padding . 0.3)
1053         (self-alignment-X . ,CENTER)
1054         (self-alignment-Y . ,CENTER)
1055         (stencil . ,system-start-text::print)
1056         (X-offset . ,system-start-text::calc-x-offset)
1057         (Y-offset . ,system-start-text::calc-y-offset)
1058         (meta . ((class . Spanner)
1059                  (interfaces . (font-interface
1060                                 self-alignment-interface
1061                                 side-position-interface
1062                                 system-start-text-interface))))))
1063
1064     (InstrumentSwitch
1065      . (
1066         (direction . ,UP)
1067         (extra-spacing-width . (+inf.0 . -inf.0))
1068         (outside-staff-priority . 500)
1069         (padding . 0.5)
1070         (self-alignment-X . ,LEFT)
1071         (side-axis . ,Y)
1072         (staff-padding . 0.5)
1073         (stencil . ,ly:text-interface::print)
1074         (X-offset . ,ly:self-alignment-interface::x-aligned-on-self)
1075         (Y-offset . ,ly:side-position-interface::y-aligned-side)
1076         (meta . ((class . Item)
1077                  (interfaces . (font-interface
1078                                 self-alignment-interface
1079                                 side-position-interface
1080                                 text-interface))))))
1081
1082
1083     (KeyCancellation
1084      . (
1085         (break-align-symbol . key-cancellation)
1086         (break-visibility . ,begin-of-line-invisible)
1087         (glyph-name-alist . ,cancellation-glyph-name-alist)
1088         (non-musical . #t)
1089         (space-alist . (
1090                         (time-signature . (extra-space . 1.25))
1091                         (staff-bar . (extra-space . 0.6))
1092                         (key-signature . (extra-space . 0.5))
1093                         (cue-clef . (extra-space . 0.5))
1094                         (right-edge . (extra-space . 0.5))
1095                         (first-note . (fixed-space . 2.5))))
1096         (stencil . ,ly:key-signature-interface::print)
1097         (extra-spacing-width . (0.0 . 0.5))
1098         (Y-offset . ,ly:staff-symbol-referencer::callback)
1099         (meta . ((class . Item)
1100                  (interfaces . (break-aligned-interface
1101                                 font-interface
1102                                 key-cancellation-interface
1103                                 key-signature-interface
1104                                 staff-symbol-referencer-interface))))))
1105
1106     (KeySignature
1107      . (
1108         (avoid-slur . inside)
1109         (break-align-anchor . ,ly:break-aligned-interface::calc-extent-aligned-anchor)
1110         (break-align-symbol . key-signature)
1111         (break-visibility . ,begin-of-line-visible)
1112         (glyph-name-alist . ,standard-alteration-glyph-name-alist)
1113         (non-musical . #t)
1114         (space-alist . (
1115                         (time-signature . (extra-space . 1.15))
1116                         (staff-bar . (extra-space . 1.1))
1117                         (cue-clef . (extra-space . 0.5))
1118                         (right-edge . (extra-space . 0.5))
1119                         (first-note . (fixed-space . 2.5))))
1120         (stencil . ,ly:key-signature-interface::print)
1121         (extra-spacing-width . (0.0 . 0.5))
1122         (Y-offset . ,ly:staff-symbol-referencer::callback)
1123         (meta . ((class . Item)
1124                  (interfaces . (break-aligned-interface
1125                                 font-interface
1126                                 key-signature-interface
1127                                 staff-symbol-referencer-interface))))))
1128
1129
1130    (LaissezVibrerTie
1131      . (
1132         (control-points . ,ly:semi-tie::calc-control-points)
1133         (details . ((ratio . 0.333)
1134                     (height-limit . 1.0)))
1135         (direction . ,ly:tie::calc-direction)
1136         (head-direction . ,LEFT)
1137         (stencil  . ,laissez-vibrer::print)
1138         (thickness . 1.0)
1139         (extra-spacing-height . (-0.5 . 0.5))
1140         (meta . ((class . Item)
1141                  (interfaces . (semi-tie-interface))))))
1142
1143     (LaissezVibrerTieColumn
1144      . (
1145         (head-direction . ,ly:semi-tie-column::calc-head-direction)
1146         (positioning-done . ,ly:semi-tie-column::calc-positioning-done)
1147         (X-extent . #f)
1148         (Y-extent . #f)
1149         (meta . ((class . Item)
1150                  (interfaces . (semi-tie-column-interface))))))
1151
1152     (LedgerLineSpanner
1153      . (
1154         (layer . 0)
1155         (length-fraction . 0.25)
1156         (minimum-length-fraction . 0.25)
1157         (springs-and-rods . ,ly:ledger-line-spanner::set-spacing-rods)
1158         (stencil . ,ly:ledger-line-spanner::print)
1159         (X-extent . #f)
1160         (Y-extent . #f)
1161         (meta . ((class . Spanner)
1162                  (interfaces . (ledger-line-spanner-interface))))))
1163
1164     (LeftEdge
1165      . (
1166         (break-align-anchor . ,ly:break-aligned-interface::calc-extent-aligned-anchor)
1167         (break-align-symbol . left-edge)
1168         (break-visibility . ,center-invisible)
1169         (non-musical . #t)
1170         (extra-spacing-height . (+inf.0 . -inf.0))
1171         (space-alist . (
1172                         (ambitus . (extra-space . 2.0))
1173                         (breathing-sign . (minimum-space . 0.0))
1174                         (cue-end-clef . (extra-space . 0.8))
1175                         (clef . (extra-space . 0.8))
1176                         (cue-clef . (extra-space . 0.8))
1177                         (staff-bar . (extra-space . 0.0))
1178                         (key-cancellation . (extra-space . 0.0))
1179                         (key-signature . (extra-space . 0.8))
1180                         (time-signature . (extra-space . 1.0))
1181                         (custos . (extra-space . 0.0))
1182                         (first-note . (fixed-space . 2.0))
1183                         (right-edge . (extra-space . 0.0))
1184                         ))
1185         (X-extent . (0 . 0))
1186         (meta . ((class . Item)
1187                  (interfaces . (break-aligned-interface))))))
1188
1189     (LigatureBracket
1190      . (
1191         ;; ugh.  A ligature bracket is totally different from
1192         ;; a tuplet bracket.
1193
1194         (connect-to-neighbor . ,ly:tuplet-bracket::calc-connect-to-neighbors)
1195         (control-points . ,ly:tuplet-bracket::calc-control-points)
1196         (direction . ,UP)
1197         (edge-height . (0.7 . 0.7))
1198         (padding . 2.0)
1199         (positions . ,ly:tuplet-bracket::calc-positions)
1200         (shorten-pair . (-0.2 . -0.2))
1201         (staff-padding . 0.25)
1202         (stencil . ,ly:tuplet-bracket::print)
1203         (thickness . 1.6)
1204         (meta . ((class . Spanner)
1205                  (interfaces . (line-interface
1206                                 tuplet-bracket-interface))))))
1207
1208     (LyricExtender
1209      . (
1210         (minimum-length . 1.5)
1211         (stencil . ,ly:lyric-extender::print)
1212         (thickness . 0.8) ; line-thickness
1213         (Y-extent . (0 . 0))
1214         (meta . ((class . Spanner)
1215                  (interfaces . (lyric-extender-interface
1216                                 lyric-interface))))))
1217
1218     (LyricHyphen
1219      . (
1220         (after-line-breaking . ,ly:spanner::kill-zero-spanned-time)
1221         (dash-period . 10.0)
1222         (height . 0.42)
1223         (length . 0.66)
1224         (minimum-distance . 0.1)
1225         (minimum-length . 0.3)
1226         (padding . 0.07)
1227         (springs-and-rods . ,ly:lyric-hyphen::set-spacing-rods)
1228         (stencil . ,ly:lyric-hyphen::print)
1229         (thickness . 1.3)
1230         (Y-extent . (0 . 0))
1231         (meta . ((class . Spanner)
1232                  (interfaces . (font-interface
1233                                 lyric-hyphen-interface
1234                                 lyric-interface
1235                                 spanner-interface))))))
1236
1237     (LyricSpace
1238      . (
1239         (minimum-distance . 0.45)
1240         (padding . 0.0)
1241         (springs-and-rods . ,ly:lyric-hyphen::set-spacing-rods)
1242         (X-extent . #f)
1243         (Y-extent . #f)
1244         (meta . ((class . Spanner)
1245                  (interfaces . (lyric-hyphen-interface
1246                                 spanner-interface))))))
1247
1248     (LyricText
1249      . (
1250         (extra-spacing-width . (0.0 . 0.0))
1251         ;; Recede in height for purposes of note spacing,
1252         ;; so notes in melismata can be freely spaced above lyrics
1253         (extra-spacing-height . (0.2 . -0.2))
1254         (font-series . medium)
1255         (font-size . 1.0)
1256         (self-alignment-X . ,CENTER)
1257         (stencil . ,lyric-text::print)
1258         (text . ,(grob::calc-property-by-copy 'text))
1259         (word-space . 0.6)
1260         (X-offset . ,ly:self-alignment-interface::aligned-on-x-parent)
1261         (meta . ((class . Item)
1262                  (interfaces . (font-interface
1263                                 lyric-syllable-interface
1264                                 rhythmic-grob-interface
1265                                 self-alignment-interface
1266                                 text-interface))))))
1267
1268
1269     (MeasureGrouping
1270      . (
1271         (direction . ,UP)
1272         (height . 2.0)
1273         (padding . 2)
1274         (side-axis . ,Y)
1275         (staff-padding . 3)
1276         (stencil . ,ly:measure-grouping::print)
1277         (thickness . 1)
1278         (Y-offset . ,ly:side-position-interface::y-aligned-side)
1279         (meta . ((class . Spanner)
1280                  (interfaces . (measure-grouping-interface
1281                                 side-position-interface))))))
1282
1283     (MelodyItem
1284      . (
1285         (neutral-direction . ,DOWN)
1286         (meta . ((class . Item)
1287                  (interfaces . (melody-spanner-interface))))))
1288
1289     (MensuralLigature
1290      . (
1291         (stencil . ,ly:mensural-ligature::print)
1292         (thickness . 1.4)
1293         (meta . ((class . Spanner)
1294                  (interfaces . (font-interface
1295                                 mensural-ligature-interface))))))
1296
1297     (MetronomeMark
1298      . (
1299         (after-line-breaking . ,ly:side-position-interface::move-to-extremal-staff)
1300         (break-visibility . ,end-of-line-invisible)
1301         (direction . ,UP)
1302         (extra-spacing-width . (+inf.0 . -inf.0))
1303         (outside-staff-priority . 1000)
1304         (padding . 0.8)
1305         (side-axis . ,Y)
1306         (stencil . ,ly:text-interface::print)
1307         (Y-offset . ,ly:side-position-interface::y-aligned-side)
1308         (X-offset . ,(ly:make-simple-closure
1309                       `(,+
1310                         ,(ly:make-simple-closure
1311                           (list ly:break-alignable-interface::self-align-callback))
1312                         ,(ly:make-simple-closure
1313                           (list ly:self-alignment-interface::x-aligned-on-self)))))
1314         (self-alignment-X . ,LEFT)
1315         (break-align-symbols . (time-signature))
1316         (non-break-align-symbols . (multi-measure-rest-interface))
1317         (meta . ((class . Item)
1318                  (interfaces . (break-alignable-interface
1319                                 font-interface
1320                                 metronome-mark-interface
1321                                 self-alignment-interface
1322                                 side-position-interface
1323                                 text-interface))))))
1324
1325     (MultiMeasureRest
1326      . (
1327         (expand-limit . 10)
1328         (hair-thickness . 2.0)
1329         (round-up-exceptions . ())
1330         (padding . 1)
1331         (spacing-pair . (break-alignment . break-alignment))
1332         (springs-and-rods . ,ly:multi-measure-rest::set-spacing-rods)
1333         (stencil . ,ly:multi-measure-rest::print)
1334         (thick-thickness . 6.6)
1335         ;; See Wanske pp. 125
1336         (usable-duration-logs . ,(iota 4 -3))
1337         (Y-offset . ,ly:staff-symbol-referencer::callback)
1338         (meta . ((class . Spanner)
1339                  (interfaces . (font-interface
1340                                 multi-measure-interface
1341                                 multi-measure-rest-interface
1342                                 rest-interface
1343                                 staff-symbol-referencer-interface))))))
1344
1345     (MultiMeasureRestNumber
1346      . (
1347         (bound-padding  . 2.0)
1348         (direction . ,UP)
1349         (font-encoding . fetaText)
1350         (padding . 0.4)
1351         (self-alignment-X . ,CENTER)
1352         (side-axis . ,Y)
1353         (springs-and-rods . ,ly:multi-measure-rest::set-text-rods)
1354         (staff-padding . 0.4)
1355         (stencil . ,ly:text-interface::print)
1356         (X-offset . ,(ly:make-simple-closure
1357                       `(,+
1358                         ,(ly:make-simple-closure
1359                           (list ly:self-alignment-interface::x-aligned-on-self))
1360                         ,(ly:make-simple-closure
1361                           (list ly:self-alignment-interface::x-centered-on-y-parent)))))
1362         (Y-offset . ,ly:side-position-interface::y-aligned-side)
1363         (meta . ((class . Spanner)
1364                  (interfaces . (font-interface
1365                                 multi-measure-interface
1366                                 self-alignment-interface
1367                                 side-position-interface
1368                                 text-interface))))))
1369
1370     (MultiMeasureRestText
1371      . (
1372         (direction . ,UP)
1373         (outside-staff-priority . 450)
1374         (padding . 0.2)
1375         (self-alignment-X . ,CENTER)
1376         (staff-padding . 0.25)
1377         (stencil . ,ly:text-interface::print)
1378         (X-offset . ,(ly:make-simple-closure
1379                       `(,+
1380                         ,(ly:make-simple-closure
1381                           (list ly:self-alignment-interface::x-centered-on-y-parent))
1382                         ,(ly:make-simple-closure
1383                           (list ly:self-alignment-interface::x-aligned-on-self)))))
1384         (Y-offset . ,ly:side-position-interface::y-aligned-side)
1385         (meta . ((class . Spanner)
1386                  (interfaces . (font-interface
1387                                 multi-measure-interface
1388                                 self-alignment-interface
1389                                 side-position-interface
1390                                 text-interface))))))
1391
1392
1393     (NonMusicalPaperColumn
1394      . (
1395         (allow-loose-spacing . #t)
1396         (axes . (,X))
1397         (before-line-breaking . ,ly:paper-column::before-line-breaking)
1398         (full-measure-extra-space . 1.0)
1399         (horizontal-skylines . ,ly:separation-item::calc-skylines)
1400         ;; sufficient padding to prevent ledger lines from moving over/under
1401         (skyline-vertical-padding . 0.6)
1402         ;;                    (stencil . ,ly:paper-column::print)
1403
1404         (keep-inside-line . #t)
1405         (line-break-permission . allow)
1406         (non-musical . #t)
1407         (page-break-permission . allow)
1408
1409         ;; debugging stuff: print column number.
1410         ;;               (font-size . -6) (font-name . "sans")  (Y-extent . #f)
1411
1412         (X-extent . ,ly:axis-group-interface::width)
1413         (meta . ((class . Paper_column)
1414                  (object-callbacks . ((pure-Y-common . ,ly:axis-group-interface::calc-pure-y-common)
1415                                       (pure-relevant-grobs . ,ly:axis-group-interface::calc-pure-relevant-grobs)))
1416                  (interfaces . (axis-group-interface
1417                                 font-interface
1418                                 paper-column-interface
1419                                 separation-item-interface
1420                                 spaceable-grob-interface))))))
1421
1422     (NoteCollision
1423      . (
1424         (axes . (,X ,Y))
1425         (positioning-done . ,ly:note-collision-interface::calc-positioning-done)
1426         (prefer-dotted-right . #t)
1427         (X-extent . ,ly:axis-group-interface::width)
1428         (Y-extent . ,ly:axis-group-interface::height)
1429         (meta . ((class . Item)
1430                  (object-callbacks . ((pure-Y-common . ,ly:axis-group-interface::calc-pure-y-common)
1431                                       (pure-relevant-grobs . ,ly:axis-group-interface::calc-pure-relevant-grobs)))
1432                  (interfaces . (axis-group-interface
1433                                 note-collision-interface))))))
1434
1435     (NoteColumn
1436      . (
1437         (axes . (,X ,Y))
1438         (bound-alignment-interfaces . (rhythmic-head-interface stem-interface))
1439         (horizontal-skylines . ,ly:separation-item::calc-skylines)
1440         (skyline-vertical-padding . 0.15)
1441         (X-extent . ,ly:axis-group-interface::width)
1442         (Y-extent . ,ly:axis-group-interface::height)
1443         (meta . ((class . Item)
1444                  (object-callbacks . ((pure-Y-common . ,ly:axis-group-interface::calc-pure-y-common)
1445                                       (pure-relevant-grobs . ,ly:axis-group-interface::calc-pure-relevant-grobs)))
1446                  (interfaces . (axis-group-interface
1447                                 note-column-interface
1448                                 separation-item-interface))))))
1449
1450     (NoteHead
1451      . (
1452         (flexa-width . 2.0)
1453         (duration-log . ,note-head::calc-duration-log)
1454         (extra-spacing-height . ,ly:note-head::include-ledger-line-height)
1455         (glyph-name . ,note-head::calc-glyph-name)
1456         (ligature-flexa . #f)
1457         (stem-attachment . ,ly:note-head::calc-stem-attachment)
1458         (stencil . ,ly:note-head::print)
1459         (X-offset . ,ly:note-head::stem-x-shift)
1460         (Y-offset . ,ly:staff-symbol-referencer::callback)
1461         (meta . ((class . Item)
1462                  (interfaces . (font-interface
1463                                 gregorian-ligature-interface
1464                                 ledgered-interface
1465                                 ligature-head-interface
1466                                 mensural-ligature-interface
1467                                 note-head-interface
1468                                 rhythmic-grob-interface
1469                                 rhythmic-head-interface
1470                                 staff-symbol-referencer-interface
1471                                 vaticana-ligature-interface))))))
1472
1473     (NoteName
1474      . (
1475         (stencil . ,ly:text-interface::print)
1476         (meta . ((class . Item)
1477                  (interfaces . (font-interface
1478                                 note-name-interface
1479                                 text-interface))))))
1480
1481     (NoteSpacing
1482      . (
1483         ;; Changed this from 0.75.
1484         ;; If you ever change this back, please document! --hwn
1485         (knee-spacing-correction . 1.0)
1486         (same-direction-correction . 0.25)
1487         (space-to-barline . #t)
1488         (stem-spacing-correction . 0.5)
1489         (meta . ((class . Item)
1490                  (interfaces . (note-spacing-interface
1491                                 spacing-interface))))))
1492
1493
1494     (OctavateEight
1495      . (
1496         (break-visibility . ,inherit-x-parent-visibility)
1497         (font-shape . italic)
1498         (font-size . -4)
1499         (self-alignment-X . ,CENTER)
1500         (staff-padding . 0.2)
1501         (stencil . ,ly:text-interface::print)
1502         (X-offset . ,(ly:make-simple-closure
1503                       `(,+
1504                         ,(ly:make-simple-closure
1505                           (list ly:self-alignment-interface::x-aligned-on-self))
1506                         ,(ly:make-simple-closure
1507                           (list ly:self-alignment-interface::centered-on-x-parent)))))
1508         (Y-offset . ,ly:side-position-interface::y-aligned-side)
1509         (meta . ((class . Item)
1510                  (interfaces . (font-interface
1511                                 self-alignment-interface
1512                                 side-position-interface
1513                                 text-interface))))))
1514
1515     (OttavaBracket
1516      . (
1517         (dash-fraction . 0.3)
1518         (direction . ,UP)
1519         (edge-height . (0 . 1.2))
1520         (font-shape . italic)
1521         (minimum-length . 1.0)
1522         (outside-staff-priority . 400)
1523         (padding . 0.5)
1524         (shorten-pair . (0.0 . -0.6))
1525         (staff-padding . 1.0)
1526         (stencil . ,ly:ottava-bracket::print)
1527         (style . dashed-line)
1528         (Y-offset . ,ly:side-position-interface::y-aligned-side)
1529         (meta . ((class . Spanner)
1530                  (interfaces . (font-interface
1531                                 horizontal-bracket-interface
1532                                 line-interface
1533                                 ottava-bracket-interface
1534                                 side-position-interface
1535                                 text-interface))))))
1536
1537
1538     (PaperColumn
1539      . (
1540         (allow-loose-spacing . #t)
1541         (axes . (,X))
1542         (before-line-breaking . ,ly:paper-column::before-line-breaking)
1543         (bound-alignment-interfaces . (note-column-interface))
1544         (horizontal-skylines . ,ly:separation-item::calc-skylines)
1545         (keep-inside-line . #t)
1546         ;; (stencil . ,ly:paper-column::print)
1547         (X-extent . ,ly:axis-group-interface::width)
1548
1549         ;; debugging
1550         ;;                       (font-size . -6) (font-name . "sans") (Y-extent . #f)
1551         (meta . ((class . Paper_column)
1552                  (object-callbacks . ((pure-Y-common . ,ly:axis-group-interface::calc-pure-y-common)
1553                                       (pure-relevant-grobs . ,ly:axis-group-interface::calc-pure-relevant-grobs)))
1554                  (interfaces . (axis-group-interface
1555                                 font-interface
1556                                 paper-column-interface
1557                                 separation-item-interface
1558                                 spaceable-grob-interface))))))
1559
1560     (ParenthesesItem
1561      . (
1562         (font-size . -6)
1563         (padding . 0.2)
1564         (stencil . ,parentheses-item::print)
1565         (stencils . ,parentheses-item::calc-parenthesis-stencils)
1566         (meta . ((class . Item)
1567                  (interfaces . (font-interface
1568                                 parentheses-interface))))))
1569
1570     (PercentRepeat
1571      . (
1572         (dot-negative-kern . 0.75)
1573         (font-encoding . fetaMusic)
1574         (slope . 1.0)
1575         (spacing-pair . (break-alignment . staff-bar))
1576         (springs-and-rods . ,ly:multi-measure-rest::set-spacing-rods)
1577         (stencil . ,ly:multi-measure-rest::percent)
1578         (thickness . 0.48)
1579         (meta . ((class . Spanner)
1580                  (interfaces . (font-interface
1581                                 multi-measure-rest-interface
1582                                 percent-repeat-interface))))))
1583
1584     (PercentRepeatCounter
1585      . (
1586         (direction . ,UP)
1587         (font-encoding . fetaText)
1588         (font-size . -2)
1589         (padding . 0.2)
1590         (self-alignment-X . ,CENTER)
1591         (staff-padding . 0.25)
1592         (stencil . ,ly:text-interface::print)
1593         (X-offset . ,(ly:make-simple-closure
1594                       `(,+
1595                         ,(ly:make-simple-closure
1596                           (list ly:self-alignment-interface::x-centered-on-y-parent))
1597                         ,(ly:make-simple-closure
1598                           (list ly:self-alignment-interface::x-aligned-on-self)))))
1599         (Y-offset . ,ly:side-position-interface::y-aligned-side)
1600         (meta . ((class . Spanner)
1601                  (interfaces . (font-interface
1602                                 percent-repeat-interface
1603                                 self-alignment-interface
1604                                 side-position-interface
1605                                 text-interface))))))
1606
1607     (PhrasingSlur
1608      . (
1609         (control-points . ,ly:slur::calc-control-points)
1610         (cross-staff . ,ly:slur::calc-cross-staff)
1611         (details . ,default-slur-details)
1612         (direction . ,ly:slur::calc-direction)
1613         (height-limit . 2.0)
1614         (minimum-length . 1.5)
1615         (ratio . 0.333)
1616         (spanner-id . "")
1617         (springs-and-rods . ,ly:spanner::set-spacing-rods)
1618         (stencil . ,ly:slur::print)
1619         (thickness . 1.1)
1620         (Y-extent . ,ly:slur::height)
1621         (meta . ((class . Spanner)
1622                  (interfaces . (slur-interface))))))
1623
1624     ;; an example of a text spanner
1625     (PianoPedalBracket
1626      . (
1627         (bound-padding . 1.0)
1628         (bracket-flare . (0.5 . 0.5))
1629         (direction . ,DOWN)
1630         (edge-height . (1.0 . 1.0))
1631         (shorten-pair . (0.0 . 0.0))
1632         (stencil . ,ly:piano-pedal-bracket::print)
1633         (style . line)
1634         (thickness .  1.0)
1635         (meta . ((class . Spanner)
1636                  (interfaces . (line-interface
1637                                 piano-pedal-bracket-interface
1638                                 piano-pedal-interface))))))
1639
1640
1641     (RehearsalMark
1642      . (
1643         (after-line-breaking . ,ly:side-position-interface::move-to-extremal-staff)
1644         (baseline-skip . 2)
1645         (break-align-symbols . (staff-bar clef))
1646         (break-visibility . ,end-of-line-invisible)
1647         (direction . ,UP)
1648         (extra-spacing-width . (+inf.0 . -inf.0))
1649         (font-size . 2)
1650         (non-musical . #t)
1651         (outside-staff-priority . 1500)
1652         (padding . 0.8)
1653         (self-alignment-X . ,CENTER)
1654         (stencil . ,ly:text-interface::print)
1655         (X-offset . ,(ly:make-simple-closure
1656                       `(,+
1657                         ,(ly:make-simple-closure
1658                           (list ly:break-alignable-interface::self-align-callback))
1659                         ,(ly:make-simple-closure
1660                           (list ly:self-alignment-interface::x-aligned-on-self)))))
1661         (Y-offset . ,ly:side-position-interface::y-aligned-side)
1662         (meta . ((class . Item)
1663                  (interfaces . (break-alignable-interface
1664                                 font-interface
1665                                 mark-interface
1666                                 self-alignment-interface
1667                                 side-position-interface
1668                                 text-interface))))))
1669
1670     (RepeatSlash
1671      . (
1672         (slash-negative-kern . 0.85)
1673         (slope . 1.7)
1674         (stencil . ,ly:percent-repeat-item-interface::beat-slash)
1675         (thickness . 0.48)
1676         (meta . ((class . Item)
1677                  (interfaces . (percent-repeat-interface
1678                                 percent-repeat-item-interface
1679                                 rhythmic-grob-interface))))))
1680
1681     (RepeatTie
1682      . (
1683         (control-points . ,ly:semi-tie::calc-control-points)
1684         (details . ((ratio . 0.333)
1685                     (height-limit . 1.0)))
1686         (direction . ,ly:tie::calc-direction)
1687         (head-direction . ,RIGHT)
1688         (stencil  . ,ly:tie::print)
1689         (thickness . 1.0)
1690         (extra-spacing-height . (-0.5 . 0.5))
1691         (meta . ((class . Item)
1692                  (interfaces . (semi-tie-interface))))))
1693
1694     (RepeatTieColumn
1695      . (
1696         (direction . ,ly:tie::calc-direction)
1697         (head-direction . ,ly:semi-tie-column::calc-head-direction)
1698         (positioning-done . ,ly:semi-tie-column::calc-positioning-done)
1699         (X-extent . #f)
1700         (Y-extent . #f)
1701         (meta . ((class . Item)
1702                  (interfaces . (semi-tie-column-interface))))))
1703
1704     (Rest
1705      . (
1706         (cross-staff . ,ly:rest::calc-cross-staff)
1707         (duration-log . ,stem::calc-duration-log)
1708         (minimum-distance . 0.25)
1709         (stencil . ,ly:rest::print)
1710         (X-extent . ,ly:rest::width)
1711         (Y-extent . ,ly:rest::height)
1712         (Y-offset . ,ly:rest::y-offset-callback)
1713         (meta . ((class . Item)
1714                  (interfaces . (font-interface
1715                                 rest-interface
1716                                 rhythmic-grob-interface
1717                                 rhythmic-head-interface
1718                                 staff-symbol-referencer-interface))))))
1719
1720     (RestCollision
1721      . (
1722         (minimum-distance . 0.75)
1723         (positioning-done . ,ly:rest-collision::calc-positioning-done)
1724         (meta . ((class . Item)
1725                  (interfaces . (rest-collision-interface))))))
1726
1727
1728     (Script
1729      . (
1730         (add-stem-support . #t)
1731         (cross-staff . ,ly:script-interface::calc-cross-staff)
1732         (direction . ,ly:script-interface::calc-direction)
1733         (font-encoding . fetaMusic)
1734         (positioning-done . ,ly:script-interface::calc-positioning-done)
1735         (side-axis . ,Y)
1736
1737         ;; padding set in script definitions.
1738         (staff-padding . 0.25)
1739
1740         (stencil . ,ly:script-interface::print)
1741         (X-offset . ,script-interface::calc-x-offset)
1742         (Y-offset . ,ly:side-position-interface::y-aligned-side)
1743         (meta . ((class . Item)
1744                  (interfaces . (font-interface
1745                                 script-interface
1746                                 side-position-interface))))))
1747
1748     (ScriptColumn
1749      . (
1750         (before-line-breaking . ,ly:script-column::before-line-breaking)
1751         (meta . ((class . Item)
1752                  (interfaces . (script-column-interface))))))
1753
1754     (ScriptRow
1755      . (
1756         (before-line-breaking . ,ly:script-column::row-before-line-breaking)
1757         (meta . ((class . Item)
1758                  (interfaces . (script-column-interface))))))
1759
1760     (Slur
1761      . (
1762         (avoid-slur . inside)
1763         (control-points . ,ly:slur::calc-control-points)
1764         (cross-staff . ,ly:slur::calc-cross-staff)
1765         (details . ,default-slur-details)
1766         (direction . ,ly:slur::calc-direction)
1767         (height-limit . 2.0)
1768         (line-thickness . 0.8)
1769         (minimum-length . 1.5)
1770         (ratio . 0.25)
1771         (spanner-id . "")
1772         (springs-and-rods . ,ly:spanner::set-spacing-rods)
1773         (stencil . ,ly:slur::print)
1774         (thickness . 1.2)
1775         (Y-extent . ,ly:slur::height)
1776         (meta . ((class . Spanner)
1777                  (interfaces . (slur-interface))))))
1778
1779     (SostenutoPedal
1780      . (
1781         (direction . ,RIGHT)
1782         (extra-spacing-width . (+inf.0 . -inf.0))
1783         (font-shape . italic)
1784         (padding . 0.0) ;; padding relative to SostenutoPedalLineSpanner
1785         (self-alignment-X . ,CENTER)
1786         (stencil . ,ly:text-interface::print)
1787         (X-offset . ,ly:self-alignment-interface::x-aligned-on-self)
1788         (meta . ((class . Item)
1789                  (interfaces . (font-interface
1790                                 piano-pedal-script-interface
1791                                 self-alignment-interface
1792                                 text-interface))))))
1793
1794     (SostenutoPedalLineSpanner
1795      . (
1796         (axes . (,Y))
1797         (direction . ,DOWN)
1798         (minimum-space . 1.0)
1799         (outside-staff-priority . 1000)
1800         (padding . 1.2)
1801         (side-axis . ,Y)
1802         (staff-padding . 1.0)
1803         (X-extent . ,ly:axis-group-interface::width)
1804         (Y-extent . ,ly:axis-group-interface::height)
1805         (Y-offset . ,ly:side-position-interface::y-aligned-side)
1806         (meta . ((class . Spanner)
1807                  (object-callbacks . ((pure-Y-common . ,ly:axis-group-interface::calc-pure-y-common)
1808                                       (pure-relevant-grobs . ,ly:axis-group-interface::calc-pure-relevant-grobs)))
1809                  (interfaces . (axis-group-interface
1810                                 piano-pedal-interface
1811                                 side-position-interface))))))
1812
1813     (SpacingSpanner
1814      . (
1815         (average-spacing-wishes . #t)
1816         (base-shortest-duration . ,(ly:make-moment 3 16))
1817         (common-shortest-duration . ,ly:spacing-spanner::calc-common-shortest-duration)
1818         (shortest-duration-space . 2.0)
1819         (spacing-increment . 1.2)
1820         (springs-and-rods . ,ly:spacing-spanner::set-springs)
1821         (meta . ((class . Spanner)
1822                  (interfaces . (spacing-options-interface
1823                                 spacing-spanner-interface))))))
1824
1825     (SpanBar
1826      . (
1827         (allow-span-bar . #t)
1828         (bar-extent . ,ly:axis-group-interface::height)
1829         (before-line-breaking . ,ly:span-bar::before-line-breaking)
1830         (break-align-symbol . staff-bar)
1831         (cross-staff . #t)
1832         (glyph-name . ,ly:span-bar::calc-glyph-name)
1833
1834         ;; ugh duplication! (these 4 properties were copied from Barline)
1835         ;;
1836         ;; Ross. page 151 lists other values, we opt for a leaner look
1837         ;;
1838         (kern . 3.0)
1839         (thin-kern . 3.0)
1840         (hair-thickness . 1.6)
1841         (thick-thickness . 6.0)
1842
1843         (layer . 0)
1844         (non-musical . #t)
1845         (stencil . ,ly:span-bar::print)
1846         (X-extent . ,ly:span-bar::width)
1847         (Y-extent . ,ly:axis-group-interface::height)
1848         (meta . ((class . Item)
1849                  (object-callbacks . ((pure-Y-common . ,ly:axis-group-interface::calc-pure-y-common)
1850                                       (pure-relevant-grobs . ,ly:axis-group-interface::calc-pure-relevant-grobs)))
1851                  (interfaces . (bar-line-interface
1852                                 font-interface
1853                                 span-bar-interface))))))
1854
1855     (StaffGrouper
1856      . (
1857         (staff-staff-spacing . ((basic-distance . 9)
1858                                 (minimum-distance . 7)
1859                                 (padding . 1)
1860                                 (stretchability . 5)))
1861         (staffgroup-staff-spacing . ((basic-distance . 10.5)
1862                                      (minimum-distance . 8)
1863                                      (padding . 1)
1864                                      (stretchability . 9)))
1865         (meta . ((class . Spanner)
1866                  (interfaces . (staff-grouper-interface))))))
1867
1868     (StaffSpacing
1869      . (
1870         (non-musical . #t)
1871         (stem-spacing-correction . 0.4)
1872         (meta . ((class . Item)
1873                  (interfaces . (spacing-interface
1874                                 staff-spacing-interface))))))
1875
1876     (StaffSymbol
1877      . (
1878         (layer . 0)
1879         (ledger-line-thickness . (1.0 . 0.1))
1880         (line-count . 5)
1881         (stencil . ,ly:staff-symbol::print)
1882         (Y-extent . ,ly:staff-symbol::height)
1883         (meta . ((class . Spanner)
1884                  (interfaces . (staff-symbol-interface))))))
1885
1886     (StanzaNumber
1887      . (
1888         (direction . ,LEFT)
1889         (font-series . bold)
1890         (padding . 1.0)
1891         (side-axis . ,X)
1892         (stencil . ,ly:text-interface::print)
1893         (X-offset . ,ly:side-position-interface::x-aligned-side)
1894         (meta . ((class . Item)
1895                  (interfaces . (font-interface
1896                                 side-position-interface
1897                                 stanza-number-interface
1898                                 text-interface))))))
1899
1900     (Stem
1901      . (
1902         (beamlet-default-length . (1.1 . 1.1))
1903         (beamlet-max-length-proportion . (0.75 . 0.75))
1904         (cross-staff . ,ly:stem::calc-cross-staff)
1905         (default-direction . ,ly:stem::calc-default-direction)
1906         (details
1907          . (
1908             ;; 3.5 (or 3 measured from note head) is standard length
1909             ;; 32nd, 64th, 128th flagged stems should be longer
1910             (lengths . (3.5 3.5 3.5 4.25 5.0 6.0))
1911
1912             ;; FIXME.  3.5 yields too long beams (according to Ross and
1913             ;; looking at Baerenreiter examples) for a number of common
1914             ;; boundary cases.  Subtracting half a beam thickness fixes
1915             ;; this, but the bug may well be somewhere else.
1916
1917             ;; FIXME this should come from 'lengths
1918             (beamed-lengths . (3.26 3.5 3.6))
1919
1920             ;; The 'normal' minima
1921             (beamed-minimum-free-lengths . (1.83 1.5 1.25))
1922                                         ;(beamed-minimum-free-lengths . (2.0 1.83 1.25))
1923
1924             ;; The 'extreme case' minima
1925             (beamed-extreme-minimum-free-lengths . (2.0 1.25))
1926
1927             ;; Stems in unnatural (forced) direction should be shortened by
1928             ;; one staff space, according to [Roush & Gourlay].
1929             ;; Flagged stems we shorten only half a staff space.
1930             (stem-shorten . (1.0 0.5))
1931
1932             ))
1933
1934         ;; We use the normal minima as minimum for the ideal lengths,
1935         ;; and the extreme minima as abolute minimum length.
1936
1937         (direction . ,ly:stem::calc-direction)
1938         (duration-log . ,stem::calc-duration-log)
1939         (flag . ,ly:stem::calc-flag)
1940         (length . ,ly:stem::calc-length)
1941         (neutral-direction . ,DOWN)
1942         (positioning-done . ,ly:stem::calc-positioning-done)
1943         (stem-begin-position . ,ly:stem::calc-stem-begin-position)
1944         (stem-end-position . ,ly:stem::calc-stem-end-position)
1945         (stem-info . ,ly:stem::calc-stem-info)
1946         (stencil . ,ly:stem::print)
1947         (thickness . 1.3)
1948         (X-extent . ,ly:stem::width)
1949         (X-offset . ,ly:stem::offset-callback)
1950         (Y-extent . ,ly:stem::height)
1951         (Y-offset . ,ly:staff-symbol-referencer::callback)
1952         (meta . ((class . Item)
1953                  (interfaces . (font-interface
1954                                 stem-interface))))))
1955
1956     (StemTremolo
1957      . (
1958         (beam-thickness . 0.48) ; staff-space
1959         (beam-width . ,ly:stem-tremolo::calc-width) ; staff-space
1960         (slope . ,ly:stem-tremolo::calc-slope)
1961         (stencil . ,ly:stem-tremolo::print)
1962         (style . ,ly:stem-tremolo::calc-style)
1963         (X-extent . ,ly:stem-tremolo::width)
1964         (meta . ((class . Item)
1965                  (interfaces . (stem-tremolo-interface))))))
1966
1967     (StringNumber
1968      . (
1969         (avoid-slur . around)
1970         (font-encoding . fetaText)
1971         (font-size . -5)                ; don't overlap when next to heads.
1972         (padding . 0.5)
1973         (script-priority . 100)
1974         (self-alignment-X . ,CENTER)
1975         (self-alignment-Y . ,CENTER)
1976         (staff-padding . 0.5)
1977         (stencil . ,print-circled-text-callback)
1978         (text . ,string-number::calc-text)
1979         (meta . ((class . Item)
1980                  (interfaces . (font-interface
1981                                 self-alignment-interface
1982                                 side-position-interface
1983                                 string-number-interface
1984                                 text-interface
1985                                 text-script-interface))))))
1986
1987     (StrokeFinger
1988      . (
1989         (digit-names . #("p" "i" "m" "a" "x"))
1990         (font-shape . italic)
1991         (font-size . -4)                ; don't overlap when next to heads.
1992         (padding . 0.5)
1993         (script-priority . 100)
1994         (self-alignment-X . ,CENTER)
1995         (self-alignment-Y . ,CENTER)
1996         (staff-padding . 0.5)
1997         (stencil . ,ly:text-interface::print)
1998         (text . ,stroke-finger::calc-text)
1999         (meta . ((class . Item)
2000                  (interfaces . (font-interface
2001                                 self-alignment-interface
2002                                 side-position-interface
2003                                 stroke-finger-interface
2004                                 text-interface
2005                                 text-script-interface))))))
2006
2007     (SustainPedal
2008      . (
2009         (direction . ,RIGHT)
2010         (extra-spacing-width . (+inf.0 . -inf.0))
2011         (padding . 0.0)  ;; padding relative to SustainPedalLineSpanner
2012         (self-alignment-X . ,CENTER)
2013         (stencil . ,ly:sustain-pedal::print)
2014         (X-offset . ,ly:self-alignment-interface::x-aligned-on-self)
2015         (meta . ((class . Item)
2016                  (interfaces . (font-interface
2017                                 piano-pedal-interface
2018                                 piano-pedal-script-interface
2019                                 self-alignment-interface
2020                                 text-interface))))))
2021
2022     (SustainPedalLineSpanner
2023      . (
2024         (axes . (,Y))
2025         (direction . ,DOWN)
2026         (minimum-space . 1.0)
2027         (outside-staff-priority . 1000)
2028         (padding . 1.2)
2029         (side-axis . ,Y)
2030         (staff-padding . 1.2)
2031         (X-extent . ,ly:axis-group-interface::width)
2032         (Y-extent . ,ly:axis-group-interface::height)
2033         (Y-offset . ,ly:side-position-interface::y-aligned-side)
2034         (meta . ((class . Spanner)
2035                  (object-callbacks . ((pure-Y-common . ,ly:axis-group-interface::calc-pure-y-common)
2036                                       (pure-relevant-grobs . ,ly:axis-group-interface::calc-pure-relevant-grobs)))
2037                  (interfaces . (axis-group-interface
2038                                 piano-pedal-interface
2039                                 side-position-interface))))))
2040
2041     (System
2042      . (
2043         (adjacent-pure-heights . ,ly:axis-group-interface::adjacent-pure-heights)
2044         (axes . (,X ,Y))
2045         (skyline-horizontal-padding . 0.5)
2046         (vertical-skylines . ,ly:axis-group-interface::calc-skylines)
2047         (X-extent . ,ly:axis-group-interface::width)
2048         (Y-extent . ,ly:system::height)
2049         (meta . ((class . System)
2050                  (object-callbacks . ((pure-relevant-grobs . ,ly:system::calc-pure-relevant-grobs)
2051                                       (pure-Y-common . ,ly:axis-group-interface::calc-pure-y-common)))
2052                  (interfaces . (axis-group-interface
2053                                 system-interface))))))
2054
2055     (SystemStartBar
2056      . (
2057         (collapse-height . 5.0)
2058         (direction . ,LEFT)
2059
2060         ;; ugh--hardcoded.
2061         (padding . -0.1)  ;; bar must cover rounded ending of staff line.
2062         (stencil . ,ly:system-start-delimiter::print)
2063         (style . bar-line)
2064         (thickness . 1.6)
2065         (X-offset . ,ly:side-position-interface::x-aligned-side)
2066         (Y-extent . #f)
2067         (meta . ((class . Spanner)
2068                  (interfaces . (side-position-interface
2069                                 system-start-delimiter-interface))))))
2070
2071     (SystemStartBrace
2072      . (
2073         (collapse-height . 5.0)
2074         (direction . ,LEFT)
2075         (font-encoding . fetaBraces)
2076         (padding . 0.3)
2077         (stencil . ,ly:system-start-delimiter::print)
2078         (style . brace)
2079         (X-offset . ,ly:side-position-interface::x-aligned-side)
2080         (Y-extent . #f)
2081         (meta . ((class . Spanner)
2082                  (interfaces . (font-interface
2083                                 side-position-interface
2084                                 system-start-delimiter-interface))))))
2085
2086     (SystemStartBracket
2087      . (
2088         (collapse-height . 5.0)
2089         (direction . ,LEFT)
2090         (padding . 0.8)
2091         (stencil . ,ly:system-start-delimiter::print)
2092         (style . bracket)
2093         (thickness . 0.45)
2094         (X-offset . ,ly:side-position-interface::x-aligned-side)
2095         (Y-extent . #f)
2096         (meta . ((class . Spanner)
2097                  (interfaces . (font-interface
2098                                 side-position-interface
2099                                 system-start-delimiter-interface))))))
2100
2101     (SystemStartSquare
2102      . (
2103         (direction . ,LEFT)
2104         (stencil . ,ly:system-start-delimiter::print)
2105         (style . line-bracket)
2106         (thickness . 1.0)
2107         (X-offset . ,ly:side-position-interface::x-aligned-side)
2108         (Y-extent . #f)
2109         (meta . ((class . Spanner)
2110                  (interfaces . (font-interface
2111                                 side-position-interface
2112                                 system-start-delimiter-interface))))))
2113
2114
2115     (TabNoteHead
2116      . (
2117         (details . ((cautionary-properties . ((angularity . 0.4)
2118                                               (half-thickness . 0.075)
2119                                               (padding . 0)
2120                                               (procedure . ,parenthesize-stencil)
2121                                               (width . 0.25)))
2122                     (head-offset . 3/5)
2123                     (harmonic-properties . ((angularity . 2)
2124                                             (half-thickness . 0.075)
2125                                             (padding . 0)
2126                                             (procedure . ,parenthesize-stencil)
2127                                             (width . 0.25)))
2128                     (repeat-tied-properties . ((note-head-visible . #t)
2129                                                (parenthesize . #t)))
2130                     (tied-properties . ((break-visibility . ,begin-of-line-visible)
2131                                         (parenthesize . #t)))))
2132
2133         (direction . ,CENTER)
2134         (duration-log . ,note-head::calc-duration-log)
2135         (font-series . bold)
2136         (font-size . -2)
2137         (stem-attachment . (0.0 . 1.35))
2138         (stencil . ,tab-note-head::print)
2139         (whiteout . #t)
2140         (X-offset . ,ly:self-alignment-interface::x-aligned-on-self)
2141         (Y-offset . ,ly:staff-symbol-referencer::callback)
2142         (meta . ((class . Item)
2143                  (interfaces  . (font-interface
2144                                  note-head-interface
2145                                  rhythmic-grob-interface
2146                                  rhythmic-head-interface
2147                                  staff-symbol-referencer-interface
2148                                  tab-note-head-interface
2149                                  text-interface))))))
2150
2151     (TextScript
2152      . (
2153         (avoid-slur . around)
2154         (cross-staff . ,ly:script-interface::calc-cross-staff)
2155         (direction . ,DOWN)
2156         (extra-spacing-width . (+inf.0 . -inf.0))
2157         (outside-staff-priority . 450)
2158
2159         ;; sync with Fingering ?
2160         (padding . 0.5)
2161
2162         (script-priority . 200)
2163         (side-axis . ,Y)
2164         (slur-padding . 0.5)
2165         (staff-padding . 0.5)
2166         (stencil . ,ly:text-interface::print)
2167         ;; todo: add X self alignment?
2168         (X-offset . ,ly:self-alignment-interface::x-aligned-on-self)
2169         (Y-offset . ,ly:side-position-interface::y-aligned-side)
2170         (meta . ((class . Item)
2171                  (interfaces . (font-interface
2172                                 instrument-specific-markup-interface
2173                                 self-alignment-interface
2174                                 side-position-interface
2175                                 text-interface
2176                                 text-script-interface))))))
2177
2178     (TextSpanner
2179      . (
2180         (bound-details . ((left . ((Y . 0)
2181                                    (padding . 0.25)
2182                                    (attach-dir . ,LEFT)
2183                                    ))
2184                           (left-broken . ((end-on-note . #t)))
2185                           (right . ((Y . 0)
2186                                     (padding . 0.25)
2187                                     ))
2188                           ))
2189         (dash-fraction . 0.2)
2190         (dash-period . 3.0)
2191         (direction . ,UP)
2192         (font-shape . italic)
2193         (left-bound-info . ,ly:line-spanner::calc-left-bound-info)
2194         (outside-staff-priority . 350)
2195         (right-bound-info . ,ly:line-spanner::calc-right-bound-info)
2196         (side-axis . ,Y)
2197         (staff-padding . 0.8)
2198         (stencil . ,ly:line-spanner::print)
2199         (style . dashed-line)
2200         (Y-offset . ,ly:side-position-interface::y-aligned-side)
2201
2202         (meta . ((class . Spanner)
2203                  (interfaces . (font-interface
2204                                 line-interface
2205                                 line-spanner-interface
2206                                 side-position-interface))))))
2207
2208     (Tie
2209      . (
2210         (avoid-slur . inside)
2211         (control-points . ,ly:tie::calc-control-points)
2212         (details . (
2213                     ;; for a full list, see tie-details.cc
2214                     (ratio . 0.333)
2215                     (center-staff-line-clearance . 0.6)
2216                     (tip-staff-line-clearance . 0.45)
2217                     (note-head-gap . 0.2)
2218                     (stem-gap . 0.35)
2219                     (height-limit . 1.0)
2220                     (horizontal-distance-penalty-factor . 10)
2221                     (same-dir-as-stem-penalty . 8)
2222                     (min-length-penalty-factor . 26)
2223                     (tie-tie-collision-distance . 0.45)
2224                     (tie-tie-collision-penalty . 25.0)
2225                     (intra-space-threshold . 1.25)
2226                     (outer-tie-vertical-distance-symmetry-penalty-factor . 10)
2227                     (outer-tie-length-symmetry-penalty-factor . 10)
2228                     (vertical-distance-penalty-factor . 7)
2229                     (outer-tie-vertical-gap . 0.25)
2230                     (multi-tie-region-size . 3)
2231                     (single-tie-region-size . 4)
2232                     (between-length-limit . 1.0)))
2233
2234         (direction . ,ly:tie::calc-direction)
2235         (font-size . -6)
2236         (line-thickness . 0.8)
2237         (neutral-direction . ,UP)
2238         (springs-and-rods . ,ly:spanner::set-spacing-rods)
2239         (stencil . ,ly:tie::print)
2240         (thickness . 1.2)
2241         (meta . ((class . Spanner)
2242                  (interfaces . (tie-interface))))))
2243
2244     (TieColumn
2245      . (
2246         (before-line-breaking . ,ly:tie-column::before-line-breaking)
2247         (positioning-done . ,ly:tie-column::calc-positioning-done)
2248         (X-extent . #f)
2249         (Y-extent . #f)
2250         (meta . ((class . Spanner)
2251                  (interfaces . (tie-column-interface))))))
2252
2253     (TimeSignature
2254      . (
2255         (avoid-slur . inside)
2256         (break-align-anchor
2257          . ,ly:break-aligned-interface::calc-extent-aligned-anchor)
2258         (break-align-symbol . time-signature)
2259         (break-align-anchor-alignment . ,LEFT)
2260         (break-visibility . ,all-visible)
2261         (extra-spacing-height . (-1.0 . 1.0))
2262         (non-musical . #t)
2263         (space-alist . (
2264                         (cue-clef . (extra-space . 1.5))
2265                         (first-note . (fixed-space . 2.0))
2266                         (right-edge . (extra-space . 0.5))
2267                         (staff-bar . (minimum-space . 2.0))))
2268         (stencil . ,ly:time-signature::print)
2269         (style . C)
2270         (meta . ((class . Item)
2271                  (interfaces . (break-aligned-interface
2272                                 font-interface
2273                                 time-signature-interface))))))
2274
2275     (TrillPitchAccidental
2276      . (
2277         (direction . ,LEFT)
2278         (font-size . -4)
2279         (glyph-name-alist . ,standard-alteration-glyph-name-alist)
2280         (padding . 0.2)
2281         (side-axis . ,X)
2282         (stencil . ,ly:accidental-interface::print)
2283         (X-offset . ,ly:side-position-interface::x-aligned-side)
2284         (Y-extent . ,ly:accidental-interface::height)
2285         (meta . ((class . Item)
2286                  (interfaces . (accidental-interface
2287                                 font-interface
2288                                 inline-accidental-interface
2289                                 side-position-interface
2290                                 trill-pitch-accidental-interface))))))
2291
2292     (TrillPitchGroup
2293      . (
2294         (axes . (,X))
2295         (direction . ,RIGHT)
2296         (font-size . -4)
2297         (padding . 0.3)
2298         (side-axis . ,X)
2299         (stencil . ,parenthesize-elements)
2300         (stencils . ,parentheses-item::calc-parenthesis-stencils)
2301         (X-offset . ,ly:side-position-interface::x-aligned-side)
2302         (meta . ((class . Item)
2303                  (interfaces . (axis-group-interface
2304                                 font-interface
2305                                 note-head-interface
2306                                 parentheses-interface
2307                                 side-position-interface))))))
2308
2309     (TrillPitchHead
2310      . (
2311         (duration-log . 2)
2312         (font-size . -4)
2313         (stencil . ,ly:note-head::print)
2314         (Y-offset . ,ly:staff-symbol-referencer::callback)
2315         (meta . ((class . Item)
2316                  (interfaces . (font-interface
2317                                 ledgered-interface
2318                                 pitched-trill-interface
2319                                 rhythmic-head-interface
2320                                 staff-symbol-referencer-interface))))))
2321
2322     (TrillSpanner
2323      . (
2324         (after-line-breaking . ,ly:spanner::kill-zero-spanned-time)
2325         (bound-details . ((left . ((text . ,(make-musicglyph-markup "scripts.trill"))
2326                                    (Y . 0)
2327                                    (stencil-offset . (-0.5 . -1))
2328                                    (padding . 0.5)
2329                                    (attach-dir . ,CENTER)
2330                                    ))
2331                           (left-broken . ((end-on-note . #t)))
2332                           (right . ((Y . 0)))
2333                           ))
2334         (direction . ,UP)
2335         (left-bound-info . ,ly:line-spanner::calc-left-bound-info)
2336         (outside-staff-priority . 50)
2337         (padding . 0.5)
2338         (right-bound-info . ,ly:line-spanner::calc-right-bound-info)
2339         (side-axis . ,Y)
2340         (staff-padding . 1.0)
2341         (stencil . ,ly:line-spanner::print)
2342         (style . trill)
2343         (Y-offset . ,ly:side-position-interface::y-aligned-side)
2344         (meta . ((class . Spanner)
2345                  (interfaces . (font-interface
2346                                 line-interface
2347                                 line-spanner-interface
2348                                 side-position-interface
2349                                 trill-spanner-interface))))))
2350
2351     (TupletBracket
2352      . (
2353         (connect-to-neighbor . ,ly:tuplet-bracket::calc-connect-to-neighbors)
2354         (control-points . ,ly:tuplet-bracket::calc-control-points)
2355         (cross-staff . ,ly:tuplet-bracket::calc-cross-staff)
2356         (direction  . ,ly:tuplet-bracket::calc-direction)
2357         (edge-height . (0.7 . 0.7))
2358         (full-length-to-extent . #t)
2359         (padding . 1.1)
2360         (positions . ,ly:tuplet-bracket::calc-positions)
2361         (shorten-pair . (-0.2 . -0.2))
2362         (staff-padding . 0.25)
2363         (stencil . ,ly:tuplet-bracket::print)
2364         (thickness . 1.6)
2365
2366         (meta . ((class . Spanner)
2367                  (interfaces . (line-interface
2368                                 tuplet-bracket-interface))))))
2369
2370     (TupletNumber
2371      . (
2372         (avoid-slur . inside)
2373         (cross-staff . ,ly:tuplet-number::calc-cross-staff)
2374         (direction . ,tuplet-number::calc-direction)
2375         (font-shape . italic)
2376         (font-size . -2)
2377         (stencil . ,ly:tuplet-number::print)
2378         (text . ,tuplet-number::calc-denominator-text)
2379         (meta . ((class . Spanner)
2380                  (interfaces . (font-interface
2381                                 text-interface
2382                                 tuplet-number-interface))))))
2383
2384
2385     (UnaCordaPedal
2386      . (
2387         (direction . ,RIGHT)
2388         (extra-spacing-width . (+inf.0 . -inf.0))
2389         (font-shape . italic)
2390         (padding . 0.0)  ;; padding relative to UnaCordaPedalLineSpanner
2391         (self-alignment-X . ,CENTER)
2392         (stencil . ,ly:text-interface::print)
2393         (X-offset . ,ly:self-alignment-interface::x-aligned-on-self)
2394         (meta . ((class . Item)
2395                  (interfaces . (font-interface
2396                                 piano-pedal-script-interface
2397                                 self-alignment-interface
2398                                 text-interface))))))
2399
2400     (UnaCordaPedalLineSpanner
2401      . (
2402         (axes . (,Y))
2403         (direction . ,DOWN)
2404         (minimum-space . 1.0)
2405         (outside-staff-priority . 1000)
2406         (padding . 1.2)
2407         (side-axis . ,Y)
2408         (staff-padding . 1.2)
2409         (X-extent . ,ly:axis-group-interface::width)
2410         (Y-extent . ,ly:axis-group-interface::height)
2411         (Y-offset . ,ly:side-position-interface::y-aligned-side)
2412         (meta . ((class . Spanner)
2413                  (object-callbacks . ((pure-Y-common . ,ly:axis-group-interface::calc-pure-y-common)
2414                                       (pure-relevant-grobs . ,ly:axis-group-interface::calc-pure-relevant-grobs)))
2415                  (interfaces . (axis-group-interface
2416                                 piano-pedal-interface
2417                                 side-position-interface))))))
2418
2419
2420     (VaticanaLigature
2421      . (
2422         (flexa-width . 2.0)
2423         (stencil . ,ly:vaticana-ligature::print)
2424         (thickness . 0.6)
2425         (meta . ((class . Spanner)
2426                  (interfaces . (font-interface
2427                                 vaticana-ligature-interface))))))
2428
2429     (VerticalAlignment
2430      . (
2431         (axes . (,Y))
2432         (positioning-done . ,ly:align-interface::align-to-ideal-distances)
2433         (stacking-dir . -1)
2434         (vertical-skylines . ,ly:axis-group-interface::combine-skylines)
2435         (X-extent . ,ly:axis-group-interface::width)
2436         (Y-extent . ,ly:axis-group-interface::height)
2437         (meta . ((class . Spanner)
2438                  (object-callbacks . ((Y-common . ,ly:axis-group-interface::calc-y-common)
2439                                       (pure-relevant-grobs . ,ly:axis-group-interface::calc-pure-relevant-grobs)
2440                                       (pure-Y-common . ,ly:axis-group-interface::calc-pure-y-common)))
2441                  (interfaces . (align-interface
2442                                 axis-group-interface))))))
2443
2444     (VerticalAxisGroup
2445      . (
2446         (adjacent-pure-heights . ,ly:axis-group-interface::adjacent-pure-heights)
2447         (axes . (,Y))
2448         (default-staff-staff-spacing . ((basic-distance . 9)
2449                                         (minimum-distance . 8)
2450                                         (padding . 1)))
2451         (nonstaff-unrelatedstaff-spacing . ((padding . 0.5)))
2452         (staff-staff-spacing . ,ly:axis-group-interface::calc-staff-staff-spacing)
2453         (stencil . ,ly:axis-group-interface::print)
2454         (vertical-skylines . ,ly:hara-kiri-group-spanner::calc-skylines)
2455         (X-extent . ,ly:axis-group-interface::width)
2456         (Y-extent . ,ly:hara-kiri-group-spanner::y-extent)
2457         (Y-offset . ,ly:hara-kiri-group-spanner::force-hara-kiri-callback)
2458         (meta . ((class . Spanner)
2459                  (object-callbacks . (
2460                                       (X-common . ,ly:axis-group-interface::calc-x-common)
2461                                       (pure-Y-common . ,ly:axis-group-interface::calc-pure-y-common)
2462                                       (pure-relevant-grobs . ,ly:axis-group-interface::calc-pure-relevant-grobs)))
2463
2464                  (interfaces . (axis-group-interface
2465                                 hara-kiri-group-spanner-interface))))))
2466
2467     (VoiceFollower
2468      . (
2469         (after-line-breaking . ,ly:spanner::kill-zero-spanned-time)
2470         (bound-details . ((right . ((attach-dir .  ,CENTER)
2471                                     (padding . 1.5)
2472                                       ))
2473                           (left . ((attach-dir .  ,CENTER)
2474                                    (padding . 1.5)
2475                                       ))
2476                           ))
2477         (gap . 0.5)
2478         (left-bound-info . ,ly:line-spanner::calc-left-bound-info)
2479         (non-musical . #t)
2480         (right-bound-info . ,ly:line-spanner::calc-right-bound-info)
2481         (stencil . ,ly:line-spanner::print)
2482         (style . line)
2483         (X-extent . #f)
2484         (Y-extent . #f)
2485         (meta . ((class . Spanner)
2486                  (interfaces . (line-interface
2487                                 line-spanner-interface))))))
2488
2489     (VoltaBracket
2490      . (
2491         (direction . ,UP)
2492         (edge-height . (2.0 . 2.0)) ;; staff-space;
2493         (font-encoding . fetaText)
2494         (font-size . -4)
2495         (stencil . ,ly:volta-bracket-interface::print)
2496         (thickness . 1.6) ;; line-thickness
2497         (word-space . 0.6)
2498         (meta . ((class . Spanner)
2499                  (interfaces . (font-interface
2500                                 horizontal-bracket-interface
2501                                 line-interface
2502                                 side-position-interface
2503                                 text-interface
2504                                 volta-bracket-interface
2505                                 volta-interface))))))
2506
2507     (VoltaBracketSpanner
2508      . (
2509         (after-line-breaking . ,ly:side-position-interface::move-to-extremal-staff)
2510         (axes . (,Y))
2511         (direction . ,UP)
2512         (no-alignment . #t)
2513         (outside-staff-priority . 600)
2514         (padding . 1)
2515         (side-axis . ,Y)
2516         (X-extent . ,ly:axis-group-interface::width)
2517         (Y-extent . ,ly:axis-group-interface::height)
2518         (Y-offset . ,ly:side-position-interface::y-aligned-side)
2519         (meta . ((class . Spanner)
2520                  (object-callbacks . ((pure-Y-common . ,ly:axis-group-interface::calc-pure-y-common)
2521                                       (pure-relevant-grobs . ,ly:axis-group-interface::calc-pure-relevant-grobs)))
2522                  (interfaces . (axis-group-interface
2523                                 side-position-interface
2524                                 volta-interface))))))
2525
2526 ))
2527
2528 (define (completize-grob-entry x)
2529   "Transplant assoc key into 'name entry of 'meta of X.  Set interfaces for Item, Spanner etc.
2530 "
2531   ;;  (display (car x))
2532   ;;  (newline)
2533   (let* ((name-sym  (car x))
2534          (grob-entry (cdr x))
2535          (meta-entry (assoc-get 'meta grob-entry))
2536          (class (assoc-get 'class meta-entry))
2537          (ifaces-entry
2538           (assoc-get 'interfaces meta-entry)))
2539
2540     (cond
2541      ((eq? 'Item class)
2542       (set! ifaces-entry (cons 'item-interface ifaces-entry)))
2543      ((eq? 'Spanner class)
2544       (set! ifaces-entry (cons 'spanner-interface ifaces-entry)))
2545      ((eq? 'Paper_column class)
2546       (set! ifaces-entry (cons 'item-interface
2547                                (cons 'paper-column-interface ifaces-entry))))
2548      ((eq? 'System class)
2549       (set! ifaces-entry (cons 'system-interface
2550                                (cons 'spanner-interface ifaces-entry))))
2551      (else
2552       (ly:warning "Unknown class ~a" class)))
2553
2554     (set! ifaces-entry (uniq-list (sort ifaces-entry symbol<?)))
2555     (set! ifaces-entry (cons 'grob-interface ifaces-entry))
2556
2557     (set! meta-entry (assoc-set! meta-entry 'name name-sym))
2558     (set! meta-entry (assoc-set! meta-entry 'interfaces
2559                                  ifaces-entry))
2560     (set! grob-entry (assoc-set! grob-entry 'meta meta-entry))
2561     (cons name-sym grob-entry)))
2562
2563 (set! all-grob-descriptions (map completize-grob-entry all-grob-descriptions))
2564
2565 ;;  (display (map pair? all-grob-descriptions))
2566
2567 ;; make sure that \property Foo.Bar =\turnOff doesn't complain
2568
2569 (map (lambda (x)
2570        ;; (display (car x)) (newline)
2571
2572        (set-object-property! (car x) 'translation-type? list?)
2573        (set-object-property! (car x) 'is-grob? #t))
2574      all-grob-descriptions)
2575
2576 (set! all-grob-descriptions (sort all-grob-descriptions alist<?))
2577
2578 (define (volta-bracket-interface::pure-height grob start end)
2579   (let ((edge-height (ly:grob-property grob 'edge-height)))
2580     (if (number-pair? edge-height)
2581         (let ((smaller (min (car edge-height) (cdr edge-height)))
2582               (larger (max (car edge-height) (cdr edge-height))))
2583           (interval-union '(0 . 0) (cons smaller larger)))
2584         '(0 . 0))))
2585
2586 (define pure-print-callbacks
2587   (list
2588    fret-board::calc-stencil
2589    note-head::brew-ez-stencil
2590    print-circled-text-callback
2591    laissez-vibrer::print
2592    lyric-text::print
2593    ly:bar-line::print
2594    ly:mensural-ligature::brew-ligature-primitive
2595    ly:note-head::print
2596    ly:dots::print
2597    ly:clef::print
2598    ly:key-signature-interface::print
2599    ly:percent-repeat-item-interface::beat-slash
2600    ly:text-interface::print
2601    ly:script-interface::print
2602    ly:sustain-pedal::print))
2603
2604 ;; Sometimes we have grobs with (Y-extent . ,ly:grob::stencil-height)
2605 ;; and the print function is not pure, but there is a easy way to
2606 ;; figure out the Y-extent from the print function.
2607 (define pure-print-to-height-conversions
2608   `(
2609     (,ly:arpeggio::print . ,ly:arpeggio::pure-height)
2610     (,ly:arpeggio::brew-chord-bracket . ,ly:arpeggio::pure-height)
2611     (,ly:arpeggio::brew-chord-brace . ,ly:arpeggio::pure-height)
2612     (,ly:arpeggio::brew-chord-slur . ,ly:arpeggio::pure-height)
2613     (,ly:hairpin::print . ,ly:hairpin::pure-height)
2614     (,ly:stem-tremolo::print . ,ly:stem-tremolo::pure-height)
2615     (,ly:volta-bracket-interface::print . ,volta-bracket-interface::pure-height)))
2616
2617 ;; ly:grob::stencil-extent is safe if the print callback is safe too
2618 (define (pure-stencil-height grob start stop)
2619   (let* ((sten (ly:grob-property-data grob 'stencil))
2620          (pure-height-callback (assoc-get sten pure-print-to-height-conversions)))
2621     (cond ((or
2622             (ly:stencil? sten)
2623             (memq sten pure-print-callbacks))
2624            (ly:grob::stencil-height grob))
2625           ((procedure? pure-height-callback)
2626            (pure-height-callback grob start stop))
2627           (else
2628            '(0 . 0)))))
2629
2630 ;; Sometimes, a pure callback will be chained to a non-pure callback via
2631 ;; chain_offset_callback, in which case this provides a default by simply
2632 ;; passing through the value from the pure callback.
2633 (define (pure-chain-offset-callback grob start end prev-offset) prev-offset)
2634
2635 (define pure-conversions-alist
2636   `(
2637     (,ly:accidental-interface::height . ,ly:accidental-interface::pure-height)
2638     (,ly:axis-group-interface::calc-staff-staff-spacing . ,ly:axis-group-interface::calc-pure-staff-staff-spacing)
2639     (,ly:axis-group-interface::height . ,ly:axis-group-interface::pure-height)
2640     (,ly:grob::stencil-height . ,pure-stencil-height)
2641     (,ly:hara-kiri-group-spanner::y-extent . ,ly:hara-kiri-group-spanner::pure-height)
2642     (,ly:rest-collision::force-shift-callback-rest . ,pure-chain-offset-callback)
2643     (,ly:rest::height . ,ly:rest::pure-height)
2644     (,ly:self-alignment-interface::y-aligned-on-self . ,ly:self-alignment-interface::pure-y-aligned-on-self)
2645     (,ly:side-position-interface::y-aligned-side . ,ly:side-position-interface::pure-y-aligned-side)
2646     (,ly:slur::height . ,ly:slur::pure-height)
2647     (,ly:slur::outside-slur-callback . ,ly:slur::pure-outside-slur-callback)
2648     (,ly:stem::height . ,ly:stem::pure-height)
2649     (,ly:system::height . ,ly:system::calc-pure-height)))
2650
2651 (define pure-functions
2652   (list
2653    parenthesize-elements
2654    laissez-vibrer::print
2655    ly:rest::y-offset-callback
2656    ly:staff-symbol-referencer::callback
2657    ly:staff-symbol::height))
2658
2659 (define-public (pure-relevant? grob)
2660   (let ((extent-callback (ly:grob-property-data grob 'Y-extent)))
2661     (not (eq? #f
2662               (or
2663                (pair? extent-callback)
2664                (memq extent-callback pure-functions)
2665                (and
2666                 (pair? (assq extent-callback pure-conversions-alist))
2667                 (let ((stencil (ly:grob-property-data grob 'stencil)))
2668                   (or
2669                    (not (eq? extent-callback ly:grob::stencil-height))
2670                    (memq stencil pure-print-callbacks)
2671                    (assq stencil pure-print-to-height-conversions)
2672                    (ly:stencil? stencil)))))))))
2673
2674 (define-public (call-pure-function unpure args start end)
2675   (if (ly:simple-closure? unpure)
2676       (ly:eval-simple-closure (car args) unpure start end)
2677       (if (not (procedure? unpure))
2678           unpure
2679           (if (memq unpure pure-functions)
2680               (apply unpure args)
2681               (let ((pure (assq unpure pure-conversions-alist)))
2682                 (if pure
2683                     (apply (cdr pure)
2684                            (append
2685                             (list (car args) start end)
2686                             (cdr args)))))))))