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