From ede5568962f8d037144dd615022538cea3df23e1 Mon Sep 17 00:00:00 2001 From: tux Date: Wed, 17 Sep 2025 08:08:40 +0200 Subject: [PATCH] be able to format everything of the songinfo with markup --- .../base/default_songinfo_style.ily | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/private_includes/base/default_songinfo_style.ily b/private_includes/base/default_songinfo_style.ily index fedffab..31ffd6f 100644 --- a/private_includes/base/default_songinfo_style.ily +++ b/private_includes/base/default_songinfo_style.ily @@ -8,6 +8,7 @@ voicePrefix = "Stimme:" versePrefix = "Strophe:" translationPrefix = "Übersetzung:" + pronunciationPrefix = "Aussprache:" interludePrefix = "Zwischenspiel:" bridgePrefix = "Bridge:" @@ -43,8 +44,6 @@ (year_melody (chain-assoc-get 'songinfo:year_melody props #f)) (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)) - (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))) (string-with-paragraphs->markuplist (lambda (prefix text) (if text (apply append @@ -53,21 +52,25 @@ (make-wordwrap-internal-markup-list #t #{ \markuplist { $(ly:parser-include-string paragraph) } #})) (ly:regex-split (ly:make-regex "\n[ \t\n]*\n[ \t\n]*") (string-append prefix text)))) - '())))) + '()))) + (poet-and-composer-markup-list + (string-with-paragraphs->markuplist "" (string-append + (if poet-with-year (string-append "\n\n" poet-with-year) "") + (if composer-with-year (string-append "\n\n" composer-with-year) "") + ))) + (poet-and-composer-oneliner (if (and poet-with-year composer-with-year) (make-line-markup (cons (cadr poet-and-composer-markup-list) (cons between-poet-and-composer-markup (cddr poet-and-composer-markup-list)))) #f)) + (current-line-width (chain-assoc-get 'line-width props (ly:output-def-lookup layout 'line-width)))) (stack-lines DOWN 0.0 (chain-assoc-get 'baseline-skip props) (interpret-markup-list layout props (append (if (and poet-and-composer-oneliner (< (interval-length (ly:stencil-extent (interpret-markup layout props poet-and-composer-oneliner) X)) current-line-width)) (list poet-and-composer-oneliner) - (make-wordwrap-string-internal-markup-list #t (string-append - (if poet-with-year (string-append "\n\n" poet-with-year) "") - (if composer-with-year (string-append "\n\n" composer-with-year) "") - ))) - (make-wordwrap-string-internal-markup-list #t (string-append + poet-and-composer-markup-list) + (string-with-paragraphs->markuplist "" (string-append (if copyright (string-append "\n\n© " copyright) ""))) (string-with-paragraphs->markuplist "" infotext) - (string-with-paragraphs->markuplist "Übersetzung: " translation) - (string-with-paragraphs->markuplist "Aussprache: " pronunciation) + (string-with-paragraphs->markuplist (string-append (ly:output-def-lookup layout 'translationPrefix) " ") translation) + (string-with-paragraphs->markuplist (string-append (ly:output-def-lookup layout 'pronunciationPrefix) " ") pronunciation) ))))) (make-null-markup) )