]> git.donarmstrong.com Git - lilypond.git/commitdiff
Fix 1229 Ensure space around prefatory matter
authorKeith OHara <k-ohara5a5a@oco.net>
Thu, 17 Feb 2011 20:45:34 +0000 (12:45 -0800)
committerTrevor Daniels <t.daniels@treda.co.uk>
Fri, 18 Feb 2011 09:19:12 +0000 (09:19 +0000)
NonMusicalPaperColumn gets skyline padding to prevent notes from overlapping
Clef and KeySignature get extra-spacing-width for separation from accidentals

input/regression/lyrics-bar.ly
input/regression/prefatory-separation.ly [new file with mode: 0644]
input/regression/stem-length-estimation.ly
lily/skyline.cc
scm/define-grobs.scm

index a5067687e9770b2b9063799873d606a91c5687c8..ead137c1dd945c4d437304988f2b6c430893b9fb 100644 (file)
@@ -12,26 +12,28 @@ lyrics do not collide with barlines.
 }
 
 <<
-    \new Staff \with
-    {
-%      \remove "Bar_engraver"  
-       }
-    {
+    \new Staff {
        b1 \bar "|:" b1 \bar ":|"
     }
     \context Lyrics \with {
        \consists "Bar_engraver"
        \consists "Separating_line_group_engraver"
-       \override BarLine #'bar-extent = #'(-2 . 2)
     } \lyricmode {
          looooooooooooooooooooooooooooooooooong1 syllable
       }
     \lyrics {
-       no Bar_Engraver_Bar_Engraver_Bar_Engraver 
+       no Bar_Engraver_Bar_Engraver_Bar_Engraver
+    }
+    \new Staff {
+       b1 b1
     }
-    \new Staff \with {
-%              \remove "Bar_engraver"  
-    } { b1 b1 }
 >>
-       
+\layout {
+  \context {
+    \Lyrics
+      \override VerticalAxisGroup #'nonstaff-nonstaff-spacing #'minimum-distance = #4
+      \override LyricText #'Y-offset = #-0.7
+      \override BarLine #'bar-extent = #'(-2 . 2)
+  }
+}
 
diff --git a/input/regression/prefatory-separation.ly b/input/regression/prefatory-separation.ly
new file mode 100644 (file)
index 0000000..5175fb0
--- /dev/null
@@ -0,0 +1,27 @@
+\version "2.13.50"
+
+\header {
+
+  texidoc = "Prefatory items maintain sufficient separation from
+  musical notation for readability, even in tight spacing.
+  The notes should remain generally on the correct side of the
+  time signature, key signature and barlines.  A key change to
+  G major should be legible."
+
+}
+
+\new Staff <<
+  \relative c''' {
+    \key f \major
+    es4 c c c \bar "||" \noBreak
+    \key g \major
+    <gis cis,>4 r2. \bar "|."
+    } \\
+  \relative c' {
+    R1
+    r4 cis a a
+  }
+>>
+\layout {
+  line-width = 5\cm % impossibly narrow to induce tight spacing
+}
index 18697f726b6a3a2b5b04ec2d971f528000481966..4cfc89d7f6569687b97cc599aa97cfc97985918c 100644 (file)
@@ -16,6 +16,7 @@ This example should fit snugly on one page.
 \paper {
   #(set-paper-size "a6")
   tagline = ##f
+  indent = #0
   system-system-spacing = #'((padding . 1.2))
   oddHeaderMarkup = \markup \on-the-fly #assert-single-page \null
 }
index 608155ea3d26cfa1ef6ff3c605e443463cf8c306..fe30291f78812d90aa07494414972639241aaef4 100644 (file)
@@ -239,6 +239,10 @@ empty_skyline (list<Building> *const ret)
   ret->push_front (Building (-infinity_f, -infinity_f, -infinity_f, infinity_f));
 }
 
+/*
+  Given Building 'b' with starting wall location 'start', extend each side
+  with a sloped roofline of width 'horizon_padding'; put the skyline in 'ret'
+*/
 static void
 single_skyline (Building b, Real start, Real horizon_padding, list<Building> *const ret)
 {
@@ -330,7 +334,8 @@ Skyline::internal_build_skyline (list<Box> *boxes, Real horizon_padding, Axis ho
     {
       list<Building> result;
       single_skyline (Building (boxes->front (), horizon_padding, horizon_axis, sky),
-                     boxes->front ()[horizon_axis][LEFT], horizon_padding, &result);
+                     boxes->front ()[horizon_axis][LEFT] - horizon_padding,
+                     horizon_padding, &result);
       return result;
     }
 
@@ -443,7 +448,8 @@ Skyline::Skyline (Box const &b, Real horizon_padding, Axis horizon_axis, Directi
 {
   sky_ = sky;
   Building front (b, horizon_padding, horizon_axis, sky);
-  single_skyline (front, b[horizon_axis][LEFT], horizon_padding, &buildings_);
+  single_skyline (front, b[horizon_axis][LEFT] - horizon_padding,
+                 horizon_padding, &buildings_);
 }
 
 void
@@ -477,7 +483,8 @@ Skyline::insert (Box const &b, Real horizon_padding, Axis a)
     return;
 
   my_bld.splice (my_bld.begin (), buildings_);
-  single_skyline (Building (b, horizon_padding, a, sky_), b[a][LEFT], horizon_padding, &other_bld);
+  single_skyline (Building (b, horizon_padding, a, sky_), b[a][LEFT] - horizon_padding,
+                 horizon_padding, &other_bld);
   internal_merge_skyline (&other_bld, &my_bld, &buildings_);
 }
 
index 92edba5f1df693faef00317964d77e2105a69d4c..15a2695e5f2283a21839234fd5efd07dd63580c5 100644 (file)
                        (right-edge . (extra-space . 0.5))
                        (first-note . (fixed-space . 2.5))))
        (stencil . ,ly:key-signature-interface::print)
+       (extra-spacing-width . (0.0 . 0.5))
        (Y-offset . ,ly:staff-symbol-referencer::callback)
        (meta . ((class . Item)
                 (interfaces . (break-aligned-interface
                        (right-edge . (extra-space . 0.5))
                        (first-note . (fixed-space . 2.5))))
        (stencil . ,ly:key-signature-interface::print)
+       (extra-spacing-width . (0.0 . 0.5))
        (Y-offset . ,ly:staff-symbol-referencer::callback)
        (meta . ((class . Item)
                 (interfaces . (break-aligned-interface
        (before-line-breaking . ,ly:paper-column::before-line-breaking)
        (full-measure-extra-space . 1.0)
        (horizontal-skylines . ,ly:separation-item::calc-skylines)
-       (skyline-vertical-padding . 0.15)
+       ;; sufficient padding to prevent ledger lines from moving over/under
+       (skyline-vertical-padding . 0.6)
        ;;                    (stencil . ,ly:paper-column::print)
 
        (line-break-permission . allow)