X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=ps%2Fmusic-drawing-routines.ps;h=7ee1498305514a3c91fb72cc3fe783d1eac16a97;hb=9427d5505851c50c836e2747fea09140cb763889;hp=338272affd653db3c52d803a70e251fb9db9d8c4;hpb=367ed56704b509885a4928003b5aadcd5fa7820a;p=lilypond.git diff --git a/ps/music-drawing-routines.ps b/ps/music-drawing-routines.ps index 338272affd..7ee1498305 100644 --- a/ps/music-drawing-routines.ps +++ b/ps/music-drawing-routines.ps @@ -2,12 +2,13 @@ % % 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 @@ -17,12 +18,12 @@ % Nice rectangle with rounded corners /draw_box % breapth width depth height { - currentdict /testing known { +% currentdict /testing known { %% real thin lines for testing /blot 0.005 def - }{ - /blot blot-diameter def - } ifelse +% }{ +% /blot blot-diameter def +% } ifelse 0 setlinecap blot setlinewidth @@ -48,14 +49,13 @@ } 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 @@ -88,14 +88,9 @@ } 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 @@ -119,6 +114,26 @@ } 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 @@ -138,6 +153,19 @@ } bind def +/draw_white_text % text scale font +{ + %font + findfont + %scale + exch scalefont setfont + 1 setgray + 0 0 moveto + %-0.05 -0.05 moveto + % text + show +} bind def + /draw_ez_ball % ch letter_col ball_col font { % font @@ -192,12 +220,15 @@ % 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 @@ -210,6 +241,17 @@ 0 360 arc closepath fill stroke } bind def +/draw_white_dot % x1 y2 R +{ +% 0 360 arc fill stroke + 0 360 arc closepath % fill stroke +gsave + 1 setgray fill +grestore +% 0 360 arc closepath % fill stroke + 0.05 setlinewidth 0 setgray stroke +} bind def + /draw_dashed_line % dash thickness dx dy { 1 setlinecap @@ -356,3 +398,4 @@ stroke } bind def +%end music-drawing-routines.ps