[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [LilyPond] Unequal line spacing in columns
From: |
Michael Lauer |
Subject: |
Re: [LilyPond] Unequal line spacing in columns |
Date: |
Fri, 8 May 2009 14:31:42 +0000 (UTC) |
User-agent: |
Loom/3.14 (http://gmane.org/) |
-Eluze <eluzew <at> gmail.com> writes:
>
>
> Sven Siegmund wrote:
> >
> > In my case the vertical line spacing in the left and right column
> > differ a tiny bit. I wouldn't notice it wouldn't it be for this big
> >
> that's probably due to lines with/without ascenders/descenders!
>
In particular I think it's the descenders in the last lines of the stanzas.
Within a column lines of text are aligned by baseline, but the column
itself is just a block whose size depends on details like those
descenders.
One fix is to pad the stanzas' columns a little so the bounding boxes
are all the same. Here's one way of doing that, wrapped in a
new markup command. It computes the bottom of the bounding box as if
there were no descenders, and then adds a little to account for them.
\version "2.12.1"
#(define-markup-command (stanza layout props lines) (markup-list?)
"Make a column, and add a little fudge for descenders at the bottom"
(let* ((bls (chain-assoc-get 'baseline-skip props 3))
(y (- (* -1 bls (- (length lines) 1) ) 0.5))
(result (markup #:pad-to-box '(0 . 0) `(,y . 0)
(make-column-markup lines))))
(interpret-markup layout props result)))
\markup {
\fill-line {
\hspace #0.1 % moves the column off the left margin;
% can be removed if space on the page is tight
\column {
\hspace #0.1 % adds vertical spacing between verses
\line { \bold "2."
\stanza {
"Kmáni, šarže, oficíři,"
"kobyly i kanonýři,"
"po zemi se válejí,"
"rány je moc pálejí."
}
}
\hspace #0.1 % adds vertical spacing between verses
\line { "Ref."
\column {
"A u kanónu stál ..."
}
}
\hspace #0.1 % adds vertical spacing between verses
\line { \bold "3."
\stanza {
"Vzdor hroznému dešti kulek"
"feuerwerker Franz Jabůrek"
"s luntem u kanonu stál"
"a pánvičku pucoval."
}
etc.