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