;;;; This file is part of LilyPond, the GNU music typesetter.
;;;;
-;;;; Copyright (C) 1998--2010 Jan Nieuwenhuizen <janneke@gnu.org>
+;;;; Copyright (C) 1998--2011 Jan Nieuwenhuizen <janneke@gnu.org>
;;;; Han-Wen Nienhuys <hanwen@xs4all.nl>
;;;;
;;;; LilyPond is free software: you can redistribute it and/or modify
(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")
(- x2 x1) (- y2 y1)
x1 y1 thick))
-(define (connected-shape pointlist thick x-scale y-scale connect fill)
- (ly:format "~a~4f ~4f ~4f ~4f ~a ~a draw_connected_shape"
- (string-concatenate
- (map (lambda (x)
- (apply (if (eq? (length x) 6)
- (lambda (x1 x2 x3 x4 x5 x6)
- (ly:format "~4f ~4f ~4f ~4f ~4f ~4f 6 "
- x1
- x2
- x3
- x4
- x5
- x6))
- (lambda (x1 x2)
- (ly:format "~4f ~4f 2 " x1 x2)))
- x))
- (reverse pointlist)))
- (length pointlist)
- x-scale
- y-scale
- thick
- (if connect "true" "false")
- (if fill "true" "false")))
-
(define (partial-ellipse x-radius y-radius start-angle end-angle thick connect fill)
(ly:format "~a ~a ~4f ~4f ~4f ~4f ~4f draw_partial_ellipse"
(if fill "true" "false")
(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)
(convert-path-exps (drop rest arity))))
'()))
- (let ((cap-numeric (case cap ((butt) 0) ((round) 1) ((square) 2)))
- (join-numeric (case join ((miter) 0) ((round) 1) ((bevel) 2))))
+ (let ((cap-numeric (case cap ((butt) 0) ((round) 1) ((square) 2)
+ (else (begin
+ (ly:warning (_ "unknown line-cap-style: ~S")
+ (symbol->string cap))
+ 1))))
+ (join-numeric (case join ((miter) 0) ((round) 1) ((bevel) 2)
+ (else (begin
+ (ly:warning (_ "unknown line-join-style: ~S")
+ (symbol->string join))
+ 1)))))
(ly:format
"gsave currentpoint translate
~a setlinecap ~a setlinejoin ~a setlinewidth
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")