lilypond-user
[Top][All Lists]
Advanced

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

Re: Markup and stencil formatting questions


From: Olivier Biot
Subject: Re: Markup and stencil formatting questions
Date: Wed, 19 Dec 2012 22:42:18 +0100

On Wed, Dec 19, 2012 at 5:26 PM, Olivier Biot <address@hidden> wrote:
Dear all,

I cannot seem yet to get certain textual output rendered the way I intend. Here are the questions I still have:

 
2. Why does a strut have a nonzero width? Can it be used and set to zero? Maybe it has zero width, but because of some internal processing every markup element automatically gets white space glued to it (this may explain my first question in part too).


3. How can I get markup in columns use the font "strut" dimensions for correct vertical padding of a paragraph? In the example below, you'll see that there's an ugly and uncontrollable vertical white space between the 3-column output and the red text, due to using text in the 3 columns with characters protruding below the baseline or not.

I have been playing with text objects and their layout, and it appears to me that LilyPond always tries to find the smallest possible binding box for any text. This is understandable from the music score notation point of view, but for text it makes less sense in my opinion.

The following self-contained snippet illustrates a couple problems:

%% BEGIN Snippet
\version "2.16.1"

% LSR snippet from http://lsr.dsi.unimi.it/LSR/Snippet?id=464
#(define-markup-command (columns layout props args) (markup-list?)
   (let ((line-width (/ (chain-assoc-get 'line-width props
                          (ly:output-def-lookup layout 'line-width))
                       (max (length args) 1))))
     (interpret-markup layout props
       (make-line-markup (map (lambda (line)
                                (markup #:pad-to-box `(0 . ,line-width) '(0 . 0)
                                  #:override `(line-width . ,line-width)
                                  line))
                           args)))))


\markup {
  \fill-line {
    \rounded-box {
      \column {
        \box {
          \fill-line {
            \bold "N° 25. Minuetto"
            \line { \concat { \override#'(word-space 0)  {\with-color #blue "Nemo Ignoto" " (" \with-color #(rgb-color 1 .5 0) "Opus 3.14"  ")" } } }
          }
        }
        \fill-line {
          \columns {
            \box { \wordwrap { n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n  } }
            \box { \wordwrap { \italic { f n f n f n f n f n f n f n f n f n f n f n f n f n f n f n f n f n f n f n f n f n  } } }
            \box { \wordwrap { . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  } }
          }
        }
        \fill-line {
          \columns {
            \box { \justify { n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n  } }
            \box { \justify { \italic { f n f n f n f n f n f n f n f n f n f n f n f n f n f n f n f n f n f n f n f n f n  } } }
            \box { \justify { . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  } }
          }
        }
        \line {
          \columns {
            \box { \wordwrap { \with-color #(rgb-color 1 .5 0) {n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n n } } }
            \box { \wordwrap { \italic { f n f n f n f n f n f n f n f n f n f n f n f n f n f n f n f n f n f n f n f n f n  } } }
            \box { \wordwrap { . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   } }
          }
        }
        \box { \line { \with-color #(rgb-color .8 .2 .2) { A . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . } } }
        \line { \with-color #red { C Dur. {\italic Do majeur.} C major. } }
      }
    }
  }
}
%% END Snippet

The boxes in the example above are only meant to show the "bounding box" of all text objects.

Issue 1: vertical alignment of texts is ugly: the baseline-skip property applies only within lines of the same line-wrapped text, apparently not necessarily between different units of text.

Issue 2: use of \column pushes LilyPond to squeeze the 2-dimensional blobs in the smallest space possible, \line or \fill-line with any \column text will only extend to the highest / lowest bounding box within that row (line).

Issue 3: \fill-line and \line (and \columns) apparently use different left margin paddings: see the 3 lines containing 3-column text.

I illustrated some of the problems with blue lines on the attached PNG image for clarity.

At this point I do not know how to proceed.

Best regards,

Olivier

Attachment: LilyPond 2.16.1 text alignment.png
Description: PNG image


reply via email to

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