Layoutmodifikationen auch für Strophen nutzen

This commit is contained in:
tux 2023-10-29 16:25:15 +01:00
parent bedb2c0e22
commit f0010c7746
3 changed files with 18 additions and 14 deletions

View File

@ -94,14 +94,6 @@ generalLayout = \layout {
}
}
verseChordLayout = \layout {
\generalLayout
\context {
\ChordNames
\override ChordName.font-size = \songTextChordFontSize
}
}
% Akkord mit Bunddiagramm anzeigen
#(define-markup-command (fret-chord layout props fret chord) (string? string?)
(interpret-markup layout props

View File

@ -3,6 +3,15 @@
MUSIC = { \transposable \MUSIC }
verselayout = \layout {
\LAYOUT
\context {
\ChordNames
\override ChordName.font-size = \songTextChordFontSize
}
}
TEXT = \markuplist { \override #`(verselayout . verselayout) \TEXT }
% nur Output wenn noStandaloneOutput auf false steht
output = #(if (not noStandaloneOutput)
#{

View File

@ -66,17 +66,18 @@
% Text über Text mittig darstellen
#(define-markup-command (textup layout props text uptext) (markup? markup?)
"Markup über Text mittig darstellen."
(let ((verselayout (chain-assoc-get 'verselayout props generalLayout)))
(interpret-markup layout props
#{\markup {
\size-box-to-box-style-dependent ##t ##f
\general-align #X #LEFT \override #`(direction . ,UP) \override #'(baseline-skip . 1.0) \dir-column \chord-alignment-style-dependent {
\pad-to-box #'(0 . 0) #'(0 . 2.0) { #text }
\size-box-to-box ##f ##t #uptext \score { \chords { g4:m a } \layout { \generalLayout } }
\size-box-to-box ##f ##t #uptext \score { \chords { g4:m a } \layout { \verselayout } }
}
#text
}
#}
))
)))
#(define-markup-command (anchor-x-between layout props arga argb)
(markup? markup?)
@ -88,13 +89,14 @@
#(define-markup-command (stanza-raw layout props arg)
(markup?)
(let ((verselayout (chain-assoc-get 'verselayout props generalLayout)))
(interpret-markup layout props
(if (and (string? arg) (string-null? arg))
" "
#{\markup
\score { \new Lyrics { \lyricmode { \set stanza = #arg "" } } \layout { \generalLayout } }
\score { \new Lyrics { \lyricmode { \set stanza = #arg "" } } \layout { \verselayout } }
#}
)))
))))
#(define-markup-command (stanza layout props arg)
(markup?)
@ -108,13 +110,14 @@
(let* ((fromto (chain-assoc-get 'transposition props #f))
(transp (if fromto
(string-append "\\transpose " (car fromto) " " (cdr fromto))
"")))
""))
(verselayout (chain-assoc-get 'verselayout props generalLayout)))
(interpret-markup layout props
(markup #:override `(baseline-skip . ,(+ intraverse-vspace songTextLineHeigth)) #:anchor-x-between #:stanza stanza
(make-wrap-newline-markup
(ly:regex-replace (ly:make-regex "\\(( *)([^,()]*)( *),([^)]*)\\)")
(ly:regex-replace (ly:make-regex "(([^ \n]*\\([^()]*,[^()]+\\)[^ \n(]*)+)") verse " \\concat { " 1 " } ")
"\\textup \\line { \"" 1 "\" " 2 " \"" 3 "\" } \\score { \\transposable " transp " \\chords { s4 " 4 " } \\layout { \\verseChordLayout } }")
"\\textup \\line { \"" 1 "\" " 2 " \"" 3 "\" } \\score { \\transposable " transp " \\chords { s4 " 4 " } \\layout { \\verselayout } }")
)
))))