]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/output-ps.scm
Release: update news.
[lilypond.git] / scm / output-ps.scm
index 723a616369bd5f7a4b37243c30dc4506a9f05e2e..82fe77d14042a4987e650d3915fa8487db42ce77 100644 (file)
@@ -1,6 +1,6 @@
 ;;;; This file is part of LilyPond, the GNU music typesetter.
 ;;;;
-;;;; Copyright (C) 1998--2010 Jan Nieuwenhuizen <janneke@gnu.org>
+;;;; Copyright (C) 1998--2012 Jan Nieuwenhuizen <janneke@gnu.org>
 ;;;;                 Han-Wen Nienhuys <hanwen@xs4all.nl>
 ;;;;
 ;;;; LilyPond is free software: you can redistribute it and/or modify
@@ -45,7 +45,7 @@
 (define (str4 num)
   (if (or (nan? num) (inf? num))
       (begin
-       (ly:warning (_ "Found infinity or nan in output. Substituting 0.0"))
+       (ly:warning (_ "Found infinity or nan in output.  Substituting 0.0"))
        (if (ly:get-option 'strict-infinity-checking)
            (exit 1))
        "0.0")
   (if (ly:get-option 'point-and-click)
       (let* ((cause (ly:grob-property grob 'cause))
             (music-origin (if (ly:stream-event? cause)
-                              (ly:event-property cause 'origin))))
-       (if (ly:input-location? music-origin)
+                              (ly:event-property cause 'origin)))
+            (point-and-click (ly:get-option 'point-and-click)))
+       (if (and
+            (ly:input-location? music-origin)
+            (cond ((boolean? point-and-click) point-and-click)
+                  ((symbol? point-and-click)
+                   (ly:in-event-class? cause point-and-click))
+                  (else (any (lambda (t)
+                               (ly:in-event-class? cause t))
+                             point-and-click))))
            (let* ((location (ly:input-file-line-char-column music-origin))
                   (raw-file (car location))
                   (file (if (is-absolute? raw-file)
             (cdr y)
             url))
 
+(define (page-link page-no x y)
+  (if (number? page-no)
+    (ly:format "~a ~a currentpoint vector_add  ~a ~a currentpoint vector_add ~a mark_page_link"
+              (car x)
+              (car y)
+              (cdr x)
+              (cdr y)
+              page-no)
+    ""))
+
 (define* (path thickness exps #:optional (cap 'round) (join 'round) (fill? #f))
   (define (convert-path-exps exps)
     (if (pair? exps)
      thickness
      (convert-path-exps exps)
      (if fill? "fill" ""))))
+
+(define (setscale x y)
+  (ly:format "gsave ~4l scale\n"
+             (list x y)))
+
+(define (resetscale)
+  "grestore\n")