OLD | NEW |
1 ;;;; This file is part of LilyPond, the GNU music typesetter. | 1 ;;;; This file is part of LilyPond, the GNU music typesetter. |
2 ;;;; | 2 ;;;; |
3 ;;;; Copyright (C) 2004--2011 Han-Wen Nienhuys <hanwen@xs4all.nl> | 3 ;;;; Copyright (C) 2004--2011 Han-Wen Nienhuys <hanwen@xs4all.nl> |
4 ;;;; | 4 ;;;; |
5 ;;;; LilyPond is free software: you can redistribute it and/or modify | 5 ;;;; LilyPond is free software: you can redistribute it and/or modify |
6 ;;;; it under the terms of the GNU General Public License as published by | 6 ;;;; it under the terms of the GNU General Public License as published by |
7 ;;;; the Free Software Foundation, either version 3 of the License, or | 7 ;;;; the Free Software Foundation, either version 3 of the License, or |
8 ;;;; (at your option) any later version. | 8 ;;;; (at your option) any later version. |
9 ;;;; | 9 ;;;; |
10 ;;;; LilyPond is distributed in the hope that it will be useful, | 10 ;;;; LilyPond is distributed in the hope that it will be useful, |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 | 395 |
396 ;; adobe note 5002: should initialize variables before loading routines. | 396 ;; adobe note 5002: should initialize variables before loading routines. |
397 (display (procset "music-drawing-routines.ps") port) | 397 (display (procset "music-drawing-routines.ps") port) |
398 (display (procset "lilyponddefs.ps") port) | 398 (display (procset "lilyponddefs.ps") port) |
399 (display "%%EndProlog\n" port) | 399 (display "%%EndProlog\n" port) |
400 (display "%%BeginSetup\ninit-lilypond-parameters\n%%EndSetup\n\n" port)) | 400 (display "%%BeginSetup\ninit-lilypond-parameters\n%%EndSetup\n\n" port)) |
401 | 401 |
402 ;;; Create DOCINFO pdfmark containing metadata | 402 ;;; Create DOCINFO pdfmark containing metadata |
403 ;;; header fields with pdf prefix override those without the prefix | 403 ;;; header fields with pdf prefix override those without the prefix |
404 (define (handle-metadata header port) | 404 (define (handle-metadata header port) |
| 405 (define (metadata-encode val) |
| 406 ;; First, escape all parentheses and backslashes (TODO) |
| 407 ;; Then call ly:encode-string-for-pdf to encode the string if neccessary |
| 408 (ly:encode-string-for-pdf val)) |
405 (define (metadata-lookup-output overridevar fallbackvar field) | 409 (define (metadata-lookup-output overridevar fallbackvar field) |
406 (let* ((overrideval (ly:modules-lookup (list header) overridevar)) | 410 (let* ((overrideval (ly:modules-lookup (list header) overridevar)) |
407 (fallbackval (ly:modules-lookup (list header) fallbackvar)) | 411 (fallbackval (ly:modules-lookup (list header) fallbackvar)) |
408 (val (if overrideval overrideval fallbackval))) | 412 (val (if overrideval overrideval fallbackval))) |
409 (if val | 413 (if val |
410 » (format port "/~a (~a)\n" field (markup->string val))))) | 414 » (format port "/~a (~a)\n" field (metadata-encode (markup->string val))
)))) |
411 (display "[ " port) | 415 (display "[ " port) |
412 (metadata-lookup-output 'pdfcomposer 'composer "Author") | 416 (metadata-lookup-output 'pdfcomposer 'composer "Author") |
413 (format port "/Creator (LilyPond ~a)\n" (lilypond-version)) | 417 (format port "/Creator (LilyPond ~a)\n" (lilypond-version)) |
414 (metadata-lookup-output 'pdftitle 'title "Title") | 418 (metadata-lookup-output 'pdftitle 'title "Title") |
415 (metadata-lookup-output 'pdfsubject 'subject "Subject") | 419 (metadata-lookup-output 'pdfsubject 'subject "Subject") |
416 (metadata-lookup-output 'pdfkeywords 'keywords "Keywords") | 420 (metadata-lookup-output 'pdfkeywords 'keywords "Keywords") |
417 (metadata-lookup-output 'pdfmodDate 'modDate "ModDate") | 421 (metadata-lookup-output 'pdfmodDate 'modDate "ModDate") |
418 (metadata-lookup-output 'pdfsubtitle 'subtitle "Subtitle") | 422 (metadata-lookup-output 'pdfsubtitle 'subtitle "Subtitle") |
419 (metadata-lookup-output 'pdfcomposer 'composer "Composer") | 423 (metadata-lookup-output 'pdfcomposer 'composer "Composer") |
420 (metadata-lookup-output 'pdfarranger 'arranger "Arranger") | 424 (metadata-lookup-output 'pdfarranger 'arranger "Arranger") |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
671 | 675 |
672 lilypond -dbackend=eps FILE | 676 lilypond -dbackend=eps FILE |
673 | 677 |
674 If have cut & pasted a lilypond fragment from a webpage, be sure | 678 If have cut & pasted a lilypond fragment from a webpage, be sure |
675 to only remove anything before | 679 to only remove anything before |
676 | 680 |
677 %% **************************************************************** | 681 %% **************************************************************** |
678 %% Start cut-&-pastable-section | 682 %% Start cut-&-pastable-section |
679 %% **************************************************************** | 683 %% **************************************************************** |
680 "))) | 684 "))) |
OLD | NEW |