1 ;;;; titling.scm -- titling functions
3 ;;;; source file of the GNU LilyPond music typesetter
5 ;;;; (c) 2004 Jan Nieuwenhuizen <janneke@gnu.org>
6 ;;;; Han-Wen Nienhuys <hanwen@cs.uu.nl>
8 (define-public (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)
28 ((alists (map ly:module->alist scopes))
36 (symbol->string (car entry))))
41 (tagline (ly:modules-lookup scopes 'tagline))
45 (cons 'header:tagline (if (markup? tagline)
48 (cons 'page:last? last?)
49 (cons 'page:page-number-string
50 (number->string page-number))
51 (cons 'page:page-number page-number)))
55 (page-properties layout))))
57 (interpret-markup layout props potential-markup))
61 (interpret-in-page-env
62 (if (and (even? page-number)
63 (markup? (get what-even)))
67 (define-public ((marked-up-title what) layout scopes)
68 "Read variables WHAT from SCOPES, and interpret it as markup. The
69 PROPS argument will include variables set in SCOPES (prefixed with
74 (let ((x (ly:modules-lookup scopes sym)))
75 (if (markup? x) x #f)))
78 ((alists (map ly:module->alist scopes))
86 (symbol->string (car entry))))
91 (props (append prefixed-alist
92 (page-properties layout)))
94 (markup (ly:output-def-lookup layout what))
98 (interpret-markup layout props markup)
99 (ly:make-stencil '() '(1 . -1) '(1 . -1)))