Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(223)

Side by Side Diff: scm/framework-ps.scm

Issue 225040043: Embed LilyPond source files inside generated PDF (Closed)
Patch Set: Created 9 years, 11 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « scm/backend-library.scm ('k') | scm/lily.scm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 (internal-font? (caddr name))) 405 (internal-font? (caddr name)))
406 (load-font-via-GS name) 406 (load-font-via-GS name)
407 (load-font name))) 407 (load-font name)))
408 (else 408 (else
409 (load-font name))))) 409 (load-font name)))))
410 (pfas (map font-loader font-names))) 410 (pfas (map font-loader font-names)))
411 pfas)) 411 pfas))
412 412
413 413
414 (display "%%BeginProlog\n" port) 414 (display "%%BeginProlog\n" port)
415
416 (if (ly:get-option 'embed-source-code)
417 (let ((source-list (ly:source-files #f))
418 (idx -1))
419 (display "\n/pdfmark where
420 {pop} {userdict /pdfmark /cleartomark load put} ifelse" port)
421 (map (lambda (fname)
422 (set! idx (1+ idx))
423 (format port "\n
424 /F (~a) (r) file def
425 [ /_objdef {ly~a_stream} /type /stream /OBJ pdfmark
426 [ {ly~a_stream} F /PUT pdfmark
427 [ {ly~a_stream} << /Type /EmbeddedFile>> /PUT pdfmark
428 [ /Rect [ 0 0 0 0] /Name /DummyAnchor~a
429 /FS <</F (~a) /Type /FileSpec /EF << /F {ly~a_stream} >> >>
430 /Subtype /FileAttachment /EMBED pdfmark\n"
431 fname idx idx idx idx fname idx))
432 source-list)))
433
415 (format 434 (format
416 port 435 port
417 "/lilypond-datadir where {pop} {userdict /lilypond-datadir (~a) put } ifelse" 436 "\n/lilypond-datadir where {pop} {userdict /lilypond-datadir (~a) put } ifels e"
418 (ly:get-option 'datadir)) 437 (ly:get-option 'datadir))
438
419 (if load-fonts? 439 (if load-fonts?
420 (for-each (lambda (f) 440 (for-each (lambda (f)
421 (format port "\n%%BeginFont: ~a\n" (car f)) 441 (format port "\n%%BeginFont: ~a\n" (car f))
422 (display (cdr f) port) 442 (display (cdr f) port)
423 (display "%%EndFont\n" port)) 443 (display "%%EndFont\n" port))
424 (load-fonts paper))) 444 (load-fonts paper)))
425 (if (ly:bigpdfs) 445 (if (ly:bigpdfs)
426 (display (procset "encodingdefs.ps") port)) 446 (display (procset "encodingdefs.ps") port))
427 (display (setup-variables paper) port) 447 (display (setup-variables paper) port)
428 448
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
724 744
725 (define-public (convert-to-ps book name) 745 (define-public (convert-to-ps book name)
726 #t) 746 #t)
727 747
728 (define-public (output-classic-framework basename book scopes fields) 748 (define-public (output-classic-framework basename book scopes fields)
729 (ly:error (_ "\nThe PostScript backend does not support the 749 (ly:error (_ "\nThe PostScript backend does not support the
730 system-by-system output. For that, use the EPS backend instead, 750 system-by-system output. For that, use the EPS backend instead,
731 751
732 lilypond -dbackend=eps FILE 752 lilypond -dbackend=eps FILE
733 753
734 If have cut & pasted a lilypond fragment from a webpage, be sure 754 If you have cut & pasted a lilypond fragment from a webpage, be sure
735 to only remove anything before 755 to only remove anything before
736 756
737 %% **************************************************************** 757 %% ****************************************************************
738 %% Start cut-&-pastable-section 758 %% Start cut-&-pastable-section
739 %% **************************************************************** 759 %% ****************************************************************
740 "))) 760 ")))
OLDNEW
« no previous file with comments | « scm/backend-library.scm ('k') | scm/lily.scm » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b