lilypond-user
[Top][All Lists]
Advanced

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

What's up with fill-line?


From: Alexander Kobel
Subject: What's up with fill-line?
Date: Thu, 24 Sep 2009 15:40:56 +0200
User-agent: Thunderbird 2.0.0.23 (X11/20090817)

Hi all,


I think I have to bother you a bit more about fill-line; I don't understand docs and/or code of it.


First of all, nested fill-lines don't seem to be a good thing, which may or may not be a Bad Thing (tm). In principle, that's easy to avoid; but it's an annoyance for the header and footer fields that implicitly use fill-line, such as tagline. For those you have to redefine the {even,odd}{Footer,Header}Markup commands to get things done correct, which is quite a bit more ugly than just stating tagline = \markup \fill-line { ... }.

This makes this issue actually interesting: I guess it's not only me who wants some copyright or tagline texts divided into both in the left and the right corner of the page.


So, here's what I know:
Nested fill-lines are shifted to the right by word-space per level. Overriding word-space to 0 in the default definitions of (e.g.) oddFooterMarkup does not work well, because it's inherited to the nested levels. Well, and even _if_ you override it, and _if_ you remember to switch it back accordingly in the nested levels, there remains a really tiny bit of offset. It's not visible in the PNG, but it's there (I think it's 1/2 line-thickness, but I'm not sure).

Secondly, if you have a bunch of the same letters inside fill-line, the spacing of the first two and the last two is tighter than the spacing of the others. If you have a bunch of vertical lines, their distances seem to be perfectly equal.
Why? Intended? I don't know.

Last but not least, fill-line seems to be easily broken by arguments of very different length. (See the tagline in the attached example, which should perfectly fit into one line, and should have more distance between the red and the green block.)


Just for my basic understanding: Is fill-line supposed to work like LaTeX's
        arg1\hfill arg2\hfill arg3\hfill ... \hfill argn
(that's how I read the docs: "evenly spaced to fill the entire line" suggests that all the distances are equal - if so, is word-space really necessary)?

Or should it try to center all the arguments at positions
        i * line-width / (n+1)
for i = 1..n, and then shift the arguments around to fit into one line? This seems more like what it does at the moment, and it has the additional benefit that
        \fill-line { left center right }
actually centers "center" regardless whether the lengths of "left" and "right" differ or not.


Hm. Sorry for the longish explanation, but I have no clue how to elegantly solve this, and I even think this may be a bug or misunderstanding between specification and implementation of fill-line.


Cheers,
Alexander
\version "2.13.4"

bar = \markup \draw-line #'(0 . 2)

\paper {
  indent = 0\mm
  ragged-last-bottom = ##f
  page-count = #1

  oddFooterMarkup = \markup {
%       \override #'(word-space . 0)
        \column {
          \fill-line {
                %% Copyright header field only on first page.
                \on-the-fly #first-page \fromproperty #'header:copyright
          }
          \fill-line {
                %% Tagline header field only on last page.
                \on-the-fly #last-page \fromproperty #'header:tagline
          }
        }
  }
  tagline = \markup \fill-line {
        \bar
        \with-color #red \right-column {
          "(implicitly 2nd level nested)"
          "fill-line in tagline"
        }
        \with-color #green \left-column {
          "trying word-space = 0 in oddFooterMarkup (line 11)"
          "makes these two lines collide"
        }
        \bar
  }
}

\header {
  title = \markup \fill-line { \bar "title: fill-line" \bar }
%  composer = \markup \fill-line { \bar "composer: fill-line" \bar }
%  arranger = \markup \fill-line { \bar "arranger: fill-line" \bar }
%  poet = \markup \fill-line { \bar "poet: fill-line" \bar }
  meter = \markup \fill-line { \bar "meter: fill-line" \bar }
}


\score {
  \new Staff \repeat unfold 12 { c''1 \break }
}

\markup \line { \bar "simple line in book markup" \bar }
\markup \fill-line { \bar "fill-line in book markup" \bar }
\markup \fill-line { \fill-line { \bar "2nd level fill-line in book markup" 
\bar } }
\markup \fill-line { \fill-line { \fill-line { \bar "3rd level fill-line in 
book markup" \bar } } }
\markup { \override #'(word-space . 0) \fill-line { \fill-line { \fill-line { 
\bar "3rd level fill-line in book markup (word-space = 0) [NOT 100% correct!]" 
\bar } } } }
\markup \fill-line { \bar \bar \bar \bar \bar \bar \bar \bar \bar \bar \bar 
\bar \bar \bar \bar \bar \bar \bar \bar \bar \bar \bar \bar \bar \bar}
\markup \fill-line {
  \override #'(word-space . 0)
  M M M M M M M M M M M M M M M M M M M M M M M M M M
}

Attachment: fill-line.pdf
Description: Adobe PDF document

PNG image


reply via email to

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