From 14e01900c27d8caa866e480c49810f7eead7e89b Mon Sep 17 00:00:00 2001 From: Christoph Wagner Date: Wed, 1 Nov 2023 09:48:52 +0100 Subject: [PATCH] songinfo Ausrichtung einfacher anpassbar gemacht --- basic_format_and_style_settings.ly | 1 + footer_with_songinfo.ly | 14 +++++++++----- general_include.ly | 1 - 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/basic_format_and_style_settings.ly b/basic_format_and_style_settings.ly index 7c9e9bb..03f802c 100644 --- a/basic_format_and_style_settings.ly +++ b/basic_format_and_style_settings.ly @@ -2,6 +2,7 @@ \include "default_author_style.ly" \include "default_songinfo_style.ly" +\include "footer_with_songinfo.ly" \include "styles.ly" \include #(ly:format "styles/~a.ly" songStyle) diff --git a/footer_with_songinfo.ly b/footer_with_songinfo.ly index 6ff3cc1..9735721 100644 --- a/footer_with_songinfo.ly +++ b/footer_with_songinfo.ly @@ -32,8 +32,7 @@ (poetId (chain-assoc-get 'header:poetId props (if songId (songinfo-from songId "poet") #f))) (composerId (chain-assoc-get 'header:composerId props (if songId (songinfo-from songId "composer") #f))) (poet-and-composer-same (equal? poetId composerId))) - (let ((blockwidth (* (chain-assoc-get 'header:songinfo-size-factor props 0.9) (ly:output-def-lookup layout 'line-width))) - (infotext (chain-assoc-get 'header:infotext props (chain-assoc-get 'header:songinfo props #f))) + (let ((infotext (chain-assoc-get 'header:infotext props (chain-assoc-get 'header:songinfo props #f))) (poet-maybe-with-composer (chain-assoc-get 'header:poet props (if poetId (if poet-and-composer-same (format-poet-and-composer poetId) (format-poet poetId)) #f))) (composer (chain-assoc-get 'header:composer props (if (and composerId (not poet-and-composer-same)) (format-composer composerId) #f))) (copyright (chain-assoc-get 'header:copyright props #f)) @@ -59,7 +58,6 @@ #:override (cons 'songinfo:year_melody (if (and year_melody (not (and (string? year_melody) (string-null? year_melody)))) year_melody #f)) #:override '(baseline-skip . 3.0) - #:override `(line-width . ,blockwidth) #:fontsize songInfoFontSize #:sans (ly:output-def-lookup layout 'songinfoMarkup) @@ -77,6 +75,12 @@ ) )))) +#(define-markup-command (fractional-line-width layout props arg)(markup?) + (interpret-markup layout props + (make-override-markup + `(line-width . ,(* (chain-assoc-get 'header:songinfo-size-factor props 0.9) (ly:output-def-lookup layout 'line-width))) + arg))) + \paper { print-first-page-number = ##t first-page-number = #0 @@ -84,14 +88,14 @@ oddFooterMarkup = \markup { \fill-line { \line { \null } - \line { \general-align #Y #DOWN \print-songinfo } + \line { \general-align #Y #DOWN \fractional-line-width \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 { \general-align #Y #DOWN \fractional-line-width \print-songinfo } \line { \null } } } diff --git a/general_include.ly b/general_include.ly index d1f0933..edc4f7b 100644 --- a/general_include.ly +++ b/general_include.ly @@ -12,7 +12,6 @@ \include #(if (< (list-ref (ly:version) 1) 25) "legacy-lilypond-compatibility-pre-2.25.ly" "void.ly") \include "eps_file_from_song_dir.ly" \include "title_with_category_images.ly" -\include "footer_with_songinfo.ly" \include "auto_rest_merging.ly" \include "chord_settings.ly" \include "transposition.ly"