]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/define-grobs.scm
* scm/output-lib.scm (shift-right-at-line-begin): new function:
[lilypond.git] / scm / define-grobs.scm
index 530f0b1fff1be1df4ee3b915237635a2525c5a61..e1f168011f562814753bce2244e232b885cb48de 100644 (file)
@@ -28,7 +28,7 @@
 
        ;; this is quite small, but it is very ugly to have
        ;; accs closer to the previous note than to the next one.
-       (right-padding . 0.15)
+       (right-padding . 0.2)
        (meta . ((interfaces . (item-interface accidental-placement-interface))))
        ))
 
@@ -46,7 +46,7 @@
                       (key-signature . (extra-space . 0.0))
                       (staff-bar . (extra-space . 0.0))
                       (time-signature . (extra-space . 0.0)) 
-                      (first-note . (extra-space . 0.0))
+                      (first-note . (fixed-space . 0.0))
                       ))
        (meta . ((interfaces . (ambitus-interface staff-symbol-referencer-interface break-aligned-interface item-interface  font-interface))))
        ))
@@ -78,7 +78,8 @@
                        (custos . (minimum-space . 2.0))
                        (clef .   (minimum-space . 1.0))
                        (key-signature . (extra-space . 1.0))
-                       (first-note . (extra-space . 1.3))
+                       (first-note . (fixed-space . 1.3))
+                       (next-note . (semi-fixed-space . 1.3))
                        (right-edge . (extra-space . 0.0))
                        ))
 
        (padding . 1.0)
        (direction . 1)
        (font-family . roman)
-       (font-relative-size . -1)
+       (font-size . -2)
        (Y-offset-callbacks . (,Side_position_interface::aligned_side))
        (X-offset-callbacks . (,Self_alignment_interface::aligned_on_self))
        (self-alignment-X . 1)
        (Y-offset-callbacks . (,Self_alignment_interface::aligned_on_self))
        (direction . 1)
        (font-family . number)
