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