lilypond-user
[Top][All Lists]
Advanced

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

Re: learning (names of) markup commands in scheme: documentation


From: Lukas-Fabian Moser
Subject: Re: learning (names of) markup commands in scheme: documentation
Date: Fri, 21 Jan 2022 16:14:36 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0

Hi Bernhard,

unfortunately I don't have much time at the moment (and there's always the chance that Jean or someone else more knowledgeable than me is already working on an exhaustive answer), but there's one thing I'd like to point out:

#(define-markup-command (strut-line layout props line)
  (markup?)
  "add strut to the end of a line to ensure correct line spacing"
  (interpret-markup layout props
   (markup
    (make-combine-markup
     (make-line-markup (list line))
     (make-transparent-markup "Ij")))))

Isn't this just

#(define-markup-command (strut-line layout props line)
  (markup?)
  "add strut to the end of a line to ensure correct line spacing"
  (interpret-markup layout props
   (markup #:combine line #:transparent "Ij")))

?

Also note that your function, if called with \strut-line { hello world }, actually adds your invisible strut to every word of the line. (Just remove the make-transparent-markup in your function to see this, or, more easuily, remove the #:transparent in my version). Compare:

\markup \strut-line { hello world }
\markup \strut-line \line { hello world }

This difference (I think) originates in the way LilyPond applies markup functions to explicit markups of the form { some word and some other }, or put differently: Where the implicit \line is put, and how a function expecting a single markup is applied to a list of markups.

But note what changes if you replace the markup? predicate in your function definition by markup-list?.

Lukas





reply via email to

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