]> git.donarmstrong.com Git - lilypond.git/blobdiff - input/regression/molecule-hacking.ly
Imported sources
[lilypond.git] / input / regression / molecule-hacking.ly
index 3ff3c6a685ead1d9ae3f7aaf127011716bea775f..6dd67c9004a3f3a6fa6cbd47791e3358a95e2b6c 100644 (file)
@@ -1,4 +1,5 @@
-\version "1.5.68"
+
+\version "2.1.21"
 
 \header { texidoc=" You can write molecule callbacks in Scheme, thus
 providing custom glyphs for notation elements.  A simple example is
@@ -15,9 +16,9 @@ parens are also not seen by accidentals.
    "Construct a function that will do CALLBACK and add parentheses.
 Example usage:
 
-  \property Voice.NoteHead \\override #'molecule-callback
+  \\property Voice.NoteHead \\override #'print-function
                      =
-                     #(parenthesize-callback Note_head::brew_molecule)
+                     #(parenthesize-callback Note_head::print)
                    
 "
 
@@ -28,25 +29,25 @@ GROB.  The dimensions of the molecule is not affected.
 "
      
      (let* (
-           (fn (ly-get-default-font grob))
-           (pclose (ly-find-glyph-by-name fn "accidentals-rightparen"))
-           (popen (ly-find-glyph-by-name fn "accidentals-leftparen"))
+           (fn (ly:get-default-font grob))
+           (pclose (ly:find-glyph-by-name fn "accidentals-rightparen"))
+           (popen (ly:find-glyph-by-name fn "accidentals-leftparen"))
            (subject (callback grob))
 
            ; remember old size
-           (subject-dim-x (ly-get-molecule-extent subject 0))
-           (subject-dim-y (ly-get-molecule-extent subject 1))
+           (subject-dim-x (ly:molecule-get-extent subject 0))
+           (subject-dim-y (ly:molecule-get-extent subject 1))
        )
 
         ; add parens
         (set! subject
-            (ly-combine-molecule-at-edge 
-             (ly-combine-molecule-at-edge subject 0 1 pclose 0.2)
+            (ly:molecule-combine-at-edge 
+             (ly:molecule-combine-at-edge subject 0 1 pclose 0.2)
              0 -1 popen  0.2))
 
        ; revert old size.
-       (ly-set-molecule-extent! subject 0 subject-dim-x)
-       (ly-set-molecule-extent! subject 1 subject-dim-y)
+       (ly:molecule-set-extent! subject 0 subject-dim-x)
+       (ly:molecule-set-extent! subject 1 subject-dim-y)
        subject
     )
      )
@@ -58,19 +59,20 @@ GROB.  The dimensions of the molecule is not affected.
 \score {
        \notes \relative c' { c4 e
 
-                   \property Voice.NoteHead \override #'molecule-callback
+                   \property Voice.NoteHead \override #'print-function
                      =
-                     #(parenthesize-callback Note_head::brew_molecule)
+                     #(parenthesize-callback Note_head::print)
                    g bes
-                   \property Voice.NoteHead \revert #'molecule-callback
-                   \property Voice.Beam \override #'molecule-callback
+                   \property Voice.NoteHead \revert #'print-function
+                   \property Voice.Beam \override #'print-function
                      =
-                     #(parenthesize-callback Beam::brew_molecule)
+                     #(parenthesize-callback Beam::print)
 
                    a8 gis8 a2.
                    
                    }
 
-       \paper { linewidth = -1. }
+       \paper { raggedright = ##t}
        }
 
+