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