]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/define-grobs.scm
Build: Target version.itexi and weblinks.itexi (issue 3576).
[lilypond.git] / scm / define-grobs.scm
index df94769f5000876bded1847a978e967268573d87..5222034ae1c3febf0a40e221910d94e7affc1b7a 100644 (file)
@@ -25,7 +25,7 @@
 ;; TODO: junk the meta field in favor of something more compact?
 
 
-(define-public all-grob-descriptions
+(define-session-public all-grob-descriptions
   `(
     (Accidental
      . (
 
     (AmbitusLine
      . (
-        (gap . 0.35)
+        (gap . ,ambitus-line::calc-gap)
+        (length-fraction . 0.7)
+        (maximum-gap . 0.45)
         (stencil . ,ambitus::print)
         (thickness . 2)
         (X-offset . ,ly:self-alignment-interface::centered-on-x-parent)
 
     (Arpeggio
      . (
+       (cross-staff . ,ly:arpeggio::calc-cross-staff)
         (direction . ,LEFT)
         (padding . 0.5)
         (positions . ,ly:arpeggio::calc-positions)
         ;; only for debugging.
         (font-family . roman)
 
-        (beam-gap . ,ly:beam::calc-beam-gap)
-        (minimum-length . ,ly:beam::calc-minimum-length)
+        (gap . 0.8)
         (neutral-direction . ,DOWN)
         (positions . ,beam::place-broken-parts-individually)
-        (springs-and-rods . ,ly:beam::calc-springs-and-rods)
         (X-positions . ,ly:beam::calc-x-positions)
         (transparent . ,(grob::inherit-parent-property
                          X 'transparent))
         (color . ,(grob::inherit-parent-property
                    X 'color))
         (self-alignment-X . ,CENTER)
-        (staff-padding . 0.2)
+        (staff-padding . 0.7)
         (stencil . ,ly:text-interface::print)
         (X-offset . ,(ly:make-simple-closure
                       `(,+
         (direction . ,DOWN)
         (minimum-space . 1.2)
         (outside-staff-priority . 250)
-        (outside-staff-padding . 0.6)
         (padding . 0.6)
         (side-axis . ,Y)
         (slur-padding . 0.3)
         (positioning-done . ,ly:script-interface::calc-positioning-done)
         (right-padding . 0.5)
         (self-alignment-X . ,CENTER)
-        (self-alignment-Y . ,CENTER)
         (stencil . ,ly:text-interface::print)
         (vertical-skylines . ,grob::always-vertical-skylines-from-stencil)
         (Y-extent . ,grob::always-Y-extent-from-stencil)
         (X-offset . ,ly:self-alignment-interface::x-aligned-on-self)
-        (Y-offset . ,self-alignment-interface::y-aligned-on-self)
+        (Y-offset . ,(scale-by-font-size -0.6)) ; center on an 'm'
         (meta . ((class . Item)
                  (interfaces . (dynamic-interface
                                 dynamic-text-interface
      . (
         (glyph-name . ,ly:flag::glyph-name)
         (stencil . ,ly:flag::print)
+        (transparent . ,(grob::inherit-parent-property
+                         X 'transparent))
+        (color . ,(grob::inherit-parent-property
+                   X 'color))
         (X-extent . ,ly:flag::width)
         (X-offset . ,ly:flag::calc-x-offset)
         (Y-offset . ,(ly:make-unpure-pure-container ly:flag::calc-y-offset ly:flag::pure-calc-y-offset))
         (font-encoding . fetaText)
         (font-size . -2)
         (outside-staff-horizontal-padding . 0.5)
-        (outside-staff-padding . 0.5)
         (outside-staff-priority . 750)
         (self-alignment-X . ,CENTER)
         (side-axis . ,Y)
      . (
         (axes . (,X ,Y))
         (bound-alignment-interfaces . (rhythmic-head-interface stem-interface))
-        (cross-staff . ,ly:axis-group-interface::cross-staff)
         (horizontal-skylines . ,ly:separation-item::calc-skylines)
         (skyline-vertical-padding . 0.15)
         (X-extent . ,ly:axis-group-interface::width)
         (outside-staff-priority . 400)
         (padding . 0.5)
         (shorten-pair . (0.0 . -0.6))
-        (staff-padding . 1.0)
+        (staff-padding . 2.0)
         (stencil . ,ly:ottava-bracket::print)
         (style . dashed-line)
         (vertical-skylines . ,grob::unpure-vertical-skylines-from-stencil)
         (bound-alignment-interfaces . (note-column-interface))
         (horizontal-skylines . ,ly:separation-item::calc-skylines)
         (keep-inside-line . #t)
-                                        ; 0.08 comes from spacing-horizontal-skyline.ly
-                                        ; allows double flat of F to be nestled over dots of C
+        ;; 0.08 comes from spacing-horizontal-skyline.ly
+        ;; allows double flat of F to be nestled over dots of C
         (skyline-vertical-padding . 0.08)
         ;; (stencil . ,ly:paper-column::print)
         (X-extent . ,ly:axis-group-interface::width)
         (padding . 0.2)
         (stencil . ,parentheses-item::print)
         (stencils . ,parentheses-item::calc-parenthesis-stencils)
+        ;; X-extent needs to be non-empty in order to allow proper
+        ;; horizontal attachment.  ParenthesesItem does not reserve
+        ;; space of its own, however.
+        (X-extent . (0 . 0))
         (meta . ((class . Item)
                  (interfaces . (font-interface
                                 parentheses-interface))))))
         (extra-spacing-width . (+inf.0 . -inf.0))
         (font-size . 2)
         (non-musical . #t)
-        (outside-staff-horizontal-padding . 0.12)
+        (outside-staff-horizontal-padding . 0.2)
         (outside-staff-priority . 1500)
         (padding . 0.8)
         (self-alignment-X . ,CENTER)
     (SostenutoPedalLineSpanner
      . (
         (axes . (,Y))
-        (cross-staff . ,ly:side-position-interface::calc-cross-staff)
         (direction . ,DOWN)
         (minimum-space . 1.0)
         (outside-staff-priority . 1000)
         (X-extent . ,(grob::inherit-parent-property
                       X 'X-extent))
         (extra-spacing-height . ,pure-from-neighbor-interface::extra-spacing-height)
-                                        ; we want this to be ignored, so empty, but the extra spacing height
-                                        ; should preserve the span bar's presence for horizontal spacing
+        ;; we want this to be ignored, so empty, but the extra spacing height
+        ;; should preserve the span bar's presence for horizontal spacing
         (Y-extent . ,pure-from-neighbor-interface::height-if-pure)
         (meta . ((class . Item)
                  (object-callbacks . ((pure-Y-common . ,ly:axis-group-interface::calc-pure-y-common)
 
             ;; The 'normal' minima
             (beamed-minimum-free-lengths . (1.83 1.5 1.25))
-                                        ;(beamed-minimum-free-lengths . (2.0 1.83 1.25))
+            ;;(beamed-minimum-free-lengths . (2.0 1.83 1.25))
 
             ;; The 'extreme case' minima
             (beamed-extreme-minimum-free-lengths . (2.0 1.25))
     (SustainPedalLineSpanner
      . (
         (axes . (,Y))
-        (cross-staff . ,ly:side-position-interface::calc-cross-staff)
         (direction . ,DOWN)
         (minimum-space . 1.0)
         (outside-staff-priority . 1000)
         (collapse-height . 5.0)
         (direction . ,LEFT)
 
-        (cross-staff . #t)
         ;; ugh--hardcoded.
         (padding . -0.1)  ;; bar must cover rounded ending of staff line.
         (stencil . ,ly:system-start-delimiter::print)
         (style . bar-line)
         (thickness . 1.6)
         (X-offset . ,ly:side-position-interface::x-aligned-side)
-        (Y-extent . #f)
         (meta . ((class . Spanner)
                  (interfaces . (side-position-interface
                                 system-start-delimiter-interface))))))
         (collapse-height . 5.0)
         (direction . ,LEFT)
         (font-encoding . fetaBraces)
-        (cross-staff . #t)
         (padding . 0.3)
         (stencil . ,ly:system-start-delimiter::print)
         (style . brace)
         (X-offset . ,ly:side-position-interface::x-aligned-side)
-        (Y-extent . #f)
         (meta . ((class . Spanner)
                  (interfaces . (font-interface
                                 side-position-interface
      . (
         (collapse-height . 5.0)
         (direction . ,LEFT)
-        (cross-staff . #t)
         (padding . 0.8)
         (stencil . ,ly:system-start-delimiter::print)
         (style . bracket)
         (thickness . 0.45)
         (X-offset . ,ly:side-position-interface::x-aligned-side)
-        (Y-extent . #f)
         (meta . ((class . Spanner)
                  (interfaces . (font-interface
                                 side-position-interface
     (SystemStartSquare
      . (
         (direction . ,LEFT)
-        (cross-staff . #t)
         (stencil . ,ly:system-start-delimiter::print)
         (style . line-bracket)
         (thickness . 1.0)
         (X-offset . ,ly:side-position-interface::x-aligned-side)
-        (Y-extent . #f)
         (meta . ((class . Spanner)
                  (interfaces . (font-interface
                                 side-position-interface
         (cross-staff . ,script-or-side-position-cross-staff)
         (direction . ,DOWN)
         (extra-spacing-width . (+inf.0 . -inf.0))
-        (outside-staff-horizontal-padding . 0.12)
+        (outside-staff-horizontal-padding . 0.2)
         (outside-staff-priority . 450)
 
         ;; sync with Fingering ?
         (side-axis . ,X)
         (stencil . ,parenthesize-elements)
         (stencils . ,parentheses-item::calc-parenthesis-stencils)
-        (X-offset . ,ly:side-position-interface::x-aligned-side)
+        ;; offset a bit to the right, further if needed to clear the main note
+        (X-offset . ,(lambda (grob)
+                       (ly:side-position-interface::x-aligned-side grob 2.5)))
         (Y-extent . ,grob::always-Y-extent-from-stencil)
         (meta . ((class . Item)
                  (interfaces . (axis-group-interface
     (UnaCordaPedalLineSpanner
      . (
         (axes . (,Y))
-        (cross-staff . ,ly:side-position-interface::calc-cross-staff)
         (direction . ,DOWN)
         (minimum-space . 1.0)
         (outside-staff-priority . 1000)
 
 ;; make sure that \property Foo.Bar =\turnOff doesn't complain
 
-(map (lambda (x)
-       ;; (display (car x)) (newline)
+(for-each (lambda (x)
+            ;; (display (car x)) (newline)
 
-       (set-object-property! (car x) 'translation-type? list?)
-       (set-object-property! (car x) 'is-grob? #t))
-     all-grob-descriptions)
+            (set-object-property! (car x) 'translation-type? list?)
+            (set-object-property! (car x) 'is-grob? #t))
+          all-grob-descriptions)
 
 (set! all-grob-descriptions (sort all-grob-descriptions alist<?))