From 0b75a399362e0e06c738d37ae096ee0e8bcc1af1 Mon Sep 17 00:00:00 2001 From: Joe Neeman Date: Mon, 19 Oct 2009 10:55:46 -0700 Subject: [PATCH] Fix tight spacing for markup lines. --- lily/page-layout-problem.cc | 13 +++++++++++-- lily/paper-book.cc | 16 ++++++---------- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/lily/page-layout-problem.cc b/lily/page-layout-problem.cc index 35443dfc84..fe87727d5e 100644 --- a/lily/page-layout-problem.cc +++ b/lily/page-layout-problem.cc @@ -253,6 +253,8 @@ Page_layout_problem::append_prob (Prob *prob, Spring const& spring, Real padding { Skyline_pair *sky = Skyline_pair::unsmob (prob->get_property ("vertical-skylines")); Real minimum_distance = 0; + bool tight_spacing = to_boolean (prob->get_property ("tight-spacing")); + if (sky) { minimum_distance = (*sky)[UP].distance (bottom_skyline_); @@ -266,10 +268,17 @@ Page_layout_problem::append_prob (Prob *prob, Spring const& spring, Real padding bottom_skyline_.clear (); bottom_skyline_.set_minimum_height (iv[DOWN]); } - minimum_distance += padding; Spring spring_copy = spring; - spring_copy.ensure_min_distance (minimum_distance); + if (tight_spacing) + { + spring_copy.set_min_distance (minimum_distance); + spring_copy.set_inverse_stretch_strength (0.0); + spring_copy.set_distance (0.0); + } + else + spring_copy.ensure_min_distance (minimum_distance + padding); + springs_.push_back (spring_copy); elements_.push_back (Element (prob)); } diff --git a/lily/paper-book.cc b/lily/paper-book.cc index 26f7be7e19..4700a8ce0a 100644 --- a/lily/paper-book.cc +++ b/lily/paper-book.cc @@ -516,16 +516,12 @@ Paper_book::get_system_specs () ly_symbol2scm ("allow")); paper_system_set_stencil (ps, *unsmob_stencil (t)); - ps->set_property ("is-title", SCM_BOOL_T); - if (scm_is_pair (scm_cdr (list))) - { - /* If an other markup is following, set this markup - * next padding and next space to 0, so that baseline-skip - * only should be taken into account for lines vertical - * spacing. */ - ps->set_property ("next-padding", scm_double2num (0.0)); - ps->set_property ("next-space", scm_double2num (0.0)); - } + ps->set_property ("is-title", SCM_BOOL_T); + if (list != texts) + /* For each markup other than the first, place it as closely as + possible to the previous markup and don't allow stretching. */ + ps->set_property ("tight-spacing", SCM_BOOL_T); + system_specs = scm_cons (ps->self_scm (), system_specs); ps->unprotect (); -- 2.39.2