1 Commits

Author SHA1 Message Date
tux
d49fc0c1b6 new engraver for spacing in chordlyrics 2025-08-31 09:47:50 +02:00
3 changed files with 17 additions and 45 deletions

View File

@@ -2,13 +2,11 @@
poetPrefix = "Worte:" poetPrefix = "Worte:"
composerPrefix = "Weise:" composerPrefix = "Weise:"
compositionPrefix = "Satz:" compositionPrefix = "Satz:"
adaptionTextPrefix = "Bearbeitung Text:" adaptionPrefix = "Bearbeitung:"
adaptionMusicPrefix = "Bearbeitung Musik:"
poetAndComposerEqualPrefix = "Worte und Weise:" poetAndComposerEqualPrefix = "Worte und Weise:"
voicePrefix = "Stimme:" voicePrefix = "Stimme:"
versePrefix = "Strophe:" versePrefix = "Strophe:"
translationPrefix = "Übersetzung:" translationPrefix = "Übersetzung:"
pronunciationPrefix = "Aussprache:"
interludePrefix = "Zwischenspiel:" interludePrefix = "Zwischenspiel:"
bridgePrefix = "Bridge:" bridgePrefix = "Bridge:"
@@ -59,16 +57,16 @@
(interpret-markup-list layout props (interpret-markup-list layout props
(append (append
(if (and poet-and-composer-oneliner (< (interval-length (ly:stencil-extent (interpret-markup layout props poet-and-composer-oneliner) X)) current-line-width)) (if (and poet-and-composer-oneliner (< (interval-length (ly:stencil-extent (interpret-markup layout props poet-and-composer-oneliner) X)) current-line-width))
(string-with-paragraphs->markuplist "" poet-and-composer-oneliner) (list poet-and-composer-oneliner)
(string-with-paragraphs->markuplist "" (string-append (make-wordwrap-string-internal-markup-list #t (string-append
(if poet-with-year (string-append "\n\n" poet-with-year) "") (if poet-with-year (string-append "\n\n" poet-with-year) "")
(if composer-with-year (string-append "\n\n" composer-with-year) "") (if composer-with-year (string-append "\n\n" composer-with-year) "")
))) )))
(string-with-paragraphs->markuplist "" (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) "")))
(string-with-paragraphs->markuplist "" infotext) (string-with-paragraphs->markuplist "" infotext)
(string-with-paragraphs->markuplist (string-append (ly:output-def-lookup layout 'translationPrefix) " ") translation) (string-with-paragraphs->markuplist "Übersetzung: " translation)
(string-with-paragraphs->markuplist (string-append (ly:output-def-lookup layout 'pronunciationPrefix) " ") pronunciation) (string-with-paragraphs->markuplist "Aussprache: " pronunciation)
))))) )))))
(make-null-markup) (make-null-markup)
) )

View File

