]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/stencil.scm
* scm/output-tex.scm (named-glyph): new function. This fixes TeX output.
[lilypond.git] / scm / stencil.scm
index 8f60fa0bec615d9a0267895699bfe1cf37f1410e..97e6470727c4ea8e4b9487a89b9983529da86441 100644 (file)
@@ -1,22 +1,22 @@
-;;;; stenicil.scm -- 
+;;;; stencil.scm -- 
 ;;;;
 ;;;;  source file of the GNU LilyPond music typesetter
 ;;;; 
 ;;;; (c)  2003--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 
 (define-public (stack-stencils axis dir padding stils)
-  "Stack stencils STILS in direction AXIS,DIR, using PADDING."
-  (if (null? stils)
-      '()
-      (if (pair? stils)
-         (ly:stencil-combine-at-edge
-          (car stils) axis dir (stack-stencils axis dir padding (cdr stils))
-          padding))))
+  "Stack stencils STILS in direction AXIS, DIR, using PADDING."
+  (cond
+   ((null? stils) empty-stencil)
+   ((null? (cdr stils)) (car stils))
+   (else (ly:stencil-combine-at-edge
+         (car stils) axis dir (stack-stencils axis dir padding (cdr stils))
+         padding))))
 
 (define-public (stack-lines dir padding baseline stils)
   "Stack vertically with a baseline-skip."
   (if (null? stils)
-      '()
+      empty-stencil
       (if (null? (cdr stils))
          (car stils)
          (ly:stencil-combine-at-edge
@@ -52,7 +52,7 @@ encloses the contents.
   (let* ((xext (ly:grob-extent grob grob 0))
         (yext (ly:grob-extent grob grob 1))
         (thick 0.1))
-
+    
     (ly:stencil-add
      (make-filled-box-stencil xext (cons (- (car yext) thick) (car yext)))
      (make-filled-box-stencil xext (cons  (cdr yext) (+ (cdr yext) thick)))
@@ -80,4 +80,9 @@ encloses the contents.
   (let* ((b  (ly:text-dimension font-metric text)))
     (ly:make-stencil
      `(text ,font-metric ,text) (car b) (cdr b))))
-
+     
+(define-public (fontify-text-white scale font-metric text)
+  "Set TEXT with scale factor s"
+  (let* ((b  (ly:text-dimension font-metric text))
+         (c  `(white-text ,(* 2 scale) ,text))) ;urg -- workaround for using ps font
+    (ly:make-stencil c  (car b) (cdr b))))  ;urg -- extent is not from ps font, but we hope it's close