Q: do want globally non-cramped lines, or locally equally cramped lines.
*/
Real demerit = abs (this_one.force_) + abs (prev.force_ - this_one.force_)
- + break_penalties
- /*
- This is rather ugly (not scale free), but we have to put a
- penalty breaking two zero-force lines. Otherwise, we don't get a
- unique solution (i.e.: line-breaks in short raggedright
- fragments.)
- */
- + 1e-5;
+ + break_penalties;
+ /*
+ This is rather ugly (not scale free), but we have to put a
+ penalty breaking two zero-force lines. Otherwise, we don't get a
+ unique solution (i.e.: line-breaks in short raggedright
+ fragments.)
+ */
+
if (!this_one.satisfies_constraints_b_)
{
/*
Real
Simple_spacer::active_springs_stiffness () const
{
- range_stiffness (0, springs_.size ());
+ return range_stiffness (0, springs_.size ());
}
void
else
my_solve_linelen ();
-
positions->force_ = force_;
- if ((force_ < 0))
- {
-
- /*
- We used to have a penalty for compression, no matter what, but that
- fucked up wtk1-fugue2 (taking 3 full pages.)
-
- maybe this should be tunable?
- */
- if (compression_penalty_b_)
- ; // positions->force_ *= 2; // hmm.
- }
+ /*
+ We used to have a penalty for compression, no matter what, but that
+ fucked up wtk1-fugue2 (taking 3 full pages.)
+ */
positions->config_.push (indent_);
for (int i=0; i <springs_.size (); i++)
we have l>= 0 here, up to rounding errors
*/
}
+
+ if (ragged && line_len_ > 0)
+ {
+ Real len = positions->config_.top ();
+ positions->force_ = (line_len_ - len) * active_springs_stiffness ();
+ }
+
+
positions->cols_ = spaced_cols_;
positions->loose_cols_ = loose_cols_;