]> git.donarmstrong.com Git - lilypond.git/blob - scm/framework-ps.scm
Merge branch 'instrumentName-groups'
[lilypond.git] / scm / framework-ps.scm
1 ;;;; This file is part of LilyPond, the GNU music typesetter.
2 ;;;;
3 ;;;; Copyright (C) 2004--2011 Han-Wen Nienhuys <hanwen@xs4all.nl>
4 ;;;;
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
7 ;;;; the Free Software Foundation, either version 3 of the License, or
8 ;;;; (at your option) any later version.
9 ;;;;
10 ;;;; LilyPond is distributed in the hope that it will be useful,
11 ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 ;;;; GNU General Public License for more details.
14 ;;;;
15 ;;;; You should have received a copy of the GNU General Public License
16 ;;;; along with LilyPond.  If not, see <http://www.gnu.org/licenses/>.
17
18 (define-module (scm framework-ps))
19
20 ;;; this is still too big a mess.
21
22 (use-modules (ice-9 string-fun)
23              (guile)
24              (scm page)
25              (scm paper-system)
26              (srfi srfi-1)
27              (srfi srfi-13)
28              (scm clip-region)
29              (lily))
30
31 (define format ergonomic-simple-format)
32
33 (define framework-ps-module (current-module))
34
35 ;;(define pdebug stderr)
36 (define (pdebug . rest) #f)
37
38 (define-public (ps-font-command font)
39   (let* ((name (ly:font-file-name font))
40          (magnify (ly:font-magnification font)))
41     (string-append
42      "magfont"
43      (ly:string-substitute
44       " " "_"
45       (ly:string-substitute
46        "/" "_"
47        (ly:string-substitute
48         "%" "_" name)))
49      "m" (string-encode-integer (inexact->exact (round (* 1000 magnify)))))))
50
51 (define (ps-define-pango-pf pango-pf font-name scaling)
52   "")
53
54 (define (ps-define-font font font-name scaling)
55   (string-append
56    "/" (ps-font-command font)
57    " { /" font-name
58    " " (ly:number->string scaling) " output-scale div selectfont }"
59    " bind def\n"))
60
61 ;; FIXME: duplicated in other output backends
62 ;; FIXME: silly interface name
63 (define (output-variables layout)
64   ;; FIXME: duplicates output-layout's scope-entry->string, mostly
65   (define (value->string val)
66     (cond
67      ((string? val) (string-append "(" val ")"))
68      ((symbol? val) (symbol->string val))
69      ((number? val) (number->string val))
70      (else "")))
71
72   (define (output-entry ps-key ly-key)
73     (string-append
74      "/" ps-key " "
75      (value->string (ly:output-def-lookup layout ly-key)) " def\n"))
76
77   (string-append
78    "/lily-output-units "
79      (number->string (/ (ly:bp 1))) " def %% millimeter\n"
80    (output-entry "staff-line-thickness" 'line-thickness)
81    (output-entry "line-width" 'line-width)
82    (output-entry "paper-size" 'papersizename)
83    (output-entry "staff-height" 'staff-height)  ;junkme.
84    "/output-scale "
85      (number->string (ly:output-def-lookup layout 'output-scale)) " def\n"
86    (output-entry "page-height" 'paper-height)
87    (output-entry "page-width" 'paper-width)))
88
89 (define (dump-page outputter page page-number page-count landscape?)
90   (ly:outputter-dump-string
91    outputter
92    (string-append
93     (format "%%Page: ~a ~a\n" page-number page-number)
94     "%%BeginPageSetup\n"
95     (if landscape?
96         "page-width output-scale lily-output-units mul mul 0 translate 90 rotate\n"
97         "")
98     "%%EndPageSetup\n"
99     "\n"
100     "true setstrokeadjust\n"
101     "gsave 0 paper-height translate set-ps-scale-to-lily-scale\n"))
102   (ly:outputter-dump-stencil outputter page)
103   (ly:outputter-dump-string outputter "stroke grestore\nshowpage\n"))
104
105 (define (supplies-or-needs paper load-fonts?)
106   (define (extract-names font)
107     (if (ly:pango-font? font)
108         (map car (ly:pango-font-physical-fonts font))
109         (list (ly:font-name font))))
110
111   (let* ((fonts (ly:paper-fonts paper))
112          (names (apply append (map extract-names fonts))))
113     (apply string-append
114            (map (lambda (f)
115                   (format
116                    (if load-fonts?
117                        "%%DocumentSuppliedResources: font ~a\n"
118                        "%%DocumentNeededResources: font ~a\n")
119                    f))
120                 (uniq-list (sort names string<?))))))
121
122 (define (eps-header paper bbox load-fonts?)
123   (string-append "%!PS-Adobe-2.0 EPSF-2.0\n"
124                  "%%Creator: LilyPond " (lilypond-version) "\n"
125                  "%%BoundingBox: "
126                    (string-join (map ly:number->string bbox) " ") "\n"
127                  "%%Orientation: "
128                    (if (eq? (ly:output-def-lookup paper 'landscape) #t)
129                        "Landscape\n"
130                        "Portrait\n")
131                  (supplies-or-needs paper load-fonts?)
132                  "%%EndComments\n"))
133
134 (define (ps-document-media paper)
135   (let* ((w (/ (*
136                 (ly:output-def-lookup paper 'output-scale)
137                 (ly:output-def-lookup paper 'paper-width)) (ly:bp 1)))
138          (h (/ (*
139                 (ly:output-def-lookup paper 'paper-height)
140                 (ly:output-def-lookup paper 'output-scale))
141                (ly:bp 1)))
142          (landscape? (eq? (ly:output-def-lookup paper 'landscape) #t)))
143     (ly:format "%%DocumentMedia: ~a ~2f ~2f ~a ~a ~a\n"
144                (ly:output-def-lookup paper 'papersizename)
145                (if landscape? h w)
146                (if landscape? w h)
147                80   ;; weight
148                "()" ;; color
149                "()" ;; type
150     )))
151
152 (define (file-header paper page-count load-fonts?)
153   (string-append "%!PS-Adobe-3.0\n"
154                  "%%Creator: LilyPond " (lilypond-version) "\n"
155                  "%%Pages: " (number->string page-count) "\n"
156                  "%%PageOrder: Ascend\n"
157                  "%%Orientation: "
158                    (if (eq? (ly:output-def-lookup paper 'landscape) #t)
159                        "Landscape\n"
160                        "Portrait\n")
161                  (ps-document-media paper)
162                  (supplies-or-needs paper load-fonts?)
163                  "%%EndComments\n"))
164
165 (define (procset file-name)
166   (format
167    "%%BeginResource: procset (~a) 1 0
168 ~a
169 %%EndResource
170 "
171    file-name (cached-file-contents file-name)))
172
173 (define (embed-document file-name)
174   (format "%%BeginDocument: ~a
175 ~a
176 %%EndDocument
177 "
178    file-name (cached-file-contents file-name)))
179
180 (define (setup-variables paper)
181   (string-append
182    "\n"
183    (define-fonts paper ps-define-font ps-define-pango-pf)
184    (output-variables paper)))
185
186 (define (cff-font? font)
187   (let* ((cff-string (ly:otf-font-table-data font "CFF ")))
188     (> (string-length cff-string) 0)))
189
190 (define-public (ps-embed-cff body font-set-name version)
191   (let* ((binary-data
192           (string-append
193            (format "/~a ~s StartData " font-set-name (string-length body))
194            body))
195          (header
196           (format
197            "%%BeginResource: font ~a
198 %!PS-Adobe-3.0 Resource-FontSet
199 %%DocumentNeededResources: ProcSet (FontSetInit)
200 %%Title: (FontSet/~a)
201 %%Version: ~s
202 %%EndComments
203 %%IncludeResource: ProcSet (FontSetInit)
204 %%BeginResource: FontSet (~a)
205 /FontSetInit /ProcSet findresource begin
206 %%BeginData: ~s Binary Bytes
207 "
208            font-set-name font-set-name version font-set-name
209            (string-length binary-data)))
210          (footer "\n%%EndData
211 %%EndResource
212 %%EndResource\n"))
213     (string-append header
214                    binary-data
215                    footer)))
216
217 (define (write-preamble paper load-fonts? port)
218   (define (internal-font? file-name)
219     (or (string-startswith file-name "Emmentaler")
220         (string-startswith file-name "emmentaler")
221         ))
222
223   (define (load-font-via-GS font-name-filename)
224     (define (ps-load-file file-name)
225       (if (string? file-name)
226           (if (string-contains file-name (ly:get-option 'datadir))
227               (begin
228                 (set! file-name (ly:string-substitute (ly:get-option 'datadir)
229                                                       "" file-name))
230                 (format
231                  "lilypond-datadir (~a) concatstrings (r) file .loadfont\n"
232                  file-name))
233               (format "(~a) (r) file .loadfont\n" file-name))
234           (format "% cannot find font file: ~a\n" file-name)))
235
236     (let* ((font (car font-name-filename))
237            (name (cadr font-name-filename))
238            (file-name (caddr font-name-filename))
239            (bare-file-name (ly:find-file file-name)))
240       (cons name
241             (if (mac-font? bare-file-name)
242                 (handle-mac-font name bare-file-name)
243                 (cond
244                  ((internal-font? file-name)
245                   (ps-load-file (ly:find-file
246                                  (format "~a.otf" file-name))))
247                  ((string? bare-file-name)
248                   (ps-load-file file-name))
249                  (else
250                   (ly:warning (_ "cannot embed ~S=~S") name file-name)
251                   ""))))))
252
253   (define (dir-join a b)
254     (if (equal? a "")
255         b
256         (string-append a "/" b)))
257
258   (define (dir-listing dir-name)
259     (define (dir-helper dir lst)
260       (let ((e (readdir dir)))
261         (if (eof-object? e)
262             lst
263             (dir-helper dir (cons e lst)))))
264     (reverse (dir-helper (opendir dir-name) '())))
265
266   (define (handle-mac-font name filename)
267     (let* ((dir-name (tmpnam))
268            (files '())
269            (status 0)
270            (embed #f)
271            (cwd (getcwd)))
272       (mkdir dir-name #o700)
273       (chdir dir-name)
274       (set! status (ly:system (list "fondu" "-force" file-name)))
275       (chdir cwd)
276       (set! files (dir-listing dir-name))
277       (for-each
278        (lambda (f)
279          (let* ((full-name (dir-join dir-name f)))
280            (if (and (not embed)
281                     (equal? 'regular (stat:type (stat full-name)))
282                     (equal? name (ly:ttf-ps-name full-name)))
283                (set! embed (font-file-as-ps-string name full-name 0)))
284            (if (or (equal? "." f)
285                    (equal? ".." f))
286                #t
287                (delete-file full-name))))
288        files)
289       (rmdir dir-name)
290       (if (not embed)
291           (begin
292             (set! embed "% failed\n")
293             (ly:warning (_ "cannot extract file matching ~a from ~a")
294                         name filename)))
295       embed))
296
297   (define (font-file-as-ps-string name file-name font-index)
298     (let* ((downcase-file-name (string-downcase file-name)))
299       (cond
300        ((and file-name (string-endswith downcase-file-name ".pfa"))
301         (embed-document file-name))
302        ((and file-name (string-endswith downcase-file-name ".pfb"))
303         (ly:pfb->pfa file-name))
304        ((and file-name (string-endswith downcase-file-name ".ttf"))
305         (ly:ttf->pfa file-name))
306        ((and file-name (string-endswith downcase-file-name ".ttc"))
307         (ly:ttf->pfa file-name font-index))
308        ((and file-name (string-endswith downcase-file-name ".otf"))
309         (ps-embed-cff (ly:otf->cff file-name) name 0))
310        (else
311         (ly:warning (_ "do not know how to embed ~S=~S") name file-name)
312         ""))))
313
314   (define (mac-font? bare-file-name)
315     (and (eq? PLATFORM 'darwin)
316          bare-file-name
317          (or (string-endswith bare-file-name ".dfont")
318              (= (stat:size (stat bare-file-name)) 0))))
319
320   (define (load-font font-psname-filename-fontindex)
321     (let* ((font (list-ref font-psname-filename-fontindex 0))
322            (name (list-ref font-psname-filename-fontindex 1))
323            (file-name (list-ref font-psname-filename-fontindex 2))
324            (font-index (list-ref font-psname-filename-fontindex 3))
325            (bare-file-name (ly:find-file file-name)))
326       (cons name
327             (cond ((mac-font? bare-file-name)
328                    (handle-mac-font name bare-file-name))
329                   ((and font (cff-font? font))
330                    (ps-embed-cff (ly:otf-font-table-data font "CFF ")
331                                  name
332                                  0))
333                   (bare-file-name (font-file-as-ps-string
334                                    name bare-file-name font-index))
335                   (else
336                    (ly:warning (_ "do not know how to embed font ~s ~s ~s")
337                                name file-name font))))))
338
339   (define (load-fonts paper)
340     (let* ((fonts (ly:paper-fonts paper))
341
342            ;; todo - doc format of list.
343            (all-font-names
344             (map
345              (lambda (font)
346                (cond ((string? (ly:font-file-name font))
347                       (list (list font
348                                   (ly:font-name font)
349                                   (ly:font-file-name font)
350                                   #f)))
351                      ((ly:pango-font? font)
352                       (map (lambda (psname-filename-fontindex)
353                              (list #f
354                                    (list-ref psname-filename-fontindex 0)
355                                    (list-ref psname-filename-fontindex 1)
356                                    (list-ref psname-filename-fontindex 2)))
357                            (ly:pango-font-physical-fonts font)))
358                      (else
359                       (ly:font-sub-fonts font))))
360              fonts))
361            (font-names (uniq-list
362                         (sort (apply append all-font-names)
363                               (lambda (x y) (string<? (cadr x) (cadr y))))))
364
365            ;; slightly spaghetti-ish: deciding what to load where
366            ;; is smeared out.
367            (font-loader
368             (lambda (name)
369               (cond ((ly:get-option 'gs-load-fonts)
370                      (load-font-via-GS name))
371                     ((ly:get-option 'gs-load-lily-fonts)
372                      (if (or (string-contains (caddr name)
373                                               (ly:get-option 'datadir))
374                              (internal-font? (caddr name)))
375                          (load-font-via-GS name)
376                          (load-font name)))
377                     (else
378                      (load-font name)))))
379            (pfas (map font-loader font-names)))
380       pfas))
381
382   (display "%%BeginProlog\n" port)
383   (format
384    port
385    "/lilypond-datadir where {pop} {userdict /lilypond-datadir (~a) put } ifelse"
386    (ly:get-option 'datadir))
387   (if load-fonts?
388       (for-each (lambda (f)
389                   (format port "\n%%BeginFont: ~a\n" (car f))
390                   (display (cdr f) port)
391                   (display "%%EndFont\n" port))
392                 (load-fonts paper)))
393   (display (setup-variables paper) port)
394
395   ;; adobe note 5002: should initialize variables before loading routines.
396   (display (procset "music-drawing-routines.ps") port)
397   (display (procset "lilyponddefs.ps") port)
398   (display "%%EndProlog\n" port)
399   (display "%%BeginSetup\ninit-lilypond-parameters\n%%EndSetup\n\n" port))
400
401 (define-public (output-framework basename book scopes fields)
402   (let* ((filename (format "~a.ps" basename))
403          (outputter (ly:make-paper-outputter
404                      ;; FIXME: better wrap open/open-file,
405                      ;; content-mangling is always bad.
406                      ;; MINGW hack: need to have "b"inary for embedding CFFs
407                      (open-file filename "wb")
408                      'ps))
409          (paper (ly:paper-book-paper book))
410          (systems (ly:paper-book-systems book))
411          (page-stencils (map page-stencil (ly:paper-book-pages book)))
412          (landscape? (eq? (ly:output-def-lookup paper 'landscape) #t))
413          (page-number (1- (ly:output-def-lookup paper 'first-page-number)))
414          (page-count (length page-stencils))
415          (port (ly:outputter-port outputter)))
416     (if (ly:get-option 'clip-systems)
417         (clip-system-EPSes basename book))
418     (if (ly:get-option 'dump-signatures)
419         (write-system-signatures basename (ly:paper-book-systems book) 1))
420     (output-scopes scopes fields basename)
421     (display (file-header paper page-count #t) port)
422     ;; don't do BeginDefaults PageMedia: A4
423     ;; not necessary and wrong
424     (write-preamble paper #t port)
425     (for-each
426      (lambda (page)
427        (set! page-number (1+ page-number))
428        (dump-page outputter page page-number page-count landscape?))
429      page-stencils)
430     (display "%%Trailer\n%%EOF\n" port)
431     (ly:outputter-close outputter)
432     (postprocess-output book framework-ps-module filename
433                         (ly:output-formats))))
434
435 (define-public (dump-stencil-as-EPS paper dump-me filename
436                                     load-fonts)
437   (let* ((xext (ly:stencil-extent dump-me X))
438          (yext (ly:stencil-extent dump-me Y))
439          (padding (ly:get-option 'eps-box-padding))
440          (left-overshoot (if (number? padding)
441                              (* -1 padding (ly:output-def-lookup paper 'mm))
442                              #f))
443          (bbox
444           (map
445            (lambda (x)
446              (if (or (nan? x) (inf? x)
447                      ;; FIXME: huh?
448                      (equal? (format #f "~S" x) "+#.#")
449                      (equal? (format #f "~S" x) "-#.#"))
450                  0.0 x))
451
452            ;; the left-overshoot is to make sure that
453            ;; bar numbers stick out of margin uniformly.
454            ;;
455            (list
456             (if (number? left-overshoot)
457                 (min left-overshoot (car xext))
458                 (car xext))
459             (car yext) (cdr xext) (cdr yext)))))
460     (dump-stencil-as-EPS-with-bbox paper dump-me filename load-fonts bbox)))
461
462 (define-public (dump-stencil-as-EPS-with-bbox paper dump-me filename
463                                               load-fonts
464                                               bbox)
465   "Create an EPS file from stencil @var{dump-me} to @var{filename}.
466 @var{bbox} has format @code{(left-x, lower-y, right-x, upper-y)}.  If
467 @var{load-fonts} set, include fonts inline."
468   (define (to-rounded-bp-box box)
469     "Convert box to 1/72 inch with rounding to enlarge the box."
470     (let* ((scale (ly:output-def-lookup paper 'output-scale))
471            (strip-non-number (lambda (x)
472                                (if (or (nan? x)
473                                        (inf? x))
474                                    0.0
475                                    x)))
476            (directed-round (lambda (x rounder)
477                              (inexact->exact
478                               (rounder (/ (* (strip-non-number x) scale)
479                                           (ly:bp 1)))))))
480       (list (directed-round (car box) floor)
481             (directed-round (cadr box) floor)
482             (directed-round (max (1+ (car box)) (caddr box)) ceiling)
483             (directed-round (max (1+ (cadr box)) (cadddr box)) ceiling))))
484
485   (let* ((outputter (ly:make-paper-outputter
486                      ;; FIXME: better wrap open/open-file,
487                      ;; content-mangling is always bad.
488                      ;; MINGW hack: need to have "b"inary for embedding CFFs
489                      (open-file (format "~a.eps" filename) "wb")
490                      'ps))
491          (port (ly:outputter-port outputter))
492          (rounded-bbox (to-rounded-bp-box bbox))
493          (port (ly:outputter-port outputter))
494          (header (eps-header paper rounded-bbox load-fonts)))
495     (display header port)
496     (write-preamble paper load-fonts port)
497     (display "gsave set-ps-scale-to-lily-scale\n" port)
498     (ly:outputter-dump-stencil outputter dump-me)
499     (display "stroke grestore\n%%Trailer\n%%EOF\n" port)
500     (ly:outputter-close outputter)))
501
502 (define (clip-systems-to-region basename paper systems region do-pdf do-png)
503   (let* ((extents-system-pairs
504           (filtered-map (lambda (paper-system)
505                           (let* ((x-ext (system-clipped-x-extent
506                                          (paper-system-system-grob paper-system)
507                                          region)))
508                             (if x-ext
509                                 (cons x-ext paper-system)
510                                 #f)))
511                         systems))
512          (count 0))
513     (for-each
514      (lambda (ext-system-pair)
515        (let* ((xext (car ext-system-pair))
516               (paper-system (cdr ext-system-pair))
517               (yext (paper-system-extent paper-system Y))
518               (bbox (list (car xext) (car yext)
519                           (cdr xext) (cdr yext)))
520               (filename (if (< 0 count)
521                             (format "~a-~a" basename count)
522                             basename)))
523          (set! count (1+ count))
524          (dump-stencil-as-EPS-with-bbox paper
525                                         (paper-system-stencil paper-system)
526                                         filename
527                                         (ly:get-option 'include-eps-fonts)
528                                         bbox)
529          (if do-pdf
530              (postscript->pdf 0 0 (format "~a.eps" filename)))
531          (if do-png
532              (postscript->png (ly:get-option 'resolution) 0 0
533                               (format "~a.eps" filename)))))
534      extents-system-pairs)))
535
536 (define-public (clip-system-EPSes basename paper-book)
537   (define do-pdf
538     (member "pdf" (ly:output-formats)))
539   (define do-png
540     (member "png" (ly:output-formats)))
541
542   (define (clip-score-systems basename systems)
543     (let* ((layout (ly:grob-layout (paper-system-system-grob (car systems))))
544            (regions (ly:output-def-lookup layout 'clip-regions)))
545       (for-each
546        (lambda (region)
547          (clip-systems-to-region
548           (format "~a-from-~a-to-~a-clip"
549                   basename
550                   (rhythmic-location->file-string (car region))
551                   (rhythmic-location->file-string (cdr region)))
552           layout systems region
553           do-pdf do-png))
554        regions)))
555
556   ;; partition in system lists sharing their layout blocks
557   (let* ((systems (ly:paper-book-systems paper-book))
558          (count 0)
559          (score-system-list '()))
560     (fold
561      (lambda (system last-system)
562        (if (not (and last-system
563                      (equal? (paper-system-layout last-system)
564                              (paper-system-layout system))))
565            (set! score-system-list (cons '() score-system-list)))
566        (if (paper-system-layout system)
567            (set-car! score-system-list (cons system (car score-system-list))))
568        ;; pass value.
569        system)
570      #f
571      systems)
572     (for-each (lambda (system-list)
573                 ;; filter out headers and top-level markup
574                 (if (pair? system-list)
575                     (clip-score-systems
576                      (if (> count 0)
577                          (format "~a-~a" basename count)
578                          basename)
579                      system-list)))
580               score-system-list)))
581
582 (define-public (output-preview-framework basename book scopes fields)
583   (let* ((paper (ly:paper-book-paper book))
584          (systems (relevant-book-systems book))
585          (to-dump-systems (relevant-dump-systems systems)))
586     (dump-stencil-as-EPS paper
587                          (stack-stencils Y DOWN 0.0
588                                          (map paper-system-stencil
589                                               (reverse to-dump-systems)))
590                          (format "~a.preview" basename)
591                          #t)
592     (postprocess-output book framework-ps-module
593                         (format "~a.preview.eps" basename)
594                         (cons "png" (ly:output-formats)))))
595
596 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
597
598 (define (output-width-height defs)
599   (let* ((landscape (ly:output-def-lookup defs 'landscape))
600          (output-scale (ly:output-def-lookup defs 'output-scale))
601          (convert (lambda (x)
602                     (* x output-scale (/ (ly:bp 1)))))
603          (paper-width (convert (ly:output-def-lookup defs 'paper-width)))
604          (paper-height (convert (ly:output-def-lookup defs 'paper-height)))
605          (w (if landscape paper-height paper-width))
606          (h (if landscape paper-width paper-height)))
607     (cons w h)))
608
609 (define (output-resolution defs)
610   (let ((defs-resolution (ly:output-def-lookup defs 'pngresolution)))
611     (if (number? defs-resolution)
612         defs-resolution
613         (ly:get-option 'resolution))))
614
615 (define (output-filename name)
616   (if (equal? (basename name ".ps") "-")
617       (string-append "./" name)
618       name))
619
620 (define-public (convert-to-pdf book name)
621   (let* ((defs (ly:paper-book-paper book))
622          (width-height (output-width-height defs))
623          (width (car width-height))
624          (height (cdr width-height))
625          (filename (output-filename name)))
626     (postscript->pdf width height filename)))
627
628 (define-public (convert-to-png book name)
629   (let* ((defs (ly:paper-book-paper book))
630          (resolution (output-resolution defs))
631          (width-height (output-width-height defs))
632          (width (car width-height))
633          (height (cdr width-height))
634          (filename (output-filename name)))
635     (postscript->png resolution width height filename)))
636
637 (define-public (convert-to-ps book name)
638   #t)
639
640 (define-public (output-classic-framework basename book scopes fields)
641   (ly:error (_ "\nThe PostScript backend does not support the
642 system-by-system output.  For that, use the EPS backend instead,
643
644   lilypond -dbackend=eps FILE
645
646 If have cut & pasted a lilypond fragment from a webpage, be sure
647 to only remove anything before
648
649   %% ****************************************************************
650   %% Start cut-&-pastable-section
651   %% ****************************************************************
652 ")))