lilypond-user
[Top][All Lists]
Advanced

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

Re: Some text formatting advice


From: Torsten Hämmerle
Subject: Re: Some text formatting advice
Date: Mon, 23 Jul 2018 04:02:33 -0700 (MST)

Hi Urs,

There is one magic command called \textLengthOn that might be of great help
in this case.

With \textLengthOn, the width of measures will be increased depending on the
markup without vertical shifting around and stacking on top of each other.

In a combination with staff-padding it is possible to vertically align
TextScript markups by their baseline.
When using auto line break commands like \justify and all the others, the
text column width can be adjusted by setting line-width.

I'm using a bit of NoteHead.extra-offset to get them centred (I know this
can be done automatically, but I wanted to keep it simple).

With narrow columns, it might be advisable to manually hyphenate the text to
avoid ugly gaps.

%%%%%%%%%%
\version "2.19.82"

{
  \textLengthOn
  \override TextScript.self-alignment-X = #CENTER
  \override TextScript.baseline-skip = #2.3
  \override TextScript.staff-padding = #6 
  \override NoteHead.extra-offset = #'(-1 . 0)
  c''\longa*1/4^\markup \center-column {
    \bold "Longa."  " "  "Eine lange Note." 
  }
  c''\breve*1/2
    ^\markup \center-column {
      \bold "Breve." "Eine kurze" "Note."
    }
    -\tweak staff-padding #3.5
    _\markup \center-column {
      "Diese Note" "gilt 4 Tacte."
    }
  c''1
    ^\markup \center-column {
      \bold "Semibreve." " " "Eine ganze Note."
    }
    -\tweak staff-padding #3.5
    _\markup \override #'(line-width . 25) \justify {
    This is a lengthy text and it should be automatically 
    broken into several lines. Without 
    hyphenation, you’ll get a distinct Swiss cheese look.
  }
}
%%%%%%%%%%%%%

<http://lilypond.1069038.n5.nabble.com/file/t3887/test-text-align.png> 


At least that's the way I'd do it. As usual, there are other ways, of
course.

HTH,
Torsten




--
Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html



reply via email to

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