]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/output-socket.scm
Fix some bugs in the dynamic engraver and PostScript backend
[lilypond.git] / scm / output-socket.scm
index f55cf93bf9238500ad8be4ba60e8dc600c20e27c..c8a0fac3c7e872f5c7359951a33ac681956c11be 100644 (file)
@@ -11,6 +11,7 @@
 (define (dummy . rest)
   "")
 
+(display (ly:all-stencil-expressions))
 (for-each
  (lambda (x) 
    (module-define! (current-module)
@@ -54,7 +55,7 @@
 
     (cond
      ((ly:music? cause) cause)
-     ((ly:grob? cause) (music-cause cause))
+;     ((ly:grob? cause) (music-cause cause))
      (else
       #f))))
 
       ((x-ext (ly:grob-extent grob grob X))
        (y-ext (ly:grob-extent grob grob Y))
        (x (car offset))
-       (y (cdr offset))
-       )
+       (y (cdr offset)))
+
+    (if (interval-empty? x-ext)
+       (set! x-ext '(0 . 0)))
 
-    (map (lambda (x)
-          (if (inf? x) 0.0 x))
-        
-        (list (+ x (car x-ext))
-              (+ y (car y-ext))
-              (+ x (cdr x-ext))
-              (+ y (cdr y-ext)))
-    )))
+    (if (interval-empty? y-ext)
+       (set! y-ext '(0 . 0)))
+    
+    (list (+ x (car x-ext))
+         (+ y (car y-ext))
+         (+ x (cdr x-ext))
+         (+ y (cdr y-ext))
+         )))
 
 (define-public (no-origin)
   "nocause\n")
          )))
 
 
+(define (escape-string str)
+  (string-regexp-substitute
+   " " "\\040" 
+   (string-regexp-substitute "\"" "\\\"" str)))
+  
 (define-public (utf-8-string
                descr
                string)
   
-  (format "utf-8 \"~a\" \"~a\"" descr
+  (format "utf-8 \"~a\" \"~a\""
+         (escape-string descr)
 
          ;; don't want unescaped spaces.
-         (string-regexp-substitute " " "\\040" string)))
+         (escape-string string)
+         ))
+
 
+(define (bezier-sandwich lst thick)
+  (format
+   #f
+   "bezier_sandwich ~a [~a]"
+   thick
+   (string-append 
+    (string-join (map (lambda (x) (format "(~a,~a)" (car x) (cdr x)))
+                     lst) ","))))