]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/define-grobs.scm
* ly/engraver-init.ly (AncientRemoveEmptyStaffContext): use length-fraction.
[lilypond.git] / scm / define-grobs.scm
index 46c531d868a727d10f4ff8ef126a20219d9c00a2..bf7384578905261c2963eb81e93eefa8ca245d70 100644 (file)
     (AmbitusNoteHead
      . (
        (duration-log . 2)
-       (callbacks . (  (stencil . ,Note_head::print)))
-       (glyph-name-procedure . ,find-notehead-symbol)
+       (callbacks . ((stencil . ,Note_head::print)
+                     (glyph-name . ,note-head::calc-glyph-name)
+                     ))
        (Y-offset-callbacks . (,Staff_symbol_referencer::callback))
        (meta . ((class . Item)
                 (interfaces . (font-interface
      . (
        (break-align-symbol . staff-bar)
        (glyph . "|")
-       (break-glyph-function . ,default-break-barline)
        (layer . 0)
-       (bar-size-procedure . ,Bar_line::get_staff_bar_size)
        (break-visibility . ,all-visible)
        (breakable . #t)
        (callbacks . ((stencil . ,Bar_line::print)
-                     (before-line-breaking . ,Bar_line::before_line_breaking)))
+                     (glyph-name . ,bar-line::calc-glyph-name)
+                     (bar-size .  ,Bar_line::calc_bar_size)
+                     ))
        (space-alist . (
                        (time-signature . (extra-space . 0.75))
                        (custos . (minimum-space . 2.0))
        ;; TODO: should be in SLT.
        (thickness . 0.48) ; in staff-space
        (neutral-direction . -1)
-       (dir-function . ,beam-dir-majority-median)
 
        ;; Whe have some unreferenced problems here.
        ;;
     (Clef
      . (
        (callbacks . ((stencil . ,Clef::print)
-                     (before-line-breaking . ,Clef::before_line_breaking)
+                     (glyph-name . ,Clef::calc_glyph_name)
                      ))
        (breakable . #t)
        (font-family . music)
 
     (ClusterSpanner
      . (
-       (callbacks . ((stencil . ,Cluster::print)))
-       (spacing-procedure . ,Spanner::set_spacing_rods)
+       (callbacks . ((springs-and-rods . ,Spanner::set_spacing_rods)
+                     (stencil . ,Cluster::print)))
+       
        (minimum-length . 0.0)
        (padding . 0.25)
        (style . ramp)
 
     (ChordName
      . (
-       (callbacks . ((stencil . ,Text_interface::print)))
-       (callbacks . ((after-line-breaking . ,Chord_name::after_line_breaking)
+       (callbacks . ((stencil . ,Text_interface::print)
+                     (after-line-breaking . ,Chord_name::after_line_breaking)
                      ))
        (word-space . 0.0)
        (font-family . sans)
        
        ;; todo.
        (callbacks . ((stencil . ,Text_interface::print)
-                     (before-line-breaking . ,Script_interface::before_line_breaking)))
+                     (direction . ,Script_interface::calc_direction)))
        (X-offset-callbacks . (,Self_alignment_interface::aligned_on_self))
        (self-alignment-X . 0)
        (Y-offset-callbacks . (,Self_alignment_interface::aligned_on_self))
        (self-alignment-Y . 0)
        (script-priority . 100)
        (callbacks . ((stencil . ,Text_interface::print)
-                     (before-line-breaking . ,Script_interface::before_line_breaking)))
+                     (direction . ,Script_interface::calc_direction)))
        (font-encoding . fetaNumber)
        (font-size . -5)                ; don't overlap when next to heads.
        (meta . ((class . Item)
      . (
        
        (callbacks . ((stencil . ,Hairpin::print)
+                     (springs-and-rods . ,Spanner::set_spacing_rods)
                      (after-line-breaking . ,Hairpin::after_line_breaking)))
        (thickness . 1.0)
        (height . 0.6666)
-       (spacing-procedure . ,Spanner::set_spacing_rods)
        (minimum-length . 2.0)
        (bound-padding . 1.0)
        (self-alignment-Y . 0)
     
     (LedgerLineSpanner
      . (
-       (callbacks . ((stencil . ,Ledger_line_spanner::print)))
+       (callbacks . ((springs-and-rods . ,Ledger_line_spanner::set_spacing_rods)
+                     
+                     (stencil . ,Ledger_line_spanner::print)))
        (X-extent-callback . #f)
        (Y-extent-callback . #f)
        (minimum-length-fraction . 0.25)
        (length-fraction . 0.25)
-       (spacing-procedure . ,Ledger_line_spanner::set_spacing_rods)
        (layer . 0)
        (meta . ((class . Spanner)
                 (interfaces . (ledger-line-interface))))))
        (length . 0.66)
        (minimum-length . 0.3)
        (padding . 0.07)
-                                       ;       (spacing-procedure . ,Hyphen_spanner::set_spacing_rods)
+                                       ;       (springs-and-rods . ,Hyphen_spanner::set_spacing_rods)
        (callbacks . ((stencil . ,Hyphen_spanner::print)))
        (Y-extent . (0 . 0))
        (meta . ((class . Spanner)
 
     (MultiMeasureRestNumber
      . (
-       (callbacks . ((stencil . ,Text_interface::print)))
-       (spacing-procedure . ,Multi_measure_rest::set_spacing_rods)
+       (callbacks . ((springs-and-rods . ,Multi_measure_rest::set_spacing_rods)
+                     (stencil . ,Text_interface::print)))
        (X-offset-callbacks . (,Self_alignment_interface::aligned_on_self
                               ,Self_alignment_interface::centered_on_other_axis_parent))
        (Y-offset-callbacks . (,Side_position_interface::aligned_side))
 
     (NoteHead
      . (
-       (callbacks . ((stencil . ,Note_head::print)))
+       (callbacks . ((stencil . ,Note_head::print)
+                     (stem-attachment . ,Note_head::calc_stem_attachment)
+                     (glyph-name . ,note-head::calc-glyph-name) 
+                     ))
+
+       ;; WTF is this? 
        (ligature-primitive-callback . ,Note_head::print)
-       (glyph-name-procedure . ,find-notehead-symbol)
        (Y-offset-callbacks . (,Staff_symbol_referencer::callback))
        (X-offset-callbacks . (,Note_head::stem_x_shift))
-       (stem-attachment-function . ,note-head-style->attachment-coordinates)
        (meta . ((class . Item)
                 (interfaces . (rhythmic-grob-interface
                                rhythmic-head-interface
      . ((slur-details . ,default-slur-details)
        (callbacks . ((control-points . ,Slur::calc_control_points)
                      (direction . ,Slur::calc_direction)
+                     (springs-and-rods . ,Spanner::set_spacing_rods)
                      (stencil . ,Slur::print)                
                      ))
        
        (thickness . 1.1)
-       (spacing-procedure . ,Spanner::set_spacing_rods)
        (minimum-length . 1.5)
        (Y-extent-callback . ,Slur::height)
        (height-limit . 2.0)
 
     (PercentRepeat
      . (
-       (spacing-procedure . ,Multi_measure_rest::set_spacing_rods)
-       (callbacks . ((stencil . ,Multi_measure_rest::percent)))
+       (callbacks . ((springs-and-rods . ,Multi_measure_rest::set_spacing_rods)
+                     (stencil . ,Multi_measure_rest::percent)))
        (slope . 1.0)
        (thickness . 0.48)
        (font-encoding . fetaMusic)
        ;; (script-priority . 0) priorities for scripts, see script.scm
        (X-offset-callbacks . (,Self_alignment_interface::centered_on_parent))
        (callbacks . ((stencil . ,Script_interface::print)
-                     (before-line-breaking . ,Script_interface::before_line_breaking)))
+                     (direction . ,Script_interface::calc_direction)))
        (font-encoding . fetaMusic)
        (meta . ((class . Item)
                 (interfaces . (script-interface
 
     (SeparatingGroupSpanner
      . (
-       (spacing-procedure . ,Separating_group_spanner::set_spacing_rods)
+       (callbacks . ((springs-and-rods . ,Separating_group_spanner::set_spacing_rods)
+                     ))
        (meta . ((class . Spanner)
                 (interfaces . (only-prebreak-interface
                                spacing-interface
      . ((slur-details . ,default-slur-details)
        (callbacks . ((control-points . ,Slur::calc_control_points)
                      (direction . ,Slur::calc_direction)
+                     (springs-and-rods . ,Spanner::set_spacing_rods)
                      (stencil . ,Slur::print)
                      ))
        (thickness . 1.0)
-       (spacing-procedure . ,Spanner::set_spacing_rods)
        (minimum-length . 1.5)
        (Y-extent-callback . ,Slur::height)
                                        ; Slur::height)
 
     (SpacingSpanner
      . (
-       (spacing-procedure . ,Spacing_spanner::set_springs)
+       (callbacks . ((springs-and-rods . ,Spacing_spanner::set_springs)))
        (grace-space-factor . 0.6)
        (shortest-duration-space . 2.0)
        (spacing-increment . 1.2)
     (SpanBar
      . (
        (break-align-symbol . staff-bar)
-       (bar-size-procedure . ,Span_bar::get_bar_size)
        (X-extent-callback . ,Span_bar::width_callback)
        (Y-extent-callback . ())
        (layer . 0)
        (breakable . #t)
        (callbacks . ((stencil . ,Span_bar::print)
+                     (bar-size . ,Span_bar::calc_bar_size)
+                     (glyph-name . ,Span_bar::calc_glyph_name)
                      (before-line-breaking . ,Span_bar::before_line_breaking)))
        ;; ugh duplication!
 
                      (stem-info . ,Stem::calc_stem_info)
                      (positioning-done . ,Stem::calc_positioning_done)
                      (stencil . ,Stem::print)
+                     (length . ,Stem::calc_length)
                      ))
        (thickness . 1.3)
 
-       ;; 3.5 (or 3 measured from note head) is standard length
-       ;; 32nd, 64th flagged stems should be longer
-       (lengths . (3.5 3.5 3.5 4.5 5.0))
+       (details
+        . (
+           ;; 3.5 (or 3 measured from note head) is standard length
+           ;; 32nd, 64th flagged stems should be longer
+           (lengths . (3.5 3.5 3.5 4.5 5.0))
 
-       ;; Stems in unnatural (forced) direction should be shortened by
-       ;; one staff space, according to [Roush & Gourlay].
-       ;; Flagged stems we shorten only half a staff space.
-       (stem-shorten . (1.0 0.5))
+           ;; FIXME.  3.5 yields too long beams (according to Ross and
+           ;; looking at Baerenreiter examples) for a number of common
+           ;; boundary cases.  Subtracting half a beam thickness fixes
+           ;; this, but the bug may well be somewhere else.
 
-       ;; default stem direction for note on middle line
-       (neutral-direction . -1)
+           ;; FIXME this should come from 'lengths
+           (beamed-lengths . (3.26 3.5 3.6))
 
-       ;; FIXME.  3.5 yields too long beams (according to Ross and
-       ;; looking at Baerenreiter examples) for a number of common
-       ;; boundary cases.  Subtracting half a beam thickness fixes
-       ;; this, but the bug may well be somewhere else.
+           ;; The 'normal' minima
+           (beamed-minimum-free-lengths . (1.83 1.5 1.25))
+                                       ;(beamed-minimum-free-lengths . (2.0 1.83 1.25))
 
-       ;; FIXME this should come from 'lengths
+           ;; The 'extreme case' minima
+           (beamed-extreme-minimum-free-lengths . (2.0 1.25))
 
-       (beamed-lengths . (3.26 3.5 3.6))
+           ;; Stems in unnatural (forced) direction should be shortened by
+           ;; one staff space, according to [Roush & Gourlay].
+           ;; Flagged stems we shorten only half a staff space.
+           (stem-shorten . (1.0 0.5))
 
-       ;; We use the normal minima as minimum for the ideal lengths,
-       ;; and the extreme minima as abolute minimum length.
+           ))
+       
 
-       ;; The 'normal' minima
-       (beamed-minimum-free-lengths . (1.83 1.5 1.25))
-                                       ;(beamed-minimum-free-lengths . (2.0 1.83 1.25))
+       ;; default stem direction for note on middle line
+       (neutral-direction . -1)
 
-       ;; The 'extreme case' minima
-       (beamed-extreme-minimum-free-lengths . (2.0 1.25))
+       ;; We use the normal minima as minimum for the ideal lengths,
+       ;; and the extreme minima as abolute minimum length.
 
        (X-offset-callbacks . (,Stem::offset_callback))
        (X-extent-callback . ,Stem::width_callback)
        (glyph . "bar-line")
        (thickness . 1.6)
        (callbacks . ((stencil . ,System_start_delimiter::print)
-                     (after-line-breaking . ,System_start_delimiter::after_line_breaking)))
-       
+                     ))
        (meta . ((class . Spanner)
                 (interfaces . (system-start-delimiter-interface))))))
 
        (callbacks . ((stencil . ,Text_interface::print)))
        (Y-offset-callbacks . (,Staff_symbol_referencer::callback))
        (font-size . -2)
-       (stem-attachment-function . ,tablature-stem-attachment-function)
+       (stem-attachment . (1.0 . 1.35))
        (font-series . bold)
        (meta . ((class . Item)
                 (interfaces
        (padding . 0.5)
        (staff-padding . 0.5)
        (callbacks . ((stencil . ,Text_interface::print)
-                     (before-line-breaking . ,Script_interface::before_line_breaking)))
+                     (direction . ,Script_interface::calc_direction)))
        (avoid-slur . around)
        (slur-padding . 0.5)
        (script-priority . 200)