I'm sure our scheme wizards will be able to provide a much better solution (for instance, the number "000" should really be a number, not a string), but here is an approximation:

Here an improved version which allows the number to entered as a number (and the descriptive text as a simple markup-list).

Lukas

\version "2.19"

% By harm
#(define (general-column align-dir baseline mols)
   (let* ((aligned-mols (map (lambda (x) (ly:stencil-aligned-to x X align-dir)) mols)))
     (stack-lines -1 0.0 baseline aligned-mols)))

#(define-markup-command (wordwrap-right layout props args)
   (markup-list?)
   (general-column RIGHT 2.5 (wordwrap-internal-markup-list layout props #f args)))

#(define-markup-command (number-fromproperty layout props digits symbol)
   (index? symbol?)
   (let ((n (chain-assoc-get symbol props)))
     (if (index? n)
         (interpret-markup
          layout props
          (markup (format #f
                          (string-append "~" (number->string digits) ",'0d")
                          n)))
         empty-stencil)))

#(define-markup-command (wordwrap-right-field layout props symbol)
   (symbol?)
   (let* ((m (chain-assoc-get symbol props)))
     (if (markup-list? m)
         (wordwrap-right-markup layout props m)
         empty-stencil)))

\paper {
  scoreTitleMarkup = \markup {
    \fill-line {
      \line {
        \fontsize #7 \number-fromproperty #3 #'header:piece-nr
        \hspace #1
        \normal-text \large \fromproperty #'header:piece-title
      }
      \general-align #Y #DOWN
      \italic \small
      \override #'(line-width . 50)
      \wordwrap-right-field #'header:infotext
    }
  }
}

\paper {
  indent = 0
}

\score {
  \header {
    piece-nr = 0
    piece-title = "Gottes Sohn ist kommen"
    infotext = \markuplist {
      This paragraph is in two or more rows, and the last line needs
      to be level with the bit on the left. It really can be as long
      as you want.
    }
  }
  \relative c' { c1 c e f g a g }
}


\score {
  \header {
    piece-nr = 1
    piece-title = "Another piece"
    infotext = \markuplist {
      This paragraph is in two or more rows, and the last line needs
      to be level with the bit on the left. It really can be as long
      as you want. Bla bla text, bla bla text? Really important bla bla text, bla bla text.
    }
  }
  \relative g' { g2 f e c d b c1 }
}

Reply via email to