make customEps path resolution more robust
This commit is contained in:
@@ -6,10 +6,20 @@
|
||||
#(define-markup-command (customEps layout props ysize filename)(number? string?)
|
||||
#:properties ((songfilename ""))
|
||||
(interpret-markup layout props
|
||||
(let ((defaulttitlemarkup (ly:output-def-lookup layout 'defaultTitleMarkup))
|
||||
(filepath (if (string-null? songfilename)
|
||||
filename
|
||||
(ly:format "~a/~a/~a" songPath songfilename filename))))
|
||||
(let* ((defaulttitlemarkup (ly:output-def-lookup layout 'defaultTitleMarkup))
|
||||
;; Determine the song directory to resolve the EPS relative to.
|
||||
;; In TEXT the name arrives via the markup props (\setsongfilename),
|
||||
;; but inside MUSIC (e.g. \mark) the props do not carry it, so we
|
||||
;; fall back to the value stored in the score's \layout block.
|
||||
(layout-songfilename (ly:output-def-lookup layout 'songfilename #f))
|
||||
(songdir (cond ((not (string-null? songfilename)) songfilename)
|
||||
((and (string? layout-songfilename)
|
||||
(not (string-null? layout-songfilename)))
|
||||
layout-songfilename)
|
||||
(else #f)))
|
||||
(filepath (if songdir
|
||||
(ly:format "~a/~a/~a" songPath songdir filename)
|
||||
filename)))
|
||||
(if (file-exists? filepath)
|
||||
(make-epsfile-markup Y ysize filepath)
|
||||
(if defaulttitlemarkup
|
||||
|
||||
@@ -205,7 +205,7 @@ songs =
|
||||
\bookpart {
|
||||
$header
|
||||
\headerToTOC #header #label
|
||||
\score { $music \layout { $layout } }
|
||||
\score { $music \layout { $layout songfilename = $(symbol->string filename) } }
|
||||
$(add-text-pages text-pages)
|
||||
}
|
||||
#}))))))
|
||||
|
||||
Reference in New Issue
Block a user