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