]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/spacing-spanner.cc, ly/paper-init.ly: introduced paper
authorJürgen Reuter <j@web.de>
Wed, 30 Apr 2003 19:46:15 +0000 (19:46 +0000)
committerJürgen Reuter <j@web.de>
Wed, 30 Apr 2003 19:46:15 +0000 (19:46 +0000)
variable "packed" for packed right-ragged mode

ChangeLog
lily/spacing-spanner.cc
ly/paper-init.ly

index e8194cac16665b68abc7d6b8bba04249f3a2350b..c7cdb2aab916e4e64b946bb6c494abdb166ce33e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2003-04-30  Juergen Reuter  <reuter@ipd.uka.de>
 
+       * lily/spacing-spanner.cc, ly/paper-init.ly: introduced paper
+       variable "packed" for packed right-ragged mode
+
        * lily/spacing-spanner.cc: fixed typo: colunm -> column; removed
        unused variable ragged; fixed indentation
 
index 9f15d8f5f09171904a353f30d81da424e6625381..5a889c74b480154d3e452a64e75c7ddc9f278d77 100644 (file)
@@ -610,24 +610,31 @@ Spacing_spanner::musical_column_spacing (Grob *me, Item * lc, Item *rc, Real inc
   */
   max_fixed_note_space = max_fixed_note_space <? max_note_space;
 
-#if 0
-  /*
-    This doesn't make sense. For ragged right we want to have the same
-    spacing. Otherwise  the option should be called differently.
-
-    ragged-righted-and-weird-spacing. Whatever.
-
-  */
-  Real strength = (ragged) ? 1.0 : 1 / (max_note_space - max_fixed_note_space);
-  Real distance = (ragged) ? max_fixed_note_space : max_note_space;
-#else
+  bool packed = to_boolean (me->get_paper ()->get_scmvar ("packed"));
+  Real strength, distance;
 
   /*
     TODO: make sure that the space doesn't exceed the right margin.
    */
-  Real strength = 1 / (max_note_space - max_fixed_note_space);
-  Real distance = max_note_space;
-#endif
+  if (packed)
+    {
+      /*
+       In packed mode, pack notes as tight as possible.  This makes
+       sense mostly in combination with raggedright mode: the notes
+       are then printed at minimum distance.  This is mostly useful
+       for ancient notation, but may also be useful for some flavours
+       of contemporary music.  If not in raggedright mode, lily will
+       pack as much bars of music as possible into a line, but the
+       line will then be stretched to fill the whole linewidth.
+      */
+      strength = 1.0;
+      distance = max_fixed_note_space;
+    }
+  else
+    {
+      strength = 1 / (max_note_space - max_fixed_note_space);
+      distance = max_note_space;
+    }
 
   //  Spaceable_grob::add_spring (lc, rc, distance, strength, expand_only);
 
index 26ec0b72336de7084ed275cf2bae5ac12bb5716b..f93eb176635e6f3833be0e85f613a40e43b1b93c 100644 (file)
@@ -11,5 +11,6 @@ linewidth = \hsize - 2.\cm
 % Leave the textheight calculation to the geometry package. /MB
 %textheight = \vsize - 4.\cm
 raggedright = ##f
+packed = ##f
 indent = \linewidth / 14.0