X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scm%2Fframework-ps.scm;h=96c584d34f384cc110dd4278ceecf8b23dfb34a3;hb=bc7e3d9a7b1a171e13bbd37b76ed00d9394b4d22;hp=7a9fb454ff3b9730fa5525c7b2f24532c0389fea;hpb=44dd3acc534e7a534f846810b481c3f603eaa92e;p=lilypond.git diff --git a/scm/framework-ps.scm b/scm/framework-ps.scm index 7a9fb454ff..96c584d34f 100644 --- a/scm/framework-ps.scm +++ b/scm/framework-ps.scm @@ -1,6 +1,6 @@ ;;;; This file is part of LilyPond, the GNU music typesetter. ;;;; -;;;; Copyright (C) 2004--2012 Han-Wen Nienhuys +;;;; Copyright (C) 2004--2015 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 @@ -52,11 +52,32 @@ "") (define (ps-define-font font font-name scaling) - (string-append - "/" (ps-font-command font) - " { /" font-name - " " (ly:number->string scaling) " output-scale div selectfont }" - " bind def\n")) + (if (ly:bigpdfs) + (string-append + "/" (ps-font-command font) "-N" + " { /" font-name "-N" + " " (ly:number->string scaling) " output-scale div selectfont }" + " bind def\n" + "/" (ps-font-command font) "-S" + " { /" font-name "-S" + " " (ly:number->string scaling) " output-scale div selectfont }" + " bind def\n" + "/" (ps-font-command font) "-O" + " { /" font-name "-O" + " " (ly:number->string scaling) " output-scale div selectfont }" + " bind def\n" + "/help" font-name " {\n gsave\n 1 setgray\n /" + font-name "-N" + " 0.001 selectfont 0 0 moveto <01> show\n /" + font-name "-S" + " 0.001 selectfont 0 0 moveto <01> show\n /" + font-name "-O" + " 0.001 selectfont 0 0 moveto <01> show\n grestore\n} def\n") + (string-append + "/" (ps-font-command font) + " { /" font-name + " " (ly:number->string scaling) " output-scale div selectfont }" + " bind def\n"))) ;; FIXME: duplicated in other output backends ;; FIXME: silly interface name @@ -84,7 +105,9 @@ "/output-scale " (number->string (ly:output-def-lookup layout 'output-scale)) " def\n" (output-entry "page-height" 'paper-height) - (output-entry "page-width" 'paper-width))) + (output-entry "page-width" 'paper-width) + (if (ly:get-option 'strokeadjust) "true setstrokeadjust\n" "") + )) (define (dump-page outputter page page-number page-count landscape?) (ly:outputter-dump-string @@ -97,8 +120,16 @@ "") "%%EndPageSetup\n" "\n" - "true setstrokeadjust\n" - "gsave 0 paper-height translate set-ps-scale-to-lily-scale\n")) + "gsave 0 paper-height translate set-ps-scale-to-lily-scale\n" + "/helpEmmentaler-Brace where {pop helpEmmentaler-Brace} if\n" + "/helpEmmentaler-11 where {pop helpEmmentaler-11} if\n" + "/helpEmmentaler-13 where {pop helpEmmentaler-13} if\n" + "/helpEmmentaler-14 where {pop helpEmmentaler-14} if\n" + "/helpEmmentaler-16 where {pop helpEmmentaler-16} if\n" + "/helpEmmentaler-18 where {pop helpEmmentaler-18} if\n" + "/helpEmmentaler-20 where {pop helpEmmentaler-20} if\n" + "/helpEmmentaler-23 where {pop helpEmmentaler-23} if\n" + "/helpEmmentaler-26 where {pop helpEmmentaler-26} if\n")) (ly:outputter-dump-stencil outputter page) (ly:outputter-dump-string outputter "stroke grestore\nshowpage\n")) @@ -109,15 +140,15 @@ (list (ly:font-name font)))) (let* ((fonts (ly:paper-fonts paper)) - (names (apply append (map extract-names fonts)))) - (apply string-append - (map (lambda (f) - (format #f - (if load-fonts? - "%%DocumentSuppliedResources: font ~a\n" - "%%DocumentNeededResources: font ~a\n") - f)) - (uniq-list (sort names stringpdf 0 0 (format #f "~a.eps" filename))) + (postscript->pdf 0 0 filename (format #f "~a.eps" filename) #t)) (if do-png (postscript->png (ly:get-option 'resolution) 0 0 - (format #f "~a.eps" filename))))) + filename (format #f "~a.eps" filename) #t)))) extents-system-pairs))) (define-public (clip-system-EPSes basename paper-book) @@ -635,8 +676,11 @@ (format #f "~a.preview" basename) #t) (postprocess-output book framework-ps-module + (cons "png" (ly:output-formats)) + (format #f "~a.preview" basename) (format #f "~a.preview.eps" basename) - (cons "png" (ly:output-formats))))) + #t + ))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -657,30 +701,23 @@ defs-resolution (ly:get-option 'resolution)))) -(define (output-filename name) - (if (equal? (basename name ".ps") "-") - (string-append "./" name) - name)) - -(define-public (convert-to-pdf book name) +(define-public (convert-to-pdf book base-name tmp-name is-eps) (let* ((defs (ly:paper-book-paper book)) (width-height (output-width-height defs)) (width (car width-height)) - (height (cdr width-height)) - (filename (output-filename name))) - (postscript->pdf width height filename))) + (height (cdr width-height))) + (postscript->pdf width height base-name tmp-name is-eps))) -(define-public (convert-to-png book name) +(define-public (convert-to-png book base-name tmp-name is-eps) (let* ((defs (ly:paper-book-paper book)) (resolution (output-resolution defs)) (width-height (output-width-height defs)) (width (car width-height)) - (height (cdr width-height)) - (filename (output-filename name))) - (postscript->png resolution width height filename))) + (height (cdr width-height))) + (postscript->png resolution width height base-name tmp-name is-eps))) -(define-public (convert-to-ps book name) - #t) +(define-public (convert-to-ps book base-name tmp-name is-eps) + (postscript->ps base-name tmp-name is-eps)) (define-public (output-classic-framework basename book scopes fields) (ly:error (_ "\nThe PostScript backend does not support the