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