1 %!PS-Adobe-1.0: lily.ps
3 % Functions for direct and embedded PostScript
10 1 copy mul exch 1 copy mul add sqrt
13 /simpledraw_box % breapth width depth height
27 %closepath gsave stroke grestore fill
32 % FIXME. translate to middle of box.
33 % Nice rectangle with rounded corners
34 /draw_box % breapth width depth height
41 l 2 div sub /h exch def
42 l 2 div sub /d exch def
43 l 2 div sub /w exch def
44 l 2 div sub /b exch def
51 closepath gsave stroke grestore fill
55 /simpledraw_beam % slope width thick
69 closepath gsave stroke grestore fill
72 % Nice beam with rounded corners
73 /draw_beam % slope width thick
83 l 2 div t 2 div neg moveto
88 closepath gsave stroke grestore fill
91 /draw_repeat_slash % width slope thick
96 beamthick beamthick slope div euclidean_length
100 width slope width mul rlineto
102 % width neg width angle sin mul neg rlineto
106 /draw_hairpin % width start_h end_h thick
120 /draw_tuplet % height gap dx dy thick dir
128 /tuplet_gapx exch def
130 tuplet_dy tuplet_dx div tuplet_gapx mul /tuplet_gapy exch def
133 0 tuplet_h neg dir mul moveto
135 tuplet_dx tuplet_gapx sub 2 div
136 tuplet_dy tuplet_gapy sub 2 div lineto
137 tuplet_dx tuplet_gapx add 2 div
138 tuplet_dy tuplet_gapy add 2 div moveto
139 tuplet_dx tuplet_dy lineto
140 tuplet_dx tuplet_dy tuplet_h dir neg mul add lineto
144 /draw_ez_ball % ch letter_col ball_col font
147 findfont 0.7 scalefont setfont
151 0.5 0 0.5 0 360 arc closepath fill stroke
156 0.5 0 0.4 0 360 arc closepath
161 % 0.25 is empiric centering. Change to taste
167 % Simple, but does it work everywhere?
168 % Han-Wen reports that one printer (brand?) at cs.uu.nl chokes on this,
169 % reverted for now -- jcn
171 % The filled circles are drawn by setting the linewidth
172 % to 2*radius and drawing a point.
173 /simple_draw_ez_ball % ch letter_col ball_col font
176 findfont 0.85 scalefont setfont
177 /origin { 0.45 0 } def
189 % 0.25 is empiric centering. Change to taste
196 /draw_volta % h w thick vert_start vert_end
210 volta_w volta_h lineto
217 % this is for drawing slurs.
218 /draw_bezier_sandwich % thickness controls
231 /draw_dashed_line % dash thickness dx dy
242 /draw_dashed_slur % dash thickness controls
259 /traject_alpha exch def
260 traject_ds traject_alpha sin mul add
262 traject_ds traject_alpha cos mul add
273 bracket_thick arch_height add half_height arch_thick sub arch_width add
274 arch_angle arch_height -0.15 mul bracket_traject
276 bracket_thick 0.5 mul half_height
277 0 arch_height 0.5 mul bracket_traject
281 bracket_thick half_height arch_thick sub
282 0 arch_height 0.4 mul bracket_traject
284 bracket_thick arch_height add half_height arch_thick sub arch_width add
285 arch_angle arch_height -0.25 mul bracket_traject
287 bracket_thick arch_height add half_height arch_thick sub arch_width add
289 bracket_thick half_height arch_thick sub
308 /draw_bracket % arch_angle arch_width arch_height bracket_height arch_thick bracket_thick
312 /bracket_thick exch def
314 /bracket_height exch def
315 /arch_height exch def
319 bracket_height 2 div bracket_thick add /half_height exch def
320 bracket_thick 0.5 mul setlinewidth