]> git.donarmstrong.com Git - lilypond.git/commitdiff
* ps/music-drawing-routines.ps (mark_file_line): Switch Action
authorJan Nieuwenhuizen <janneke@gnu.org>
Sun, 27 Feb 2005 15:59:40 +0000 (15:59 +0000)
committerJan Nieuwenhuizen <janneke@gnu.org>
Sun, 27 Feb 2005 15:59:40 +0000 (15:59 +0000)
based on pdf-viewer setting.

* scm/framework-ps.scm (write-preamble): Find and set preferred
pdf-viewer.

ChangeLog
ps/music-drawing-routines.ps
scm/framework-ps.scm

index 82b9b511e61613912f9e167bceb0de3d17b2d8c1..bda00eb12b986f44206b11710803fd41b952c564 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2005-02-27  Jan Nieuwenhuizen  <janneke@gnu.org>
+
+       * ps/music-drawing-routines.ps (mark_file_line): Switch Action
+       based on pdf-viewer setting.
+
+       * scm/framework-ps.scm (write-preamble): Find and set preferred
+       pdf-viewer.
+
 2005-02-27  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
        * scripts/lilypond-pdfpc-helper.py: new file. Invoke different
index d15141a1997f0249db1b2ed710eb4f27041db36b..0c5c3ce9b7aebe650b1f03c17aab230cabff9995 100644 (file)
        /Rect [ llx lly urx ury ]
        /Border [ 0 0 0 0 ]
 
-       %% following for xpdf
-%      /Action /Launch
-%      /File command
-
-       %% following for acroread
-       /Action <<
-           /Subtype /URI
-           /URI command
-       >>
-    
+       pdf-viewer (acroread) eq
+       {
+           /Action
+           <<
+               /Subtype /URI
+               /URI command
+           >>
+       }
+       {
+           % xpdf.  FIXME: gpdf, kpdf etc?
+           /Action
+           <<
+               /Launch
+               /File command
+           >>
+       } ifelse
         /Subtype /Link
     /ANN
     pdfmark
 }
 bind def
 
-/set_tex_dimen {
+/set_tex_dimen
+{
        cvr def
 } bind def
 
index b6d06bb4799169a24bf36e13902ff4ab62dbf56a..620042278d664857cbc6e8ddf7d011817ae0ec70 100644 (file)
                        ""))))
                  (filter string? font-names))))
           pfas))
-      
 
+  ;; FIXME: user preference, somehow?
+  (define (pdf-viewer)
+    (define (find-alternative path lst)
+      (let ((command (search-path path (car lst))))
+       (if (or command (null? lst)) command
+           (find-alternative path (cdr lst)))))
+    (let ((path (parse-path (getenv "PATH")))
+         (pdf-viewers '("acroread" "gpdf" "kpdf" "xpdf" "gv" "echo")))
+      (find-alternative path pdf-viewers)))
+  
+  (format port "/pdf-viewer (~a) def\n" (basename (pdf-viewer)))
   (display (procset "music-drawing-routines.ps") port)
   (display (procset "lilyponddefs.ps") port)
   (if load-fonts?