Left: | ||
Right: |
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--2015 Han-Wen Nienhuys <hanwen@xs4all.nl> | 3 ;;;; Copyright (C) 2004--2015 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 581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
592 (cadr replacement-list))) | 592 (cadr replacement-list))) |
593 str | 593 str |
594 '((#\\ "\\\\") (#\( "\\(") (#\) "\\)")))) | 594 '((#\\ "\\\\") (#\( "\\(") (#\) "\\)")))) |
595 | 595 |
596 ;;; Create DOCINFO pdfmark containing metadata | 596 ;;; Create DOCINFO pdfmark containing metadata |
597 ;;; header fields with pdf prefix override those without the prefix | 597 ;;; header fields with pdf prefix override those without the prefix |
598 (define (handle-metadata header port) | 598 (define (handle-metadata header port) |
599 (define (metadata-encode val) | 599 (define (metadata-encode val) |
600 ;; First, call ly:encode-string-for-pdf to encode the string (latin1 or | 600 ;; First, call ly:encode-string-for-pdf to encode the string (latin1 or |
601 ;; utf-16be), then escape all parentheses and backslashes | 601 ;; utf-16be), then escape all parentheses and backslashes |
602 ;; FIXME guile-2.0: use (string->utf16 str 'big) instead | 602 ;; |
603 | 603 ;; NOTE: with guile-2.0+ ly:encode-string-for-pdf is not really needed and |
604 ;; could be replaced with the followng code: | |
lemzwerg
2017/05/01 18:39:29
s/followng/following/
thomasmorley651
2017/05/01 19:22:01
Done.
I'll not upload a new patch for the typo, th
| |
605 ;; | |
606 ;; (let* ((utf16be-bom #vu8(#xFE #xFF))) | |
607 ;; (string-append (bytevector->string utf16be-bom "ISO-8859-1") | |
608 ;; (bytevector->string (string->utf16 val 'big) "ISO-885 9-1"))) | |
609 ;; | |
604 (ps-quote (ly:encode-string-for-pdf val))) | 610 (ps-quote (ly:encode-string-for-pdf val))) |
605 (define (metadata-lookup-output overridevar fallbackvar field) | 611 (define (metadata-lookup-output overridevar fallbackvar field) |
606 (let* ((overrideval (ly:modules-lookup (list header) overridevar)) | 612 (let* ((overrideval (ly:modules-lookup (list header) overridevar)) |
607 (fallbackval (ly:modules-lookup (list header) fallbackvar)) | 613 (fallbackval (ly:modules-lookup (list header) fallbackvar)) |
608 (val (if overrideval overrideval fallbackval))) | 614 (val (if overrideval overrideval fallbackval))) |
609 (if val | 615 (if val |
610 (format port "/~a (~a)\n" field (metadata-encode (markup->string val ( list header))))))) | 616 (format port "/~a (~a)\n" field (metadata-encode (markup->string val ( list header))))))) |
611 | 617 |
612 (if (module? header) | 618 (if (module? header) |
613 (begin | 619 (begin |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
903 | 909 |
904 lilypond -dbackend=eps FILE | 910 lilypond -dbackend=eps FILE |
905 | 911 |
906 If you have cut & pasted a lilypond fragment from a webpage, be sure | 912 If you have cut & pasted a lilypond fragment from a webpage, be sure |
907 to only remove anything before | 913 to only remove anything before |
908 | 914 |
909 %% **************************************************************** | 915 %% **************************************************************** |
910 %% Start cut-&-pastable-section | 916 %% Start cut-&-pastable-section |
911 %% **************************************************************** | 917 %% **************************************************************** |
912 "))) | 918 "))) |
OLD | NEW |