Am 20.04.2018 um 07:58 schrieb Partitura Organum:
>
>
> On 19-4-2018 22:19, Thomas Morley wrote:
>> The function expects `text' to be a string. So
>> (1) use wordwrap-string
>> (2) without {}
>
> Thank you, now it works. And I learned how to do calculations in scheme
> along the way as well. So the narrator function should be
>
> narrator=#(define-music-function
> (dim text) (number? string?)
> #{
> s1^\markup
> \with-dimensions #(cons 0 (+ dim 2)) #'(0 . 0)
> \whiteout
> \override #(cons (quote line-width) dim)
> \translate #'(0 . -1.5)
> \wordwrap-string #text
> #})
Glad to here that's working for you. Unfortunately this doesn't work for
me. I reordered the lines a bit because I think that the override
changes the line-width property of wordwrap-string. But the reordering
doesn't change the ouput. The text crosses several measures in this
example. I thought that \with-dimensions defines the extend of the
markup. But this doesn't affect the measure width.
Regards
Helge
%%BEGIN
\version "2.19.65"
narrator=#(define-music-function (dim text) (number? string?)
#{
s1^\markup
\with-dimensions #(cons 0 (+ dim 2)) #'(0 . 0)
\whiteout
\translate #'(0 . -1.5)
\override #(cons (quote line-width) dim )
\wordwrap-string #text
#})
{
\new PianoStaff <<
\new Staff {
s1
\narrator 30 "The brown fox jumps quickly over the lazy dog."
s1 s
}
\new Staff { s1 s s s }
>>
}
%%END
_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user