Hi Joe,
The fact that tight-spacing ignores padding is probably a bug. Do things
work better if you change minimum_distance to (minimum_distance +
padding) in page-layout-problem.cc:286?
As I had posted earlier, changing to (minimum_distance+padding) does
fix exactly the issue I was referring to.
What should we do with it at this point, so that we can see some
progress? Shall I open a codereview issue on this one line? doesn't
really seem appropriate, as Joe is the real author of this proposed
change.
Actually, this turns out to be the wrong fix. If you look for
"Markuplines spacing broken: how to set a line padding?" in the
lily-devel archives, you'll see that the zero-padding for markup lines
was intentional (although there should have been a comment to make that
clear), so it is the page breaker that needs to change, not the page
layout.
So, something like the attached patch?
I am not sure of the exact logic behind "tight-spacing" (seems
convoluted), but when applied to our real-world manuscript, the result
looks pretty good. (So I am in a situation opposite to that of Dr.
Knuth's anecdote).
diff --git a/lily/constrained-breaking.cc b/lily/constrained-breaking.cc
index 6408db3..1c75ccc 100644
--- a/lily/constrained-breaking.cc
+++ b/lily/constrained-breaking.cc
@@ -557,6 +557,7 @@ Line_details::Line_details (Prob *pb, Output_def *paper)
last_markup_line_ = to_boolean (last_scm);
SCM first_scm = pb->get_property ("first-markup-line");
first_markup_line_ = to_boolean (first_scm);
+ tight_spacing_ = to_boolean (pb->get_property ("tight-spacing"));
}
Real
diff --git a/lily/include/constrained-breaking.hh b/lily/include/constrained-breaking.hh
index d83d091..4f9c57b 100644
--- a/lily/include/constrained-breaking.hh
+++ b/lily/include/constrained-breaking.hh
@@ -71,6 +71,7 @@ struct Line_details {
int compressed_nontitle_lines_count_;
bool last_markup_line_;
bool first_markup_line_;
+ bool tight_spacing_;
Line_details ()
{
@@ -81,6 +82,7 @@ struct Line_details {
bottom_padding_ = 0;
space_ = 0;
inverse_hooke_ = 1;
+ tight_spacing_ = false;
break_permission_ = ly_symbol2scm ("allow");
page_permission_ = ly_symbol2scm ("allow");
turn_permission_ = ly_symbol2scm ("allow");
diff --git a/lily/page-breaking.cc b/lily/page-breaking.cc
index d9235d8..ea0c8c5 100644
--- a/lily/page-breaking.cc
+++ b/lily/page-breaking.cc
@@ -99,7 +99,9 @@ compress_lines (const vector<Line_details> &orig)
{
Line_details const &old = ret.back ();
Line_details compressed = orig[i];
- Real padding = orig[i].title_ ? old.title_padding_ : old.padding_;
+ Real padding = 0;
+ if (!orig[i].tight_spacing_)
+ orig[i].title_ ? old.title_padding_ : old.padding_;
compressed.shape_ = orig[i].shape_.piggyback(old.shape_, padding);
//compressed.shape_ = old.shape_.piggyback(orig[i].shape_, padding);
@@ -880,9 +882,10 @@ Page_breaking::min_page_count (vsize configuration, vsize first_page_num)
Real ext_len;
if (cur_rod_height > 0)
{
- padding = cached_line_details_[i].title_ ?
- cached_line_details_[i-1].title_padding_ :
- cached_line_details_[i-1].padding_;
+ if (!cached_line_details_[i].tight_spacing_)
+ padding = cached_line_details_[i].title_ ?
+ cached_line_details_[i-1].title_padding_ :
+ cached_line_details_[i-1].padding_;
ext_len = cached_line_details_[i].tallness ();
}
else
diff --git a/lily/page-spacing.cc b/lily/page-spacing.cc
index c0825ab..2b863f5 100644
--- a/lily/page-spacing.cc
+++ b/lily/page-spacing.cc
@@ -54,7 +54,8 @@ Page_spacing::append_system (const Line_details &line)
rod_height_ += line.full_height ();
first_line_ = line;
}
- rod_height_ += line.title_ ? last_line_.title_padding_ : last_line_.padding_;
+ if (!line.tight_spacing_)
+ rod_height_ += line.title_ ? last_line_.title_padding_ : last_line_.padding_;
spring_len_ += line.space_;
inverse_spring_k_ += line.inverse_hooke_;
@@ -66,7 +67,7 @@ Page_spacing::append_system (const Line_details &line)
void
Page_spacing::prepend_system (const Line_details &line)
{
- if (rod_height_)
+ if (rod_height_ && !first_line_.tight_spacing_)
rod_height_ += first_line_.title_ ? line.title_padding_ : line.padding_;
else
last_line_ = line;
_______________________________________________
bug-lilypond mailing list
bug-lilypond@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-lilypond