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