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