From 7fc0423b5edb9363e4d517bb010b5511f628b2ca Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Tue, 26 Nov 2002 19:09:50 +0000 Subject: [PATCH] Fixes. --- scm/ps.scm | 11 +++++---- scm/sodipodi.scm | 58 +++++++++++++++++++++++++++++++----------------- 2 files changed, 43 insertions(+), 26 deletions(-) diff --git a/scm/ps.scm b/scm/ps.scm index f46dcf475f..9997fdce45 100644 --- a/scm/ps.scm +++ b/scm/ps.scm @@ -52,13 +52,12 @@ " " (numbers->string (list x0 y0 - (/ (sqrt (+ (* (- x1 x2) (- x1 x2)) (* (- y1 y2) (- y1 y2)))) 2))) + (/ (sqrt (+ (* (- x1 x2) (- x1 x2)) + (* (- y1 y2) (- y1 y2)))) 2))) " draw_dot"))) - - (string-append - (apply string-append (map number-pair->string l)) - (ly:number->string thick) - " draw_bezier_sandwich " + + (string-append + (bezier-sandwich l thick) (bezier-ending (list-ref l 3) (list-ref l 0) (list-ref l 5)) (bezier-ending (list-ref l 7) (list-ref l 0) (list-ref l 5)))) diff --git a/scm/sodipodi.scm b/scm/sodipodi.scm index 4c77dc7f68..7fd45bab66 100644 --- a/scm/sodipodi.scm +++ b/scm/sodipodi.scm @@ -2,7 +2,7 @@ ;;;; ;;;; source file of the GNU LilyPond music typesetter ;;;; -;;;; (c) 1998--2002 Jan Nieuwenhuizen +;;;; (c) 2002 Jan Nieuwenhuizen ;;;; NOTE: ;;;; @@ -12,6 +12,7 @@ ;;;; ;;;; * Link/copy mf/out/private-fonts to ~/.sodipodi/private-fonts +;;;; http://www.w3.org/TR/SVG11/paths.html (debug-enable 'backtrace) @@ -138,20 +139,16 @@ "" (string-append "," (numbers->string (cdr l)))))) -(define (svg-bezier l) +(define (svg-bezier l close) (let* ((c0 (car (list-tail l 3))) (c123 (list-head l 3))) (string-append - "M " (control->string c0) - "C " (apply string-append (map control->string c123))))) + (if (not close) "M " "L ") + (control->string c0) + "C " (apply string-append (map control->string c123)) + (if (not close) "" (string-append + "L " (control->string close))))));; " Z"))))) -;; URG -(define (svg-close l) - (let* ((c0 (car (list-tail l 3)))) - (string-append - "M " (control->string c0)))) - - (define xml-header " string (* output-scale x0))) + `(cy . ,(number->string (* output-scale (- 0 y0)))) + `(r . ,(number->string (* output-scale r))))))) + + (let ((l (eval urg-l this-module))) + (string-append + (bezier-sandwich l thick) + (bezier-ending (list-ref l 3) (list-ref l 0) (list-ref l 5)) + (bezier-ending (list-ref l 7) (list-ref l 0) (list-ref l 5))))) (define (bezier-sandwich l thick) - (let* ((urg (eval l this-module)) - (first (list-tail urg 4)) - (second (list-head urg 4))) + (let* (;;(l (eval urg-l this-module)) + (first (list-tail l 4)) + (first-c0 (car (list-tail first 3))) + (second (list-head l 4))) (tagify "path" "" - `(style . ,(format #f "stroke-width:~f;" line-thickness)) + `(stroke . "#000000") + `(stroke-width . ,(number->string line-thickness)) `(transform . ,(format #f "scale (~f,~f)" output-scale output-scale)) - `(d . ,(string-append (svg-bezier first) - (svg-bezier second) - (svg-close first)))))) + `(d . ,(string-append (svg-bezier first #f) + (svg-bezier second first-c0)))))) (define (char i) (if #t -- 2.39.5