1 ;;;; titling.scm -- titling functions
3 ;;;; source file of the GNU LilyPond music typesetter
5 ;;;; (c) 2004--2007 Jan Nieuwenhuizen <janneke@gnu.org>
6 ;;;; Han-Wen Nienhuys <hanwen@xs4all.nl>
8 (define-public (layout-extract-page-properties layout)
9 (list (append `((line-width . ,(ly:paper-get-number
11 (ly:output-def-lookup layout 'text-font-defaults))))
15 (define-public ((marked-up-headfoot what-odd what-even)
16 layout scopes page-number is-book-last-page is-part-last-page)
18 "Read variables WHAT-ODD, WHAT-EVEN from LAYOUT, and interpret them
19 as markup. The PROPS argument will include variables set in SCOPES and
20 page:last?, page:page-number-string and page:page-number
24 (ly:output-def-lookup layout sym))
26 (define (interpret-in-page-env potential-markup)
27 (if (markup? potential-markup)
28 (let* ((alists (map ly:module->alist scopes))
36 (symbol->string (car entry))))
43 (ly:modules-lookup scopes 'tagline
44 (ly:output-def-lookup layout 'tagline)))
45 (cons 'page:last? is-book-last-page)
46 (cons 'page:part-last? is-part-last-page)
47 (cons 'page:page-number-string
48 (number->string page-number))
49 (cons 'page:page-number page-number)))
53 (layout-extract-page-properties layout))))
55 (interpret-markup layout props potential-markup))
59 (interpret-in-page-env
60 (if (and (even? page-number)
61 (markup? (get what-even)))
65 (define-public ((marked-up-title what) layout scopes)
66 "Read variables WHAT from SCOPES, and interpret it as markup. The
67 PROPS argument will include variables set in SCOPES (prefixed with
72 (let ((x (ly:modules-lookup scopes sym)))
73 (if (markup? x) x #f)))
75 (let* ((alists (map ly:module->alist scopes))
83 (symbol->string (car entry))))
87 (props (append prefixed-alist
88 (layout-extract-page-properties layout)))
90 (markup (ly:output-def-lookup layout what)))
93 (interpret-markup layout props markup)
94 (ly:make-stencil '() '(1 . -1) '(1 . -1)))))