lilypond-common-includes/footer_with_songinfo.ly

61 lines
2.6 KiB
Plaintext
Raw Normal View History

#(define-markup-command (print-songinfo layout props) ()
(interpret-markup layout props
(let (
(blockwidth (* (chain-assoc-get 'header:songinfo-size-factor props 0.9) (ly:output-def-lookup layout 'line-width)))
(infotext (chain-assoc-get 'header:songinfo props #f))
(poet (chain-assoc-get 'header:poet props #f))
(composer (chain-assoc-get 'header:composer props #f))
(poet-and-composer-stacked (chain-assoc-get 'header:poet-and-composer-stacked props songInfoPoetAndComposerStacked))
(between-poet-and-composer-markup (chain-assoc-get 'header:between-poet-and-composer-markup props (make-hspace-markup 3)))
(copyright (chain-assoc-get 'header:copyright props #f)))
(if (chain-assoc-get 'page:is-bookpart-last-page props #f)
(markup #:override '(baseline-skip . 3.0) (
make-fontsize-markup songInfoFontSize
(make-sans-markup
;%\override #'(line-width . 92) \wordwrap-field #symbol
(make-column-markup (list
(make-line-markup
(list
(if (and poet (not (and (string? poet) (string-null? poet)))) (markup poet between-poet-and-composer-markup) "")
(if (and composer (not poet-and-composer-stacked)) composer ""))
)
(if (and composer poet-and-composer-stacked) (make-line-markup (list composer)) "")
(make-override-markup `(line-width . ,blockwidth) (make-justify-string-markup (string-append
(if (and copyright (not (and (string? copyright) (string-null? copyright)))) (ly:format "© ~a\n\n" copyright) "")
(if infotext infotext "")
)))
)))
)
)
(make-null-markup))))
)
#(define-markup-command (print-pagenumber layout props)()
(let ((label (chain-assoc-get 'header:myindexlabel props #f)))
(interpret-markup layout props
(markup #:large #:bold
(if label
(make-custom-page-number-markup label (chain-assoc-get 'page:page-number props 0))
(make-fromproperty-markup 'page:page-number-string)
)
))))
\paper {
print-first-page-number = ##t
first-page-number = #0
oddFooterMarkup = \markup {
\fill-line {
\line { \null }
\line { \general-align #Y #DOWN \print-songinfo }
\line { \if \should-print-page-number \print-pagenumber }
}
}
evenFooterMarkup = \markup {
\fill-line {
\line { \if \should-print-page-number \print-pagenumber }
\line { \general-align #Y #DOWN \print-songinfo }
\line { \null }
}
}
}