From 463d61fbd9743eb5bdb258fce3310a6313abf7f1 Mon Sep 17 00:00:00 2001 From: Christoph Wagner Date: Mon, 22 Dec 2025 11:29:32 +0100 Subject: [PATCH] fix customize layout sizing --- private_includes/base/basic_format_and_style_settings.ily | 5 +++++ private_includes/base/verses_with_chords.ily | 7 ++++--- public_includes/layout_bottom.ily | 4 +--- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/private_includes/base/basic_format_and_style_settings.ily b/private_includes/base/basic_format_and_style_settings.ily index f0756b9..37c64d4 100644 --- a/private_includes/base/basic_format_and_style_settings.ily +++ b/private_includes/base/basic_format_and_style_settings.ily @@ -79,6 +79,11 @@ generalLayout = \layout { } } +#(define (customized-layout base-layout) + (let + ((custom-size (ly:output-def-lookup base-layout 'size #f))) + (if custom-size (layout-set-staff-size custom-size)))) + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% kleine Helferlein: diff --git a/private_includes/base/verses_with_chords.ily b/private_includes/base/verses_with_chords.ily index ceb8ef3..ccd77f9 100644 --- a/private_includes/base/verses_with_chords.ily +++ b/private_includes/base/verses_with_chords.ily @@ -68,7 +68,7 @@ \size-box-to-box-style-dependent ##t ##f \general-align #X #LEFT \override #`(direction . ,UP) \override #'(baseline-skip . 1) \dir-column \chord-alignment-style-dependent { \pad-to-box #'(0 . 0) #`(0 . ,(- verse-text-chord-distance 0.8)) { #text } - \size-box-to-box ##f ##t #uptext \score { \chords { g4:m a } \layout { $verselayout } } + \size-box-to-box ##f ##t #uptext \score { \chords { g4:m a } \layout { $verselayout #(customized-layout verselayout) } } } #text } @@ -89,7 +89,7 @@ (if (and (string? arg) (string-null? arg)) " " #{\markup - \score { \new Lyrics { \lyricmode { #(if (ly:music? arg) arg #{ \set stanza = #arg #}) "" } } \layout { $verselayout } } + \score { \new Lyrics { \lyricmode { #(if (ly:music? arg) arg #{ \set stanza = #arg #}) "" } } \layout { $verselayout #(customized-layout verselayout) } } #} ))) @@ -141,7 +141,7 @@ (make-wrap-newline-markup (ly:regex-replace (ly:make-regex "\\(( *)([^,()]*)( *),([^)]*)\\)") (ly:regex-replace (ly:make-regex "(([^ \n]*\\([^()]*,[^()]+\\)[^ \n(]*)+)") (handle-custom-newlines custom-verse-breaks verse) " \\concat { " 1 " } ") - "\\textup \\line { \"" 1 "\" " 2 " \"" 3 "\" } \\score { " transp " \\chords { s4 " 4 " } \\layout { $verselayout } }") + "\\textup \\line { \"" 1 "\" " 2 " \"" 3 "\" } \\score { " transp " \\chords { s4 " 4 " } \\layout { $verselayout #(customized-layout verselayout) } }") ) )))) @@ -367,6 +367,7 @@ Chord_lyrics_spacing_engraver = >> \layout { $verselayout + #(customized-layout verselayout) ragged-right = ##t \context { \Lyrics diff --git a/public_includes/layout_bottom.ily b/public_includes/layout_bottom.ily index 2afffb6..4681a3c 100644 --- a/public_includes/layout_bottom.ily +++ b/public_includes/layout_bottom.ily @@ -2,9 +2,7 @@ MUSIC = { \transposable #TRANSPOSITION \MUSIC } LAYOUT = \layout { \LAYOUT - #(let - ((custom-size (ly:output-def-lookup LAYOUT 'size #f))) - (if custom-size (layout-set-staff-size custom-size))) + #(customized-layout LAYOUT) } verselayout = \layout {