@@ -102,28 +102,16 @@
(verseComposerData (find-author-id-with-part-numbers 'meloverse authors)) (verseComposerData (find-author-id-with-part-numbers 'meloverse authors))
(voiceComposerData (find-author-id-with-part-numbers 'voice authors)) (voiceComposerData (find-author-id-with-part-numbers 'voice authors))
(compositionIds (find-author-ids-by 'composition authors)) (compositionIds (find-author-ids-by 'composition authors))
(adaptionTextIds (find-author-ids-by 'adaption_text authors)) (adaptionIds (find-author-ids-by 'adaption authors))
(adaptionMusicIds (find-author-ids-by 'adaption_music authors))
(bridgeIds (find-author-ids-by 'bridge authors)) (bridgeIds (find-author-ids-by 'bridge authors))
(interludeIds (find-author-ids-by 'interlude authors)) (interludeIds (find-author-ids-by 'interlude authors))
(year_text (chain-assoc-get 'header:year_text props #f)) (year_text (chain-assoc-get 'header:year_text props #f))
(year_translation (chain-assoc-get 'header:year_translation props #f)) (year_translation (chain-assoc-get 'header:year_translation props #f))
(year_melody (chain-assoc-get 'header:year_melody props #f)) (year_melody (chain-assoc-get 'header:year_melody props #f))
(year_composition (chain-assoc-get 'header:year_composition props #f)) (year_composition (chain-assoc-get 'header:year_composition props #f))
(year_adaption_text (chain-assoc-get 'header:year_adaption_text props #f)) (year_adaption (chain-assoc-get 'header:year_adaption props #f))
(year_adaption_music (chain-assoc-get 'header:year_adaption_music props #f))
) )
(if (and (if (and (equal? poetIds composerIds) (null? translatorIds) (null? versePoetData) (null? verseComposerData) (null? voiceComposerData) (null? compositionIds) (null? adaptionIds) (null? bridgeIds) (null? interludeIds))
(equal? poetIds composerIds)
(null? translatorIds)
(null? versePoetData)
(null? verseComposerData)
(null? voiceComposerData)
(null? compositionIds)
(null? adaptionTextIds)
(null? adaptionMusicIds)
(null? bridgeIds)
(null? interludeIds))
(list (list
(join-present (list (join-present (list
(render-contribution-group (ly:output-def-lookup layout 'poetAndComposerEqualPrefix) poetIds) (render-contribution-group (ly:output-def-lookup layout 'poetAndComposerEqualPrefix) poetIds)
@@ -145,20 +133,9 @@
(render-contribution-group (ly:output-def-lookup layout 'translationPrefix) translatorIds) (render-contribution-group (ly:output-def-lookup layout 'translationPrefix) translatorIds)
year_translation year_translation
) ", ") ) ", ")
(join-present (list
(render-contribution-group (ly:output-def-lookup layout 'adaptionTextPrefix) adaptionTextIds)
year_adaption_text
) ", ")
) "; ") ) "; ")
)) ))
(if (and (if (and (null? composerIds) (null? compositionIds) (null? adaptionIds) (null? verseComposerData) (null? voiceComposerData) (null? bridgeIds) (null? interludeIds)) #f
(null? composerIds)
(null? compositionIds)
(null? adaptionMusicIds)
(null? verseComposerData)
(null? voiceComposerData)
(null? bridgeIds)
(null? interludeIds)) #f
(string-append (string-append
(ly:output-def-lookup layout 'composerPrefix) (ly:output-def-lookup layout 'composerPrefix)
" " " "
@@ -174,8 +151,8 @@
year_composition year_composition
) ", ") ) ", ")
(join-present (list (join-present (list
(render-contribution-group (ly:output-def-lookup layout 'adaptionMusicPrefix) adaptionMusicIds) (render-contribution-group (ly:output-def-lookup layout 'adaptionPrefix) adaptionIds)
year_adaption_music year_adaption
) ", ") ) ", ")
(render-contribution-group (ly:output-def-lookup layout 'bridgePrefix) bridgeIds) (render-contribution-group (ly:output-def-lookup layout 'bridgePrefix) bridgeIds)
(render-contribution-group (ly:output-def-lookup layout 'interludePrefix) interludeIds) (render-contribution-group (ly:output-def-lookup layout 'interludePrefix) interludeIds)

View File

@@ -381,8 +381,7 @@ headerToTOC = #(define-music-function (parser location header label) (ly:book? s
(verseComposerData (find-author-id-with-part-numbers 'meloverse authors)) (verseComposerData (find-author-id-with-part-numbers 'meloverse authors))
(voiceComposerData (find-author-id-with-part-numbers 'voice authors)) (voiceComposerData (find-author-id-with-part-numbers 'voice authors))
(compositionIds (find-author-ids-by 'composition authors)) (compositionIds (find-author-ids-by 'composition authors))
(adaptionTextIds (find-author-ids-by 'adaption_text authors)) (adaptionIds (find-author-ids-by 'adaption authors))
(adaptionMusicIds (find-author-ids-by 'adaption_music authors))
(bridgeIds (find-author-ids-by 'bridge authors)) (bridgeIds (find-author-ids-by 'bridge authors))
(interludeIds (find-author-ids-by 'interlude authors))) (interludeIds (find-author-ids-by 'interlude authors)))
(map csv-escape (map csv-escape
@@ -398,15 +397,14 @@ headerToTOC = #(define-music-function (parser location header label) (ly:book? s
(headervar-or-empty 'categorytitle) (headervar-or-empty 'categorytitle)
(headervar-or-empty 'categories) (headervar-or-empty 'categories)
(format-authors (append poetIds adaptionTextIds (map car versePoetData))) (format-authors (append poetIds (map car versePoetData)))
(format-authors translatorIds) (format-authors translatorIds)
(format-authors (append composerIds compositionIds adaptionMusicIds bridgeIds interludeIds (map car voiceComposerData) (map car verseComposerData))) (format-authors (append composerIds compositionIds adaptionIds bridgeIds interludeIds (map car voiceComposerData) (map car verseComposerData)))
(headervar-or-empty 'year_text) (headervar-or-empty 'year_text)
(headervar-or-empty 'year_melody) (headervar-or-empty 'year_melody)
(headervar-or-empty 'year_translation) (headervar-or-empty 'year_translation)
(headervar-or-empty 'year_composition) (headervar-or-empty 'year_composition)
(headervar-or-empty 'year_adaption_text) (headervar-or-empty 'year_adaption)
(headervar-or-empty 'year_adaption_music)
(headervar-or-empty 'copyright) (headervar-or-empty 'copyright)
(headervar-or-empty 'source) (headervar-or-empty 'source)
(format-info-paragraphs (headervar-or-empty 'infotext)) (format-info-paragraphs (headervar-or-empty 'infotext))
@@ -431,8 +429,7 @@ headerToTOC = #(define-music-function (parser location header label) (ly:book? s
"year_melody" "year_melody"
"year_translation" "year_translation"
"year_composition" "year_composition"
"year_adaption_text" "year_adaption"
"year_adaption_music"
"copyright" "copyright"
"source" "source"
"infotext" "infotext"