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