From 4a20fcc40b2d9cdce35fbb5aa388ff3a6482a7df Mon Sep 17 00:00:00 2001 From: tux Date: Tue, 8 Aug 2023 19:21:51 +0200 Subject: [PATCH] use new lilypond 2.25 regexes and font definitions --- basic_format_and_style_settings.ly | 10 ++-------- book_include.ly | 6 +++--- chord_settings.ly | 2 +- verses_with_chords.ly | 23 +++++++++-------------- 4 files changed, 15 insertions(+), 26 deletions(-) diff --git a/basic_format_and_style_settings.ly b/basic_format_and_style_settings.ly index 4cd80ef..5545af6 100644 --- a/basic_format_and_style_settings.ly +++ b/basic_format_and_style_settings.ly @@ -8,15 +8,9 @@ #(set-default-paper-size songFormatAndSize) #(set-global-staff-size globalSize) -#(define (default-pango size) - (make-pango-font-tree - songChordFont - songLyricFont - "Luxi Mono" - (/ size 20))) - \paper { - #(define fonts (default-pango globalSize)) + property-defaults.fonts.serif = \songChordFont + property-defaults.fonts.sans = \songLyricFont %annotate-spacing = ##t % spacing stuff lyric-size = #lyricSize diff --git a/book_include.ly b/book_include.ly index 1c5a1ce..9fc7733 100644 --- a/book_include.ly +++ b/book_include.ly @@ -217,16 +217,16 @@ songs = %%%%%%%%%%%%%%%%%%%%%%%%%%% %% Include Images once and reference them: #(define bbox-regexp - (make-regexp "%%BoundingBox:[ \t]+([0-9-]+)[ \t]+([0-9-]+)[ \t]+([0-9-]+)[ \t]+([0-9-]+)")) + (ly:make-regex "%%BoundingBox:[ \t]+([0-9-]+)[ \t]+([0-9-]+)[ \t]+([0-9-]+)[ \t]+([0-9-]+)")) #(define (get-postscript-bbox string) "Extract the bbox from STRING, or return #f if not present." (let* - ((match (regexp-exec bbox-regexp string))) + ((match (ly:regex-exec bbox-regexp string))) (if match (map (lambda (x) - (string->number (match:substring match x))) + (string->number (ly:regex-match-substring match x))) (cdr (iota 5))) #f))) diff --git a/chord_settings.ly b/chord_settings.ly index c6d606b..befee4f 100644 --- a/chord_settings.ly +++ b/chord_settings.ly @@ -65,7 +65,7 @@ generalLayout = \layout { \semiGermanChords \override ChordName.font-size = \songScoreChordFontSize \override ChordName.font-series = \songChordFontSeries - \override ChordName.font-family = #'roman + \override ChordName.font-family = #'sans chordNameLowercaseMinor = ##t chordChanges = ##t % eigenen chordRootNamer damit F# = Fis und Gb = Ges (also alteration ausgeschrieben) diff --git a/verses_with_chords.ly b/verses_with_chords.ly index 957ecee..afc9a1b 100644 --- a/verses_with_chords.ly +++ b/verses_with_chords.ly @@ -1,18 +1,13 @@ -% guile regular expressions aktivieren: -#(use-modules (ice-9 regex)) - % parsing line by line #(define-markup-command (wrap-newline layout props text) (string?) "Text Zeile für Zeile parsen" (interpret-markup layout props #{ \markup { \column { - $(let ((verse-markup-string (string-append "\\line { " - (regexp-substitute/global #f "\n" - text - 'pre " } \\line { " 'post ) + $(let ((verse-markup-string ( + string-append "\\line { " + (ly:regex-replace (ly:make-regex "\n") text " } \\line { ") " \\size-box-to-box ##f ##t \"\" \"Agj\" }" ))) - ;(ly:parse-string-expression (if (< (list-ref (ly:version) 1) 19) (ly:parser-clone parser) (ly:parser-clone)) verse-markup-string)) - (if (< (list-ref (ly:version) 1) 19) (ly:parser-include-string parser verse-markup-string) (ly:parser-include-string verse-markup-string))) + (ly:parser-include-string verse-markup-string)) }}#} ) ) @@ -116,10 +111,10 @@ (interpret-markup layout props (markup #:override `(baseline-skip . ,songTextLineHeigth) #:anchor-x-between #:stanza stanza (make-wrap-newline-markup - (regexp-substitute/global #f "\\(( *)([^,()]*)( *),([^)]*)\\)" - (regexp-substitute/global #f "(([^ \n]*\\([^()]*\\)[^ \n]*)+)" verse - 'pre " \\concat { " 1 " } " 'post) - 'pre "\\textup \\line { \"" 1 "\" " 2 " \"" 3 "\" } \\score { \\transposable " transp " \\chords { s4 " 4 " } \\layout { \\verseChordLayout } }" 'post)) + (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 } }") + ) )))) % Kompletter Vers aus dem Akkorde entfernt werden @@ -127,7 +122,7 @@ "Vers ohne Akkorde" (interpret-markup layout props (markup #:override '(baseline-skip . 3.0) #:anchor-x-between #:stanza stanza - #:wrap-newline (regexp-substitute/global #f "\\(([^,]*),([^)]*)\\)" verse 'pre 1 'post ) + #:wrap-newline (ly:regex-replace (ly:make-regex "\\(([^,]*),([^)]*)\\)") verse 1) ) ) )