-       (font-relative-size . -1)
+
+       ;; We must do this, other BFs in
+       ;; paper16 become too small.
+       (font-size . -4)
+       (font-magnification . 0.8) 
        (kern . 0.2)
        (meta . ((interfaces . (text-interface                                                  rhythmic-grob-interface
                                                                                                bass-figure-interface item-interface
        (molecule-callback . ,Beam::brew_molecule)
        (concaveness-gap . 2.0)
        (concaveness-threshold . 0.08)
-       
+       (gap . 0.8)
        (positions . (#f . #f))
        (position-callbacks . (,Beam::least_squares
                               ,Beam::check_concave
        (auto-knee-gap . 5.5)
 
        ;; only for debugging.
-;      (font-name . "cmr10")
+       (font-family . roman)
        
        (space-function . ,Beam::space_function)
        (meta . ((interfaces . (staff-symbol-referencer-interface beam-interface spanner-interface))))
                        (key-signature . (minimum-space . 1.5))
                        (staff-bar . (minimum-space . 1.5))
                        (clef . (minimum-space . 2.0))
-                       (first-note . (minimum-space . 1.0))
+                       (first-note . (fixed-space . 1.0)) ;huh? 
                        (right-edge . (extra-space . 0.1))
                        ))
        (molecule-callback . ,Text_item::brew_molecule)
        (font-family . music)      
        (break-align-symbol . clef)
        (break-visibility . ,begin-of-line-visible)
-       (space-alist . (
-                       (ambitus . (extra-space . 2.0))
-                       (staff-bar . (minimum-space .  3.7))
+       (space-alist . ((ambitus . (extra-space . 2.0))
+                       (staff-bar . (extra-space . 0.7))
                        (key-signature . (minimum-space . 4.0))
                        (time-signature . (minimum-space . 4.2))
-                       (first-note . (minimum-space . 5.0))
+                       (first-note . (minimum-fixed-space . 5.0))
                        (next-note . (extra-space . 0.5))
                        (right-edge . (extra-space . 0.5))
                        ))
 
     (ChordName
      . (
-       (molecule-callback . ,new-chord-name-brew-molecule)
+       (molecule-callback . ,Text_item::brew_molecule)
        (after-line-breaking-callback . ,Chord_name::after_line_breaking)
-       (word-space . 1.0)
-       (font-family . roman)
+       (word-space . 0.0)
+       (font-family . sans)
+       (font-size . 1.5)
        (meta . ((interfaces . (font-interface                                                  rhythmic-grob-interface
                                                                                                text-interface chord-name-interface item-interface ))))
        ))
        (adjust-if-on-staffline . #t)
        (Y-offset-callbacks . (,Staff_symbol_referencer::callback))
        (space-alist . (
-                       (first-note . (minimum-space . 0.0))
+                       (first-note . (minimum-fixed-space . 0.0))
                        (right-edge . (extra-space . 0.1))
                        ))
        (meta . ((interfaces
     (DotColumn
      . (
        (axes . (0))
-       (direction . 1)
+       (direction . ,RIGHT)
        (X-extent-callback . ,Axis_group_interface::group_extent_callback)
        (X-offset-callbacks . (,Dot_column::side_position))
        (meta . ((interfaces . (dot-column-interface axis-group-interface item-interface ))))
      . (
        (molecule-callback . ,Dots::brew_molecule)
        (dot-count . 1)
-       (Y-offset-callbacks  . (,Dots::quantised_position_callback ,Staff_symbol_referencer::callback))
        (meta . ((interfaces . (font-interface staff-symbol-referencer-interface dots-interface item-interface ))))
        ))
 
                        (staff-bar . (extra-space . 0.0))
                        (breathing-sign . (minimum-space  . 0.0))
                        (clef . (extra-space . 0.85))
-                       (first-note . (extra-space . 1.0))
+                       (first-note . (fixed-space . 1.0))
                        (right-edge . (extra-space . 0.0))
                        (key-signature . (extra-space . 0.0))
                        ))
      . (
        (molecule-callback . ,Text_item::brew_molecule)
        (padding . 0.6)
-       ;;              (direction . -1)
        (self-alignment-X . 0)
        (self-alignment-Y . 0)
        (script-priority . 100)
        (font-family . number)
-       (font-relative-size . -3)
+       (font-size . -4)
        (font-shape . upright)
        (meta . ((interfaces . (finger-interface font-interface text-script-interface text-interface side-position-interface self-alignment-interface item-interface ))))
        ))
 
 
-    (HaraKiriVerticalGroup
+    (RemoveEmptyVerticalGroup
      . (
        (Y-offset-callbacks . (,Hara_kiri_group_spanner::force_hara_kiri_callback))
        (Y-extent-callback . ,Hara_kiri_group_spanner::y_extent)
+       (remove-first . #t)
        (axes . (1))
        (meta . ((interfaces . (axis-group-interface hara-kiri-group-interface item-interface  spanner-interface))))
        ))
        (spacing-procedure . ,Spanner::set_spacing_rods)
        (minimum-length . 2.0)
        (if-text-padding . 1.0)
-       (width-correct . -1.0)
-
-       (dash-thickness . 1.2)
        (dash-length . 4.0)
        (self-alignment-Y . 0)
        (Y-offset-callbacks . (,Self_alignment_interface::aligned_on_self))
-       (meta . ((interfaces . (hairpin-interface self-alignment-interface dynamic-interface spanner-interface))))
+       (meta . ((interfaces . (hairpin-interface line-interface self-alignment-interface dynamic-interface spanner-interface))))
        ))
 
     (HorizontalBracket
                        (time-signature . (extra-space . 1.25))
                        (staff-bar .  (extra-space . 1.1))
                        (right-edge . (extra-space . 0.5))
-                       (first-note . (extra-space . 2.5))
+                       (first-note . (fixed-space . 2.5))
                        ))
        (Y-offset-callbacks . (,Staff_symbol_referencer::callback))
        (break-align-symbol . key-signature)
 
     (LyricHyphen
      . (
-       (thickness . 1.0)
-       (height . 0.4)
+       (thickness . 1.3)
+       (height . 0.42)
+       (dash-period . 10.0)
+       (length . 0.66)
        (minimum-length .  0.5) 
-       (maximum-length .  100)
-       (spacing-procedure . ,Hyphen_spanner::set_spacing_rods)
        (molecule-callback . ,Hyphen_spanner::brew_molecule)
        (Y-extent-callback . ,Grob::point_dimension_callback)
        (meta . ((interfaces . (lyric-hyphen-interface spanner-interface))))
     (LyricExtender
      . (
        (molecule-callback . ,Lyric_extender::brew_molecule)
-       (height . 0.8) ; stafflinethickness;
-       (right-trim-amount . 0.5)
+       (thickness . 0.8) ; stafflinethickness;
+       (minimum-length . 1.5)
        (Y-extent-callback . ,Grob::point_dimension_callback)
        (meta . ((interfaces . (lyric-extender-interface spanner-interface))))
        ))
 
     (LyricText
-     . (
-       (molecule-callback . ,Text_item::brew_molecule)
-       (X-offset-callbacks . (,Self_alignment_interface::centered_on_parent
-                              ,Self_alignment_interface::aligned_on_self))
+     . ((molecule-callback . ,Text_item::brew_molecule)
+       (X-offset-callbacks . (,Self_alignment_interface::aligned_on_parent))
        (self-alignment-X . 0)
        (word-space . 0.6)
-       (ignore-length-mismatch . #f)
-       (begin-alignment . 4)
-       (end-alignment . 2)
        (font-family . roman)
+       (font-series . bold-narrow)
        (font-shape . upright)
-       
+       (font-size . 1.0)
        (meta . ((interfaces . (rhythmic-grob-interface lyric-syllable-interface self-alignment-interface text-interface font-interface item-interface ))))
        ))
 
      . (
        (molecule-callback . ,Text_item::brew_molecule)
        (X-offset-callbacks . (,Self_alignment_interface::aligned_on_self))
-       (Y-offset-callbacks . (,Side_position_interface::aligned_side)) 
+       (Y-offset-callbacks . (,Side_position_interface::aligned_side))
+       (after-line-breaking-callback . ,shift-right-at-line-begin)
        (self-alignment-X . 0)
-       (break-align-symbol . time-signature)
        (direction . 1)
        (breakable . #t)
-       (font-relative-size . 1)
+       (font-size . 2)
        (font-family . roman)
        (baseline-skip . 2)
        (break-visibility . ,end-of-line-invisible)
        (Y-offset-callbacks . (,Side_position_interface::aligned_side))
        (self-alignment-X . 0)
        (direction . 1)
-       (padding . 2)
+       (padding . 1.3)
        (font-family . number)
        (meta . ((interfaces . (side-position-interface self-alignment-interface font-interface spanner-interface text-interface))))
        ))
        (Y-offset-callbacks . (,Side_position_interface::aligned_side))
        (self-alignment-X . 0)
        (direction . 1)
-       (padding . 2)
+       (padding . 1.5)
        (font-family . roman)
        (meta . ((interfaces . (side-position-interface self-alignment-interface font-interface spanner-interface text-interface))))
        ))
        (molecule-callback . ,Note_head::brew_molecule)
        (ligature-primitive-callback . ,Note_head::brew_molecule)
        (glyph-name-procedure . ,find-notehead-symbol)
+       (X-extent-callback . ,Note_head::extent)
+       (Y-extent-callback . ,Note_head::extent)
        (Y-offset-callbacks  . (,Staff_symbol_referencer::callback))
        (stem-attachment-function . ,note-head-style->attachment-coordinates)
        (meta . ((interfaces . (rhythmic-grob-interface rhythmic-head-interface font-interface note-head-interface staff-symbol-referencer-interface item-interface ))))
     (OctavateEight
      . (
        (self-alignment-X . 0)
-       (text . "8")
        (break-visibility . ,begin-of-line-visible)
        (X-offset-callbacks . (,Self_alignment_interface::centered_on_parent ,Self_alignment_interface::aligned_on_self))
        (Y-offset-callbacks . (,Side_position_interface::aligned_side))
        (molecule-callback . ,Text_item::brew_molecule)
        (font-shape . italic)
        (padding . 0.4)
-       (font-relative-size . -2)
+       (font-size . -4)
        (font-family . roman)
        (meta . ((interfaces . (text-interface self-alignment-interface side-position-interface font-interface item-interface ))))
        ))
        (font-family . roman)
        (style . line)
        (if-text-padding . 1.0)
-       (width-correct . 0)
        (enclose-bounds . #t)
        (direction . -1)
        (bracket-flare . (0.5 . 0.5))
 
     (RepeatSlash
      . (
-       (molecule-callback . , Percent_repeat_item_interface::beat_slash)
+       (molecule-callback . ,Percent_repeat_item_interface::beat_slash)
        (thickness . 0.48)
        (slope . 1.7)
        (meta . ((interfaces . (percent-repeat-interface item-interface ))))
        ))
 
     (StanzaNumber
-     . (
-       (breakable . #t)
-       (molecule-callback . ,Text_item::brew_molecule)         
-       (break-align-symbol . clef)
-       (break-visibility . ,begin-of-line-visible)
+     . ((molecule-callback . ,Text_item::brew_molecule)                
        (font-family . roman)
-       (meta . ((interfaces . (break-aligned-interface text-interface font-interface item-interface ))))               
+       (font-series . bold)
+       (padding . 1.0)
+       (X-offset-callbacks . (,Side_position_interface::aligned_side))
+       (direction . ,LEFT) 
+       (meta . ((interfaces . (side-position-interface text-interface font-interface item-interface ))))               
        ))
 
     (StaffSpacing
 
        ;; default stem direction for note on middle line
        (neutral-direction . -1)
-       
-       ;; [Wanske]: standard length (but no shorter than minimum).
-       ;; (beamed-lengths . (3.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.
-       (beamed-lengths . (3.26 3.26 1.5))
-       
-       ;; [Wanske] lists three sets of minimum lengths.  One
-       ;; set for the nomal case, and one set for beams with `der
-       ;; Balkenendpunkt weiter "uber bzw. unter die Systemgrenze
-       ;; hinaus (bei Gruppen mit grossem Tonumfang)' and the extreme
-       ;; case.
-
-       ;; Note that Wanske lists numbers lengths starting from top of
-       ;; head, so we must add half a staff space.
+
+       ;; FIXME this should come from 'lengths
+
+;      (beamed-lengths . (3.26 3.26 1.5))
+       (beamed-lengths . (3.5 3.5 3.5 4.5 5.0))
        
        ;; 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 . (2.5 2.0 1.0))
+       (beamed-minimum-free-lengths . (1.83 1.5 1.25))
        
        ;; The 'extreme case' minima
-       (beamed-extreme-minimum-free-lengths . (1.83 1.5 1.25))
+       (beamed-extreme-minimum-free-lengths . (2.0 1.25))
 
        (X-offset-callbacks . (,Stem::off_callback))
        (X-extent-callback . ,Stem::dim_callback)       
        (Y-offset-callbacks . (,Staff_symbol_referencer::callback))
        (adjust-if-on-staffline . #t)
        (font-family . music)      
-       (avoid-note-head . #f)
-       (up-to-staff . #f)
        (meta . ((interfaces . (stem-interface  font-interface item-interface ))))
        ))
 
 
     (SeparationItem
      . (
+       (X-extent-callback . #f)
+       (Y-extent-callback . #f)
        (meta . ((interfaces . (spacing-interface separation-item-interface item-interface ))))
        ))
 
     (SeparatingGroupSpanner
      . (
        (spacing-procedure . ,Separating_group_spanner::set_spacing_rods)
-       (meta . ((interfaces . (spacing-interface separation-spanner-interface spanner-interface))))
+       (meta . ((interfaces . (only-prebreak-interface spacing-interface separation-spanner-interface spanner-interface))))
        ))
 
     (SustainPedal
      . (
        (molecule-callback . ,Text_spanner::brew_molecule)
        (font-family . roman)
-       (style . line)
+       (style . dashed-line)
 
        ;; urg, only for (de)cresc. text spanners
        (if-text-padding . 1.0)
-       (width-correct . -1)
+       (dash-fraction . 0.2)
+       (dash-period . 3.0)
        (direction . 1)
        (meta . ((interfaces . (text-spanner-interface side-position-interface font-interface spanner-interface))))             
        ))
     
-    (OttavaSpanner
+    (OttavaBracket
      . (
-       (Y-offset-callbacks . (,Side_position_interface::aligned_side))
-       (molecule-callback . ,Text_spanner::brew_molecule)
+       (Y-offset-callbacks . (,Side_position_interface::out_of_staff
+                              ,Side_position_interface::aligned_side))
+       (molecule-callback . ,Ottava_bracket::brew_molecule)
+       (font-shape . italic)
        (font-family . roman)
+       (text-repeat-if-broken . #t)
+       (shorten-pair . (0.0 . -0.6))
+       (staff-padding . 1.0)
+       (padding  . 1.0)
        (enclose-bounds . #t)
-       (width-correct . 0.0)
-       (style . dashed-line)
-       (edge-height . (0 . 1.5))
+       (minimum-length . 1.0)
+       (dash-fraction . 0.3)
+       (edge-height . (0 . 1.2))
        (direction . 1)
-       (meta . ((interfaces . (text-spanner-interface side-position-interface font-interface spanner-interface))))             
+       (meta . ((interfaces . (ottava-bracket-interface
+                               line-interface side-position-interface
+                               font-interface text-interface spanner-interface))))             
        ))
     
     (TabNoteHead
      . (
        (font-family . roman)
        (style . default)
-       (molecule-callback . ,tablature-molecule-callback)
+       (molecule-callback . ,Text_item::brew_molecule)
        (Y-offset-callbacks  . (,Staff_symbol_referencer::callback))
        (extra-offset . (0 . -0.65)) ;; UGH! TODO: Clean this up!
        (stem-attachment-function . ,tablature-stem-attachment-function)
     (TieColumn
      . (
        (after-line-breaking-callback . ,Tie_column::after_line_breaking)
-       (X-extent-callback . ())
-       (Yoo-extent-callback . ())      
+       (X-extent-callback . #f)
+       (Y-extent-callback . #f)        
        (meta . ((interfaces . (tie-column-interface spanner-interface))))
        ))
 
     (TimeSignature
      . (
        (molecule-callback . ,Time_signature::brew_molecule)
+;      (molecule-callback . ,Text_item::brew_molecule) 
        (break-align-symbol . time-signature)
        (break-visibility . ,all-visible)
        (space-alist . (
-                       (first-note . (extra-space . 2.0))
+                       (first-note . (fixed-space . 2.0))
                        (right-edge . (extra-space . 0.5))
                        (staff-bar .  (minimum-space . 2.0))
                        ))
        (breakable . #t)
        (style . C)
+;      (text . (,time-signature-glue-markup)) 
        (font-family . number)
        (meta . ((interfaces . (time-signature-interface break-aligned-interface font-interface item-interface ))))
        ))
     (TupletBracket
      . (
        (gap . 2.0)
-       (padding . 0.9)
+       (padding . 1.1)
        (thickness . 1.6)
        (edge-height . (0.7 . 0.7))
        (shorten-pair . (-0.2 . -0.2))
        (font-shape . italic)
        (font-series . bold)
 
-       (font-relative-size . -1)
-       (meta .  ((interfaces . (text-interface tuplet-bracket-interface font-interface spanner-interface))))
+       (font-size . -2)
+       (meta .  ((interfaces . (text-interface line-interface tuplet-bracket-interface font-interface spanner-interface))))
        ))
 
     (UnaCordaPedal
 
     (VaticanaLigature
      . (
-       (thickness . 1.0)
+       (thickness . 0.6)
        (flexa-width . 2.0)
        (ligature-primitive-callback . ,Vaticana_ligature::brew_ligature_primitive)
        (molecule-callback . ,Vaticana_ligature::brew_molecule)
        (height . 2.0) ; staffspace;
        (minimum-space . 5)
        (font-family . number)
-       (font-relative-size . -2)
-       (meta . ((interfaces . (volta-bracket-interface text-interface side-position-interface font-interface spanner-interface))))
+       (font-size . -4)
+       (meta . ((interfaces . (volta-bracket-interface line-interface text-interface side-position-interface font-interface spanner-interface))))
        ))
     
     (VerticalAlignment
      . (
        (axes . (1))
        (Y-extent-callback . ,Axis_group_interface::group_extent_callback)
+       (X-extent-callback . ,Axis_group_interface::group_extent_callback)
        (stacking-dir . -1)
        (meta . ((interfaces . (align-interface axis-group-interface spanner-interface))))
        ))
      . (
        (axes . (1))
        (Y-extent-callback . ,Axis_group_interface::group_extent_callback)      
+       (X-extent-callback . ,Axis_group_interface::group_extent_callback)
        
        (meta . ((interfaces . (axis-group-interface spanner-interface))))
        ))