lilypond-user
[Top][All Lists]
Advanced

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

Re: Descenders affecting line height calculation for lyrics in columns?


From: Lukas-Fabian Moser
Subject: Re: Descenders affecting line height calculation for lyrics in columns?
Date: Fri, 21 Jan 2022 22:23:09 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0

Hi Kieren,
In my main include file, I have the following definition:

     strut = \markup \transparent { Tj }

Then, in markups, I use

     \combine $text \strut

to guarantee a consistent height/spacing.

One could do something like this:

\version "2.22"

#(define (squash-stencil-X stil)
   ; creates a placeholder stencil with empty X-extent and stil's Y-extent
   (ly:make-stencil '() empty-interval (ly:stencil-extent stil Y)))

#(define-markup-command (strut layout props) ()
   ; create a vertical strut of zero width
   (squash-stencil-X (interpret-markup layout props "Tj")))

#(define-markup-command (strutify layout props content) (markup?)
   (interpret-markup layout props (markup #:combine content #:strut)))

\markup { Standard behaviour: }

\markup \override #'(baseline-skip . 0) \column {
  aco
  aCo
  ago
  aco
}

\markup { With struts: }

\markup \override #'(baseline-skip . 0) \column \strutify {
  aco
  aCo
  ago
  aco
}

But of course, this is only a sugercoated version of what you're doing already.

Lukas




reply via email to

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