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