]> git.donarmstrong.com Git - lilypond.git/blobdiff - input/regression/stencil-hacking.ly
Release: bump Welcome versions.
[lilypond.git] / input / regression / stencil-hacking.ly
index 304c3461df1e7dcdcda8a7fd2bc7448263690f19..40d450fcd6b961ff43baba516bdc2c3f365ec1ff 100644 (file)
@@ -1,5 +1,4 @@
-
-\version "2.14.0"
+\version "2.19.21"
 
 \header { texidoc=" You can write stencil callbacks in Scheme, thus
 providing custom glyphs for notation elements.  A simple example is
@@ -16,16 +15,13 @@ parens are also not seen by accidentals.
    "Construct a function that will do CALLBACK and add parentheses.
 Example usage:
 
-  \\property NoteHead \\override #'print-function
-                  =
-                     #(parenthesize-callback ly:note-head::print)
-                   
-"
-
+  \\override NoteHead.stencil
+  =
+  #(parenthesize-callback ly:note-head::print)"
    
    (define (parenthesize-stencil grob)
      "This function adds parentheses to the original callback for
-GROB.  The dimensions of the stencil is not affected.
+GROB.  It does not affect the dimensions of the stencil.
 "
      
      (let* ((fn (ly:grob-default-font grob))
@@ -34,14 +30,14 @@ GROB.  The dimensions of the stencil is not affected.
            (subject (callback grob))
 
            ; remember old size
-           (subject-dim-x (ly:stencil-extent subject 0))
-           (subject-dim-y (ly:stencil-extent subject 1)))
+           (subject-dim-x (ly:stencil-extent subject X))
+           (subject-dim-y (ly:stencil-extent subject Y)))
 
         ;; add parens
         (set! subject
             (ly:stencil-combine-at-edge 
-             (ly:stencil-combine-at-edge subject 0 1 pclose 0.2)
-             0 -1 popen  0.2))
+             (ly:stencil-combine-at-edge subject X RIGHT pclose 0.2)
+             X LEFT popen  0.2))
 
        ; revert old size.
        (ly:make-stencil
@@ -50,16 +46,16 @@ GROB.  The dimensions of the stencil is not affected.
     
 
 \layout { ragged-right = ##t }
-\relative c' {
-    c4 e
+\relative {
+    c'4 e
 
-    \override NoteHead  #'stencil
+    \override NoteHead.stencil
     =
     #(parenthesize-callback ly:note-head::print)
     g bes
-    \revert NoteHead #'stencil
+    \revert NoteHead.stencil
 
-    \override Beam  #'stencil
+    \override Beam.stencil
     =
     #(parenthesize-callback ly:beam::print)