X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scm%2Ftitling.scm;h=02faa385df5b0b1b9b3a4d96a3a126430366f19d;hb=bd815715c3aa550810f75529a8c0bfb092856668;hp=a72fa8085696e99e4ccbba800a6b0bb0324ba5d4;hpb=c0ba46b982f0bb0544c5267b5176c17d8d9d1447;p=lilypond.git diff --git a/scm/titling.scm b/scm/titling.scm index a72fa80856..02faa385df 100644 --- a/scm/titling.scm +++ b/scm/titling.scm @@ -1,56 +1,69 @@ -;;;; titling.scm -- titling functions +;;;; This file is part of LilyPond, the GNU music typesetter. ;;;; -;;;; source file of the GNU LilyPond music typesetter +;;;; Copyright (C) 2004--2010 Jan Nieuwenhuizen +;;;; Han-Wen Nienhuys ;;;; -;;;; (c) 2004 Jan Nieuwenhuizen -;;;; Han-Wen Nienhuys +;;;; LilyPond is free software: you can redistribute it and/or modify +;;;; it under the terms of the GNU General Public License as published by +;;;; the Free Software Foundation, either version 3 of the License, or +;;;; (at your option) any later version. +;;;; +;;;; LilyPond is distributed in the hope that it will be useful, +;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;;; GNU General Public License for more details. +;;;; +;;;; You should have received a copy of the GNU General Public License +;;;; along with LilyPond. If not, see . -(define-public (page-properties layout) - (list (append `((linewidth . ,(ly:paper-get-number - layout 'linewidth))) +(define-public (layout-extract-page-properties layout) + (list (append `((line-width . ,(ly:paper-get-number + layout 'line-width))) (ly:output-def-lookup layout 'text-font-defaults)))) ;;;;;;;;;;;;;;;;;; -(define-public ((marked-up-headfoot what-odd what-even) layout scopes page-number last?) +(define-public ((marked-up-headfoot what-odd what-even) + layout scopes page-number is-last-bookpart is-bookpart-last-page) "Read variables WHAT-ODD, WHAT-EVEN from LAYOUT, and interpret them as markup. The PROPS argument will include variables set in SCOPES and -page:last?, page:page-number-string and page:page-number -" +page:is-bookpart-last-page, page:is-last-bookpart, page:page-number-string +and page:page-number" (define (get sym) (ly:output-def-lookup layout sym)) (define (interpret-in-page-env potential-markup) (if (markup? potential-markup) - (let* - ((alists (map ly:module->alist scopes)) - (prefixed-alists - (map (lambda (alist) - (map (lambda (entry) - (cons - (string->symbol - (string-append - "header:" - (symbol->string (car entry)))) - (cdr entry) - )) - alist)) - alists)) - (pgnum-alist (list - (cons 'page:last? last?) - (cons 'page:page-number-string - (number->string page-number)) - (cons 'page:page-number page-number))) - (props (append - (list pgnum-alist) - prefixed-alists - (page-properties layout))) - ) - + (let* ((alists (map ly:module->alist scopes)) + (prefixed-alists + (map (lambda (alist) + (map (lambda (entry) + (cons + (string->symbol + (string-append + "header:" + (symbol->string (car entry)))) + (cdr entry))) + alist)) + alists)) + (pgnum-alist + (list + (cons 'header:tagline + (ly:modules-lookup scopes 'tagline + (ly:output-def-lookup layout 'tagline))) + (cons 'page:is-last-bookpart is-last-bookpart) + (cons 'page:is-bookpart-last-page is-bookpart-last-page) + (cons 'page:page-number-string + (number->string page-number)) + (cons 'page:page-number page-number))) + (props (append + (list pgnum-alist) + prefixed-alists + (layout-extract-page-properties layout)))) (interpret-markup layout props potential-markup)) - + empty-stencil)) (interpret-in-page-env @@ -69,28 +82,23 @@ PROPS argument will include variables set in SCOPES (prefixed with (let ((x (ly:modules-lookup scopes sym))) (if (markup? x) x #f))) - (let* - ((alists (map ly:module->alist scopes)) - (prefixed-alist - (map (lambda (alist) - (map (lambda (entry) - (cons - (string->symbol - (string-append - "header:" - (symbol->string (car entry)))) - (cdr entry) - )) - alist)) - alists)) - (props (append prefixed-alist - (page-properties layout))) + (let* ((alists (map ly:module->alist scopes)) + (prefixed-alist + (map (lambda (alist) + (map (lambda (entry) + (cons + (string->symbol + (string-append + "header:" + (symbol->string (car entry)))) + (cdr entry))) + alist)) + alists)) + (props (append prefixed-alist + (layout-extract-page-properties layout))) - (markup (ly:output-def-lookup layout what)) - ) + (markup (ly:output-def-lookup layout what))) (if (markup? markup) (interpret-markup layout props markup) - (ly:make-stencil '() '(1 . -1) '(1 . -1))) - )) - + (ly:make-stencil '() '(1 . -1) '(1 . -1)))))