]> git.donarmstrong.com Git - lilypond.git/commitdiff
Fixes.
authorJan Nieuwenhuizen <janneke@gnu.org>
Tue, 26 Nov 2002 17:18:11 +0000 (17:18 +0000)
committerJan Nieuwenhuizen <janneke@gnu.org>
Tue, 26 Nov 2002 17:18:11 +0000 (17:18 +0000)
ChangeLog
scm/sodipodi.scm

index 496dd1557e4257a2f0f9bf3c87cb59ce394ff616..cd19a5abb8c19fae5792c330767697ceec993ad5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2002-11-26  Jan Nieuwenhuizen  <janneke@gnu.org>
+
+       * scm/sodipodi.scm: Fixes.
+
 2002-11-26  Heikki Junes <hjunes@cc.hut.fi>
 
        * lilypond-mode.el: Look shortcuts in menu from keymap, if possible.
index 0c76e146c4276d977c6f73ea28c9390e6fc93990..4c77dc7f68ac1417d4369dd4d38a77032e8602a9 100644 (file)
@@ -8,7 +8,7 @@
 ;;;;
 ;;;; * Get mftrace 1.0.12 or newer
 ;;;;
-;;;; * Get sodipodi-cvs from 2002-11-23 or newer
+;;;; * Get sodipodi-0.28 or newer
 ;;;;
 ;;;; * Link/copy mf/out/private-fonts to ~/.sodipodi/private-fonts 
 
@@ -78,7 +78,6 @@
 ;; Global vars
 
 (define output-scale 1)
-(define system-x 1)
 (define system-y 0)
 (define line-thickness 0.1)
 (define half-lt (/ line-thickness 2))
 
 (define (control->string c)
   (string-append
-   (number->string (* output-scale (car c))) ","
-   (number->string (* -1 (* output-scale (cdr c)))) " "))
+   (number->string (car c)) ","
+   ;; loose the -1
+   (number->string (* -1 (cdr c))) " "))
 
 (define (control-flip-y c)
   (cons (car c) (* -1 (cdr c))))
     (string-append
      "M " (control->string c0)
      "C " (apply string-append (map control->string c123)))))
-     
+
+;; URG
+(define (svg-close l)
+  (let* ((c0 (car (list-tail l 3))))
+    (string-append
+     "M " (control->string c0))))
+        
         
 (define xml-header
 "<?xml version='1.0' standalone='no'?>
      id='defs3' />
   <sodipodi:namedview
      id='base' />
-  <g tranform='translate(50,-250)'>
+  <g transform='translate(10,10) scale (1.0)'>
   ")
 
 
     (tagify "rect" ""
 
          '(style . "fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-opacity:1;stroke-width:1pt;stroke-linejoin:miter;stroke-linecap:butt;")
-         `(x . ,(number->string (* output-scale half-lt)))
-         `(y . ,(number->string (* output-scale (- half-lt (/ thick 2)))))
-         `(width . ,(number->string (* output-scale width)))
-         `(height . ,(number->string (* output-scale thick)))
-;;       `(ry . ,(number->string (* output-scale half-lt)))
+         `(x . ,(number->string half-lt))
+         `(y . ,(number->string (- half-lt (/ thick 2))))
+         `(width . ,(number->string width))
+         `(height . ,(number->string thick))
          `(ry . ,(number->string line-thickness))
-         `(transform . ,(format #f "matrix(~f,~f,0,1,0,0)"
+         `(transform . ,(format #f "matrix(~f,~f,0,1,0,0) scale (~f,~f)"
                                 (/ x z)
-                                (* -1 (/ y z)))))))
+                                (* -1 (/ y z))
+                                output-scale output-scale)))))
 
 ;; TODO: bezier-ending, see ps.scm
 (define (bezier-bow l thick)
   (let* ((urg (eval l this-module))
         (first (list-tail urg 4))
         (second (list-head urg 4)))
-    (string-append
-     "<path\n"
-     "style='stroke-width:"
-     (number->string (* output-scale line-thickness)) ";'\n"
-     "d='"
-     (svg-bezier first)
-     (svg-bezier second)
-     "'/>\n")))
+    (tagify "path" ""
+           `(style . ,(format #f "stroke-width:~f;" line-thickness))
+           `(transform . ,(format #f "scale (~f,~f)"
+                                  output-scale output-scale))
+           `(d . ,(string-append (svg-bezier first)
+                                 (svg-bezier second)
+                                 (svg-close first))))))
   
 (define (char i)
   (if #t
 (define (lily-def key val)
   (if (equal? key "lilypondpaperoutputscale")
       ;; ugr
+      ;; If we just use transform scale (output-scale),
+      ;; all fonts come out scaled too (ie, much too big)
+      ;; So, we manually scale all other stuff.
       (set! output-scale (* scale-to-unit (string->number val))))
   "")
 
                      ,(string-append
                        "translate("
                        ;; urg
-                       ;; (number->string (* output-scale x))
-                       (number->string (* output-scale (+ system-x x)))
+                       (number->string (* output-scale x))
                        ","
-                       ;; urg
-                       ;; (number->string (- 0 (* output-scale y)))
-                       (number->string (* output-scale (- system-y y)))
+                       (number->string (- 0 (* output-scale y)))
                        ")"))))
 
 (define (roundfilledbox breapth width depth height blot-diameter)
 ;; TODO: use height, set scaling?
 (define (start-system width height)
   (let ((y system-y))
-    ;;"<g tranform='translate(50,-250)'>
-  (set! system-y (+ system-y height))
-  ;;(format #f "<g tranform='translate(0,~1,'~f)'>" y)))
-  (string-append
-   "\n"
-   (comment "start-system")
-   (comment "URG, transform does not work!")
-   (format #f "<g tranform='translate(0.0,~f)'>\n" (* output-scale y)))))
-  
+    ;;"<g transform='translate(50,-250)'>
+    (set! system-y (+ system-y height))
+    ;;(format #f "<g transform='translate(0,~1,'~f)'>" y)))
+    (string-append
+     "\n"
+     (comment "start-system")
+     (format #f "<g transform='translate(0.0,~f)'>\n" (* output-scale y)))))
+
 (define (stop-system)
   (string-append
    "\n"