interpret songinfo with markups

This commit is contained in:
tux 2025-04-26 21:29:01 +02:00
parent 37ee497f89
commit d47ae1a66d

View File

@ -42,7 +42,16 @@
(poet-with-year (if (and poet-maybe-with-composer year_text) (string-append poet-maybe-with-composer ", " year_text) poet-maybe-with-composer)) (poet-with-year (if (and poet-maybe-with-composer year_text) (string-append poet-maybe-with-composer ", " year_text) poet-maybe-with-composer))
(composer-with-year (if (and composer year_melody) (string-append composer ", " year_melody) composer)) (composer-with-year (if (and composer year_melody) (string-append composer ", " year_melody) composer))
(poet-and-composer-oneliner (if (and poet-with-year composer-with-year) (markup poet-with-year between-poet-and-composer-markup composer-with-year) #f)) (poet-and-composer-oneliner (if (and poet-with-year composer-with-year) (markup poet-with-year between-poet-and-composer-markup composer-with-year) #f))
(current-line-width (chain-assoc-get 'line-width props (ly:output-def-lookup layout 'line-width)))) (current-line-width (chain-assoc-get 'line-width props (ly:output-def-lookup layout 'line-width)))
(string-with-paragraphs->markuplist (lambda (prefix text)
(if text
(apply append
(map
(lambda (paragraph)
(make-wordwrap-internal-markup-list #t
#{ \markuplist { $(ly:parser-include-string paragraph) } #}))
(ly:regex-split (ly:make-regex "\n[ \t\n]*\n[ \t\n]*") text)))
'()))))
(stack-lines DOWN 0.0 (chain-assoc-get 'baseline-skip props) (stack-lines DOWN 0.0 (chain-assoc-get 'baseline-skip props)
(interpret-markup-list layout props (interpret-markup-list layout props
(append (append
@ -53,10 +62,11 @@
(if composer-with-year (string-append "\n\n" composer-with-year) "") (if composer-with-year (string-append "\n\n" composer-with-year) "")
))) )))
(make-wordwrap-string-internal-markup-list #t (string-append (make-wordwrap-string-internal-markup-list #t (string-append
(if copyright (string-append "\n\n© " copyright) "") (if copyright (string-append "\n\n© " copyright) "")))
(if infotext (string-append "\n\n" infotext) "") (string-with-paragraphs->markuplist "" infotext)
(if translation (string-append "\n\nÜbersetzung: " translation) "") (string-with-paragraphs->markuplist "Übersetzung: " translation)
(if pronunciation (string-append "\n\nAussprache: " pronunciation) "")))))))) (string-with-paragraphs->markuplist "Aussprache: " pronunciation)
)))))
(make-null-markup) (make-null-markup)
) )
} }