From b24c202479e94efaaebca7dcb57925a1598f7a4c Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=BCrgen=20Reuter?= Date: Wed, 30 Apr 2003 19:46:15 +0000 Subject: [PATCH] * lily/spacing-spanner.cc, ly/paper-init.ly: introduced paper variable "packed" for packed right-ragged mode --- ChangeLog | 3 +++ lily/spacing-spanner.cc | 35 +++++++++++++++++++++-------------- ly/paper-init.ly | 1 + 3 files changed, 25 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index e8194cac16..c7cdb2aab9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2003-04-30 Juergen Reuter + * 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 diff --git a/lily/spacing-spanner.cc b/lily/spacing-spanner.cc index 9f15d8f5f0..5a889c74b4 100644 --- a/lily/spacing-spanner.cc +++ b/lily/spacing-spanner.cc @@ -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 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); diff --git a/ly/paper-init.ly b/ly/paper-init.ly index 26ec0b7233..f93eb17663 100644 --- a/ly/paper-init.ly +++ b/ly/paper-init.ly @@ -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 -- 2.39.5