X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scm%2Foutput-ps.scm;h=5b5a21c7f326c29554f7bd896db4b2084605c82e;hb=8dd920d2143611a60bdaf82831613aae6342d2aa;hp=ae8d1e2478207571422a16de71fe1a38d6eb45cc;hpb=797245ff520d9c44f0308bbc2828bb4747c84123;p=lilypond.git diff --git a/scm/output-ps.scm b/scm/output-ps.scm index ae8d1e2478..5b5a21c7f3 100644 --- a/scm/output-ps.scm +++ b/scm/output-ps.scm @@ -1,9 +1,20 @@ -;;;; output-ps.scm -- implement Scheme output interface for PostScript +;;;; This file is part of LilyPond, the GNU music typesetter. ;;;; -;;;; source file of the GNU LilyPond music typesetter -;;;; -;;;; (c) 1998--2009 Jan Nieuwenhuizen +;;;; Copyright (C) 1998--2010 Jan Nieuwenhuizen ;;;; 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 +;;;; the Free Software Foundation, either version 3 of the License, or +;;;; (at your option) any later version. +;;;; +;;;; LilyPond is distributed in the hope that it will be useful, +;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;;; GNU General Public License for more details. +;;;; +;;;; You should have received a copy of the GNU General Public License +;;;; along with LilyPond. If not, see . ;;;; Note: currently misused as testbed for titles with markup, see ;;;; input/test/title-markup.ly @@ -151,12 +162,11 @@ (+ (car offset) (cdr x-ext)) (+ (cdr offset) (cdr y-ext)) - ;; TODO - ;;full escaping. + ;; Backslashes are not valid + ;; file URI path separators. + (ly:string-percent-encode + (ly:string-substitute "\\" "/" file)) - ;; backslash is interpreted by GS. - (ly:string-substitute "\\" "/" - (ly:string-substitute " " "%20" file)) (cadr location) (caddr location) (cadddr location)) @@ -263,9 +273,6 @@ (cdr y) url)) -(define (utf-8-string pango-font-description string) - (ly:warning (_ "utf-8-string encountered in PS backend"))) - (define (path thickness exps) (define (convert-path-exps exps) (if (pair? exps) @@ -276,6 +283,7 @@ (cond ((memq head '(rmoveto rlineto lineto moveto)) 2) ((memq head '(rcurveto curveto)) 6) + ((eq? head 'closepath) 0) (else 1))) (args (take rest arity)) ) @@ -290,7 +298,7 @@ (ly:format - "1 setlinecap ~a setlinewidth\n~l stroke" + "gsave currentpoint translate 1 setlinecap ~a setlinewidth\n~l stroke grestore" thickness - (convert-path-exps exps) )) + (convert-path-exps exps)))