]> git.donarmstrong.com Git - lilypond.git/blobdiff - ps/music-drawing-routines.ps
Do header and footer.
[lilypond.git] / ps / music-drawing-routines.ps
index 338272affd653db3c52d803a70e251fb9db9d8c4..39374dae2176cb367932fd987dbaa60ef9256aee 100644 (file)
@@ -2,12 +2,15 @@
 %
 % Functions for direct and embedded PostScript
 
+
 /blot-diameter { lilypondpaperblotdiameter } bind def
 
 /set_tex_dimen {
        cvr def     
 } bind def
 
+
+
 /euclidean_length  
 { 
        1 copy mul exch 1 copy mul add sqrt 
 } bind def
 
 
-/draw_symmetric_x_triangle %  th w h
+/draw_symmetric_x_triangle % h w th
 {
     setlinewidth
     0 0 moveto
-    dup
-    0 rlineto
-    2 div
-    exch rlineto
+    dup 0 lineto
+    2 div 
+    exch lineto
     0 0 lineto
     stroke
 } bind def
 } bind def
 
 % Nice beam with rounded corners
-/draw_beam % slope width thick 
+/draw_beam % slope width thick  blot
 {
-       currentdict /testing known {
-               %% real thin lines for testing
-               /blot 0.005 def
-       }{
-               /blot blot-diameter def
-       } ifelse
+       /blot exch def 
        blot setlinewidth
 
        0 setlinecap
        } ifelse
 } bind def 
 
+/draw_polygon % x(n) y(n) x(n-1) y(n-1) ... x(1) y(1) n blot
+{
+       /blot exch def
+
+       0 setlinecap
+       blot setlinewidth
+       1 setlinejoin
+
+       /points exch def
+       2 copy
+       moveto
+       1 1 points {pop lineto} for
+       currentdict /testing known {
+               %% outline only, for testing:
+               stroke
+       }{
+               closepath gsave stroke grestore fill
+       } ifelse
+} bind def
+
 /draw_repeat_slash % width slope thick
 {
        1 setlinecap
 
 % this is for drawing slurs. 
 /draw_bezier_sandwich  % thickness controls 
-{ 
+{
+    % round ending and round beginning
+    1 setlinejoin 1 setlinecap
        setlinewidth 
        moveto 
        curveto 
        lineto 
-       curveto 
+       curveto
+       closepath
        gsave 
        fill 
        grestore 
        stroke 
 } bind def 
 
+%end music-drawing-routines.ps