]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/output-lib.scm
*** empty log message ***
[lilypond.git] / scm / output-lib.scm
index b31d0bed133e757eea1f0eb62a2c1533e9a6b8a8..1128d68b6e5586f6b4838f48863d8b03bd0bcbc9 100644 (file)
@@ -20,7 +20,7 @@
       (list-ref tuning
                 (- string 1) ; remove 1 because list index starts at 0 and guitar string at 1.
                 )
-      ) ) 
+      ))
 
 (define-public (hammer-print-function grob)
   (let* ((note-collums (ly:grob-property grob 'note-columns))
                        (else "")))
                                    
          )
-    (let* ((slur (Slur::print grob))
-          (paper (ly:grob-paper grob))
+    (let* (
+          (slur ; (Slur::print grob)
+
+           ;; 
+           ;; FIXME: a hammer is not a slur.
+           ;; 
+           (ly:make-stencil '() '(0 . 0) '(0 . 0)))
+          (layout (ly:grob-layout grob))
           (text (interpret-markup
-                 paper
-                 (ly:grob-alist-chain grob (ly:paper-lookup paper 'text-font-defaults))
+                 layout
+                 (ly:grob-alist-chain grob (ly:output-def-lookup layout 'text-font-defaults))
                  letter)))
     
       (let ((x (/ (- (cdr (ly:stencil-extent slur 0)) 
@@ -54,7 +60,7 @@
         (ly:stencil-align-to! text 0 1)
         )
 
-      (ly:stencil-combine-at-edge slur 1 1 text -0.6)
+;      (ly:stencil-combine-at-edge slur 1 1 text -0.6)
       ) ) )
 
 
 
 
 (define-public (make-stencil-boxer line-thick x-padding y-padding callback)
-   "Makes a routine that adds a box around the grob parsed as argument"
+  "Makes a routine that adds a box around the grob parsed as argument"
   (define (stencil-boxer grob)
-  (let*
-   (
-    (mol    (callback grob))
-    (x-ext (interval-widen (ly:stencil-extent mol 0) x-padding))
-    (y-ext (interval-widen (ly:stencil-extent mol 1) y-padding))
-    (x-rule (make-filled-box-stencil (interval-widen x-ext line-thick)
-                              (cons 0 line-thick)))
-    (y-rule (make-filled-box-stencil (cons 0 line-thick) y-ext))
-    )
-    
-    (set! mol (ly:stencil-combine-at-edge mol 0 1 y-rule x-padding))
-    (set! mol (ly:stencil-combine-at-edge mol 0 -1  y-rule x-padding))
-    (set! mol (ly:stencil-combine-at-edge mol 1 1  x-rule 0))  
-    (set! mol (ly:stencil-combine-at-edge mol 1 -1 x-rule 0))
-    
-    mol
- ))
- stencil-boxer
- )
+    (let*
+       (
+        (mol    (callback grob))
+        (x-ext (interval-widen (ly:stencil-extent mol 0) x-padding))
+        (y-ext (interval-widen (ly:stencil-extent mol 1) y-padding))
+        (x-rule (make-filled-box-stencil (interval-widen x-ext line-thick)
+                                         (cons 0 line-thick)))
+        (y-rule (make-filled-box-stencil (cons 0 line-thick) y-ext))
+        )
+
+      (set! mol (ly:stencil-combine-at-edge mol 0 1 y-rule x-padding))
+      (set! mol (ly:stencil-combine-at-edge mol 0 -1 y-rule x-padding))
+      (set! mol (ly:stencil-combine-at-edge mol 1 1 x-rule 0))  
+      (set! mol (ly:stencil-combine-at-edge mol 1 -1 x-rule 0))
+      
+      mol))
+  stencil-boxer)
 
 (define-public (arg->string arg)
-  (cond ((number? arg) (inexact->string arg 10))
+  (cond ((number? arg) (ly:inexact->string arg 10))
        ((string? arg) (string-append "\"" arg "\""))
        ((symbol? arg) (string-append "\"" (symbol->string arg) "\""))))
 
 ;;  (* (/ 72.27 25.40) x))
 
 ;; do nothing in .scm output
-(define-public (comment s) "")
 
-(define-public (numbers->string lst)
-  (apply string-append (map ly:number->string lst)))
+(define-public (ly:numbers->string lst)
+  (string-join (map ly:number->string lst) " "))
 
 (define (number->octal-string x)
   (let* ((n (inexact->exact x))
      (number->string n8)
      (number->string (remainder (- n (+ (* n64 64) (* n8 8))) 8)))))
 
-(define-public (inexact->string x radix)
+(define-public (ly:inexact->string x radix)
   (let ((n (inexact->exact x)))
     (number->string n radix)))
 
-
-(define-public (number-pair->string c)
+(define-public (ly:number-pair->string c)
   (string-append (ly:number->string (car c)) " "
-                (ly:number->string (cdr c)) " "))
+                (ly:number->string (cdr c))))
 
 (define (font i)
   (string-append
     ;; brevis, longa and maxima from the neo-mensural font and all
     ;; other note heads from the default font.  -- jr
     (if (< duration 0)
-       (string-append (number->string duration) "neo_mensural")
+       (string-append (number->string duration) "neomensural")
        (number->string duration)))
    ((mensural)
     (string-append (number->string duration) (symbol->string style)))
-   ((neo_mensural)
+   ((neomensural)
     (string-append (number->string duration) (symbol->string style)))
    ((default)
     ;; The default font in mf/feta-bolletjes.mf defines a brevis, but
     ;; should look exactly like the brevis of the default font, but
     ;; with a stem exactly like that of the quarter note. -- jr
     (if (< duration -1)
-       (string-append (number->string duration) "neo_mensural")
+       (string-append (number->string duration) "neomensural")
        (number->string duration)))
    (else
     (if (string-match "vaticana*|hufnagel*|medicaea*" (symbol->string style))
@@ -227,7 +229,7 @@ centered, X==1 is at the right, X == -1 is at the left."
                          ("|:" . ("|" . "|:"))
                          ("|." . ("|." . ()))
 
-                         ;; hmm... should we end with a barline here?
+                         ;; hmm... should we end with a bar line here?
                          (".|" . ("|" . ".|"))
                          (":|" . (":|" . ()))
                          ("||" . ("||" . ()))
@@ -241,7 +243,7 @@ centered, X==1 is at the right, X == -1 is at the left."
                        )))
 
      (if (equal? result #f)
-        (ly:warn (string-append "Unknown bar glyph: `" glyph "'"))
+        (ly:warn "Unknown bar glyph: `~S'" glyph)
         (index-cell (cdr result) dir))
      ) )