lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Some "Cheat cheet" nitpicks


From: Sven Axelsson
Subject: Re: Some "Cheat cheet" nitpicks
Date: Tue, 15 Dec 2009 13:25:13 +0100

2009/12/15 Graham Percival <address@hidden>
On Tue, Dec 15, 2009 at 09:55:10AM +0100, Werner LEMBERG wrote:
>
> [all lilypond documentation snippets running through lilypond-book get
> a horizontal offset of 3mm to the right]
>
> > We have code that detects if the example is a single line; if so, it
> > adds ragged-right=##t.
>
> I think you are wrong; at least I haven't found anything into this
> direction in lilypond-book.  It only suppresses ragged-right output if
> a line width is given.

It's part of the lilypond binary (or scheme functions) itself, not
lilypond-book.

http://lists.gnu.org/archive/html/lilypond-devel/2008-03/msg00097.html

I don't know exactly when it was implemented, but we spent a lot
of time removing [ragged-right] from the docs, so it definitely
*was* implemented.

> > That same piece of code could set left-padding to 0.
>
> `This piece of code' has to be written yet, I believe.  However, I
> think it's a bad idea in general since it means that you have to run
> lilypond twice on a single snippet: the first time to find out whether
> there is more than a single line, and the second time to apply
> left-padding.

I have no clue how Joe worked his magic, but I trust that he did
it the proper way.  :)   (or else he and Han-Wen decided that the
initial spacing could be done fast enough that it wouldn't matter)


Jyst FYI: the code in question is in lily/constrained-breaking.cc
in SHA 6673b8fee.

The patch looks like this:

 +  /* As a special case, if there is only one line in the score and ragged-right
+     hasn't been specifically forbidden and the line is stretched, use
+     ragged spacing. */
+  if (last && i == 0
+      && lines_.at (i, j).force_ >= 0
+      && !scm_is_bool (pscore_->layout ()->c_variable ("ragged-right"))
+      && !scm_is_bool (pscore_->layout ()->c_variable ("ragged-last")))
+    ragged = true;

--
Sven Axelsson
++++++++++[>++++++++++>+++++++++++>++++++++++>++++++
>++++<<<<<-]>++++.+.++++.>+++++.>+.<<-.>>+.>++++.<<.
+++.>-.<<++.>>----.<++.>>>++++++.<<<<.>>++++.<----.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]