1 ;;;; titling.scm -- titling functions
3 ;;;; source file of the GNU LilyPond music typesetter
5 ;;;; (c) 2004--2005 Jan Nieuwenhuizen <janneke@gnu.org>
6 ;;;; Han-Wen Nienhuys <hanwen@cs.uu.nl>
8 (define-public (layout-extract-page-properties layout)
9 (list (append `((linewidth . ,(ly:paper-get-number
11 (ly:output-def-lookup layout 'text-font-defaults))))
15 (define-public ((marked-up-headfoot what-odd what-even) layout scopes page-number last?)
17 "Read variables WHAT-ODD, WHAT-EVEN from LAYOUT, and interpret them
18 as markup. The PROPS argument will include variables set in SCOPES and
19 page:last?, page:page-number-string and page:page-number
23 (ly:output-def-lookup layout sym))
25 (define (interpret-in-page-env potential-markup)
26 (if (markup? potential-markup)
27 (let* ((alists (map ly:module->alist scopes))
35 (symbol->string (car entry))))
39 (tagline (ly:modules-lookup scopes 'tagline))
40 (default-tagline (ly:output-def-lookup layout 'tagline))
46 ((markup? tagline) tagline)
47 ((markup? default-tagline) default-tagline)
49 (cons 'page:last? last?)
50 (cons 'page:page-number-string
51 (number->string page-number))
52 (cons 'page:page-number page-number)))
56 (layout-extract-page-properties layout))))
58 (interpret-markup layout props potential-markup))
62 (interpret-in-page-env
63 (if (and (even? page-number)
64 (markup? (get what-even)))
68 (define-public ((marked-up-title what) layout scopes)
69 "Read variables WHAT from SCOPES, and interpret it as markup. The
70 PROPS argument will include variables set in SCOPES (prefixed with
75 (let ((x (ly:modules-lookup scopes sym)))
76 (if (markup? x) x #f)))
78 (let* ((alists (map ly:module->alist scopes))
86 (symbol->string (car entry))))
90 (props (append prefixed-alist
91 (layout-extract-page-properties layout)))
93 (markup (ly:output-def-lookup layout what)))
96 (interpret-markup layout props markup)
97 (ly:make-stencil '() '(1 . -1) '(1 . -1)))))