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