extracted different song book styles

This commit is contained in:
tux 2023-07-22 22:07:57 +02:00
parent 01329ba9fe
commit 2ada65e0bc
5 changed files with 70 additions and 57 deletions

View File

@ -4,8 +4,6 @@
#(ly:set-option 'relative-includes #t) #(ly:set-option 'relative-includes #t)
\include "../lilypond-custom-includes/categories.ly"
compatibilityMode = compatibilityMode =
#(define-void-function (parser location) () #(define-void-function (parser location) ()
(if (< (list-ref (ly:version) 1) 24) (if (< (list-ref (ly:version) 1) 24)
@ -15,6 +13,7 @@ compatibilityMode =
\compatibilityMode \compatibilityMode
\include "./styles.ly" \include "./styles.ly"
\include #(ly:format "styles/~a.ly" songStyle)
#(define (lookup-var varsym default) #(define (lookup-var varsym default)
(let ((value (assoc-ref (hash-map->list cons (struct-ref (current-module) 0)) varsym))) (let ((value (assoc-ref (hash-map->list cons (struct-ref (current-module) 0)) varsym)))
@ -27,15 +26,7 @@ showCategoryImages = #(lookup-var 'showCategoryImages #t)
% check if we have a StandAlone compile or if variable noStandaloneOutput is set % check if we have a StandAlone compile or if variable noStandaloneOutput is set
#(define isStandAlone (not (lookup-var 'noStandaloneOutput #f))) #(define isStandAlone (not (lookup-var 'noStandaloneOutput #f)))
#(if (< (list-ref (ly:version) 1) 19) #(set-default-paper-size songFormatAndSize)
(case song-style
((börnel) (set-default-paper-size "b6" 'landscape))
((bock) (set-default-paper-size "a6" 'landscape)))
(case song-style
((börnel) (set-default-paper-size "b6landscape"))
((bock) (set-default-paper-size "a6landscape")))
)
#(set-global-staff-size globalSize) #(set-global-staff-size globalSize)
#(define-markup-command (print-songinfo layout props) () #(define-markup-command (print-songinfo layout props) ()
@ -50,9 +41,8 @@ showCategoryImages = #(lookup-var 'showCategoryImages #t)
(copyright (chain-assoc-get 'header:copyright props #f))) (copyright (chain-assoc-get 'header:copyright props #f)))
(if (chain-assoc-get 'page:is-bookpart-last-page props #f) (if (chain-assoc-get 'page:is-bookpart-last-page props #f)
(markup #:override '(baseline-skip . 3.0) ( (markup #:override '(baseline-skip . 3.0) (
make-fontsize-markup (case song-style ((börnel) -3.5) ((bock) -1.5)) make-fontsize-markup songInfoFontSize
;(symbol->keyword (case song-style ((börnel) 'roman) ((bock) 'sans))) (make-sans-markup
((lambda (m) (case song-style ((börnel) (make-roman-markup m)) ((bock) (make-sans-markup m))))
;%\override #'(line-width . 92) \wordwrap-field #symbol ;%\override #'(line-width . 92) \wordwrap-field #symbol
(make-column-markup (list (make-column-markup (list
(make-line-markup (make-line-markup
@ -96,7 +86,7 @@ showCategoryImages = #(lookup-var 'showCategoryImages #t)
\markup { \markup {
\override #'(baseline-skip . 3.5) \override #'(baseline-skip . 3.5)
\center-column { \center-column {
\override #`(font-name . ,(case song-style ((börnel) "Oregano") ((bock) "Britannic T. custom"))) { \fontsize #6 \fromproperty #'header:title } \override #`(font-name . ,songTitleFont) { \fontsize #6 \fromproperty #'header:title }
\large \bold \fromproperty #'header:subtitle \large \bold \fromproperty #'header:subtitle
\smaller \bold \fromproperty #'header:subsubtitle \smaller \bold \fromproperty #'header:subsubtitle
} }
@ -178,21 +168,11 @@ showCategoryImages = #(lookup-var 'showCategoryImages #t)
))) )))
#(define (default-pango size) #(define (default-pango size)
(case song-style (make-pango-font-tree
((börnel) songChordFont
(make-pango-font-tree ;"FreeSans" songLyricFont
;"Spectral" "Luxi Mono"
"Liberation Sans" (/ size 20)))
"TeX Gyre Heros"
"Luxi Mono"
(/ size 20)))
((bock)
(make-pango-font-tree ;"FreeSans"
;"Spectral"
"TimesNewRomanPS"
"Arial"
"Luxi Mono"
(/ size 20)))))
\paper { \paper {
#(define fonts (default-pango globalSize)) #(define fonts (default-pango globalSize))
@ -201,10 +181,10 @@ showCategoryImages = #(lookup-var 'showCategoryImages #t)
lyric-size = #lyricSize lyric-size = #lyricSize
two-sided = ##t two-sided = ##t
inner-margin = 1.5\cm inner-margin = 1.5\cm
outer-margin = #(case song-style ((börnel) 5) ((bock) 8)) outer-margin = \songMargin
binding-offset = 0\cm binding-offset = 0\cm
top-margin = #(case song-style ((börnel) 5) ((bock) 8)) top-margin = \songMargin
bottom-margin = #(case song-style ((börnel) 5) ((bock) 8)) bottom-margin = \songMargin
system-system-spacing = #'((basic-distance . 10) (padding . 1.5)) system-system-spacing = #'((basic-distance . 10) (padding . 1.5))
markup-system-spacing = #'((basic-distance . 1)) markup-system-spacing = #'((basic-distance . 1))
score-markup-spacing = #'((padding . 2)) score-markup-spacing = #'((padding . 2))
@ -377,9 +357,9 @@ generalLayout = \layout {
\context { \context {
\ChordNames \ChordNames
\semiGermanChords \semiGermanChords
\override ChordName.font-size = #(case song-style ((börnel) 0) ((bock) 3)) \override ChordName.font-size = \songScoreChordFontSize
\override ChordName.font-series = #(case song-style ((börnel) 'bold) ((bock) 'normal)) \override ChordName.font-series = \songChordFontSeries
\override ChordName.font-family = #(case song-style ((börnel) 'sans) ((bock) 'roman)) \override ChordName.font-family = #'roman
chordNameLowercaseMinor = ##t chordNameLowercaseMinor = ##t
chordChanges = ##t chordChanges = ##t
% eigenen chordRootNamer damit F# = Fis und Gb = Ges (also alteration ausgeschrieben) % eigenen chordRootNamer damit F# = Fis und Gb = Ges (also alteration ausgeschrieben)
@ -393,8 +373,8 @@ generalLayout = \layout {
\Lyrics \Lyrics
\override LyricText.font-size = #lyricSize \override LyricText.font-size = #lyricSize
\override StanzaNumber.font-size = #lyricSize \override StanzaNumber.font-size = #lyricSize
\override StanzaNumber.font-family = #(case song-style ((börnel) 'roman) ((bock) 'sans)) \override StanzaNumber.font-family = #'sans
\override LyricText.font-family = #(case song-style ((börnel) 'roman) ((bock) 'sans)) \override LyricText.font-family = #'sans
\override LyricExtender.minimum-length = 0 \override LyricExtender.minimum-length = 0
} }
\context { \context {
@ -429,7 +409,7 @@ verseChordLayout = \layout {
\generalLayout \generalLayout
\context { \context {
\ChordNames \ChordNames
\override ChordName.font-size = #(case song-style ((börnel) 0) ((bock) 2)) \override ChordName.font-size = \songTextChordFontSize
} }
} }
@ -532,9 +512,9 @@ schwarzkopf =
#(define-markup-command (size-box-to-box-style-dependent layout props use-x use-y abox bbox) #(define-markup-command (size-box-to-box-style-dependent layout props use-x use-y abox bbox)
(boolean? boolean? markup? markup?) (boolean? boolean? markup? markup?)
(interpret-markup layout props (interpret-markup layout props
(case song-style (case songTextChordAlignment
((börnel) (make-size-box-to-box-markup use-x use-y abox bbox)) ((center) (make-size-box-to-box-markup use-x use-y abox bbox))
((bock) (make-size-box-to-box-left-aligned-markup use-x use-y abox bbox))))) ((left) (make-size-box-to-box-left-aligned-markup use-x use-y abox bbox)))))
% Akkord mit Bunddiagramm anzeigen % Akkord mit Bunddiagramm anzeigen
#(define-markup-command (fret-chord layout props fret chord) (string? string?) #(define-markup-command (fret-chord layout props fret chord) (string? string?)
@ -560,9 +540,9 @@ schwarzkopf =
#(define-markup-command (chord-alignment-style-dependent layout props chord-with-text) (markup?) #(define-markup-command (chord-alignment-style-dependent layout props chord-with-text) (markup?)
(interpret-markup layout props (interpret-markup layout props
(case song-style (case songTextChordAlignment
((börnel) (make-center-align-markup chord-with-text)) ((center) (make-center-align-markup chord-with-text))
((bock) (make-left-align-markup chord-with-text))))) ((left) (make-left-align-markup chord-with-text)))))
% Text über Text mittig darstellen % Text über Text mittig darstellen
#(define-markup-command (textup layout props text uptext) (markup? markup?) #(define-markup-command (textup layout props text uptext) (markup? markup?)
@ -610,7 +590,7 @@ schwarzkopf =
(string-append "\\transpose " (car fromto) " " (cdr fromto)) (string-append "\\transpose " (car fromto) " " (cdr fromto))
""))) "")))
(interpret-markup layout props (interpret-markup layout props
(markup #:override `(baseline-skip . ,(case song-style ((börnel) 5.0) ((bock) 5.5))) #:anchor-x-between #:stanza stanza (markup #:override `(baseline-skip . ,songTextLineHeigth) #:anchor-x-between #:stanza stanza
(make-wrap-newline-markup (make-wrap-newline-markup
(regexp-substitute/global #f "\\(( *)([^,()]*)( *),([^)]*)\\)" (regexp-substitute/global #f "\\(( *)([^,()]*)( *),([^)]*)\\)"
(regexp-substitute/global #f "(([^ \n]*\\([^()]*\\)[^ \n]*)+)" verse (regexp-substitute/global #f "(([^ \n]*\\([^()]*\\)[^ \n]*)+)" verse
@ -645,7 +625,7 @@ repStop = \markup { \rotate #180 \repStart }
#(define-markup-command (verseformat layout props verse) (markup?) #(define-markup-command (verseformat layout props verse) (markup?)
"Textformatierung für Strophen" "Textformatierung für Strophen"
(interpret-markup layout props (interpret-markup layout props
((lambda (m) (case song-style ((börnel) (make-roman-markup m)) ((bock) (make-sans-markup m)))) (make-fontsize-markup (ly:output-def-lookup layout 'lyric-size) verse)) (make-sans-markup (make-fontsize-markup (ly:output-def-lookup layout 'lyric-size) verse))
) )
) )

View File

@ -1,16 +1,16 @@
#(define book-style #(define bookStyle
(if (not (defined? 'book-style)) (if (not (defined? 'bookStyle))
#f #f
book-style)) bookStyle))
#(define song-style #(define songStyle
(if (not (defined? 'song-style)) (if (not (defined? 'songStyle))
'börnel (if (not (defined? 'defaultSongStyle)) 'börnel defaultSongStyle)
song-style)) songStyle))
#(if (not (boolean? book-style)) #(if (not (boolean? bookStyle))
(set! song-style book-style)) (set! songStyle bookStyle))
#(define (bock-style layout props) #(define (bock-style layout props)
"Whether we have bockstyle or not" "Whether we have bockstyle or not"
(eq? song-style 'bock)) (eq? songStyle 'bock))

11
styles/bock.ly Normal file
View File

@ -0,0 +1,11 @@
songFormatAndSize = "a6landscape"
songMargin = 8
songInfoFontSize = -1.5
songTitleFont = "Britannic T. custom"
songChordFont = "TimesNewRomanPS"
songLyricFont = "Arial"
songChordFontSeries = #'normal
songTextChordAlignment = #'left
songScoreChordFontSize = 3
songTextChordFontSize = 2
songTextLineHeigth = 5.5

11
styles/börnel.ly Normal file
View File

@ -0,0 +1,11 @@
songFormatAndSize = "b6landscape"
songMargin = 5
songInfoFontSize = -3.5
songTitleFont = "Oregano"
songChordFont = "TeX Gyre Heros"
songLyricFont = "Liberation Sans"
songChordFontSeries = #'bold
songTextChordAlignment = #'center
songScoreChordFontSize = 0
songTextChordFontSize = \songScoreChordFontSize
songTextLineHeigth = 5

11
styles/büddel.ly Normal file
View File

@ -0,0 +1,11 @@
songFormatAndSize = "a5"
songMargin = 5
songInfoFontSize = 0
songTitleFont = "Fontin"
songChordFont = "Fontin"
songLyricFont = "FontinSans"
songChordFontSeries = #'bold
songTextChordAlignment = #'left
songScoreChordFontSize = 2
songTextChordFontSize = 2
songTextLineHeigth = 5