]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/output-socket.scm
Doc: CG: add items to Release list.
[lilypond.git] / scm / output-socket.scm
index 52f80348ee3bc989f3b190f2fe7d3b88ef5c08b4..083d5a081be223493612e8be276aa4f366de2664 100644 (file)
@@ -11,6 +11,7 @@
 (define (dummy . rest)
   "")
 
+(display (ly:all-stencil-expressions))
 (for-each
  (lambda (x) 
    (module-define! (current-module)
          breapth width depth height blot-diameter
          ))
 
-(define (music-cause grob)
+(define (event-cause grob)
   (let*
       ((cause (ly:grob-property  grob 'cause)))
 
     (cond
-     ((ly:music? cause) cause)
-     ((ly:grob? cause) (music-cause cause))
+     ((ly:stream-event? 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)))
 
-    (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? x-ext)
+       (set! x-ext '(0 . 0)))
+
+    (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-public (grob-cause offset grob)
   (let*
-      ((cause (music-cause grob))
-       (tag (if (and cause (integer? (ly:music-property cause 'input-tag)))
-               (ly:music-property cause 'input-tag)
+      ((cause (event-cause grob))
+       (tag (if (and cause (integer? (ly:event-property cause 'input-tag)))
+               (ly:event-property cause 'input-tag)
                -1))
        (name (cdr (assoc 'name (ly:grob-property grob 'meta))))
        )
                   (grob-bbox grob offset))
          )))
 
-(define-public (glyph-string
-        postscript-font-name
-        size cid?
-        x-y-named-glyphs)
+
+(define (escape-string str)
+  (string-regexp-substitute
+   " " "\\040" 
+   (string-regexp-substitute "\"" "\\\"" str)))
   
-  (format "text \"~a\" ~a ~a " postscript-font-name size
-         (string-join (map (lambda (xyn) (caddr xyn))
-                           x-y-named-glyphs))))
+(define-public (utf-8-string
+               descr
+               string)
+  
+  (format "utf-8 \"~a\" \"~a\""
+         (escape-string descr)
+
+         ;; don't want unescaped spaces.
+         (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) ","))))