]> git.donarmstrong.com Git - lilypond.git/blob - ps/lily.ps
patch::: 1.3.101.jcn2
[lilypond.git] / ps / lily.ps
1 %!PS-Adobe-1.0: lily.ps 
2 %
3 %
4
5 % round cappings 
6 1 setlinecap
7
8 /draw_beam % width slope thick 
9
10         2 div /beam_thick exch def 
11         /beam_slope exch def 
12         /beam_wd exch def 
13         beam_slope beam_wd mul /beam_ht exch def 
14         0 beam_thick neg moveto  
15         beam_wd beam_ht rlineto  
16         0 beam_thick 2 mul rlineto 
17         0 beam_thick lineto 
18         closepath fill 
19 } bind def 
20
21 /draw_decrescendo %  width height cons thick 
22
23         setlinewidth 
24         /cresc_cont exch def 
25         /cresc_ht exch def 
26         /cresc_wd exch def 
27
28         cresc_wd cresc_cont moveto 
29         0 cresc_ht lineto 
30         stroke 
31         cresc_wd cresc_cont neg moveto 
32         0 cresc_ht neg lineto 
33         stroke 
34 } bind def 
35
36 /draw_crescendo % width height cons thick 
37
38         setlinewidth 
39         /cresc_cont exch def 
40         /cresc_ht exch def 
41         /cresc_wd exch def 
42
43         0 cresc_cont moveto 
44         cresc_wd cresc_ht lineto 
45         stroke 
46         0 cresc_cont neg moveto 
47         cresc_wd cresc_ht neg lineto 
48         stroke 
49 } bind def 
50
51 /lily_distance  
52
53         1 copy mul exch 1 copy mul add sqrt 
54 } bind def 
55
56 /draw_tuplet % height gap dx dy thick dir 
57
58         /dir exch def 
59         setlinewidth 
60         1 setlinecap 
61         1 setlinejoin 
62         /tuplet_dy exch def 
63         /tuplet_dx exch def 
64         /tuplet_gapx exch def 
65         /tuplet_h exch def 
66         tuplet_dy tuplet_dx div tuplet_gapx mul /tuplet_gapy exch def 
67
68
69         0 0 moveto 
70         0 tuplet_h dir mul lineto  
71         tuplet_dx tuplet_gapx sub 2 div  
72                 tuplet_dy tuplet_gapy sub 2 div tuplet_h dir mul add lineto 
73         tuplet_dx tuplet_gapx add 2 div  
74                 tuplet_dy tuplet_gapy add 2 div tuplet_h dir mul add moveto 
75         tuplet_dx tuplet_dy tuplet_h dir mul add lineto 
76         tuplet_dx tuplet_dy lineto 
77         stroke 
78 } bind def 
79
80 /draw_volta % h w thick vert_start vert_end 
81
82         /vert_end exch def 
83         /vert_start exch def 
84         setlinewidth 
85         /volta_w exch def 
86         /volta_h exch def 
87         1 setlinecap 
88         1 setlinejoin 
89         vert_start 0 eq { 
90                 0 0 moveto 
91                 0 volta_h lineto 
92         } if 
93         0 volta_h moveto 
94         volta_w volta_h lineto 
95         vert_end 0 eq { 
96                 volta_w 0 lineto 
97         } if 
98         stroke 
99 } bind def 
100
101 % this is for drawing slurs. 
102 /draw_bezier_sandwich  % thickness controls 
103
104         setlinewidth 
105         moveto 
106         curveto 
107         lineto 
108         curveto 
109         gsave 
110         fill 
111         grestore 
112         stroke 
113 } bind def 
114
115 /draw_dashed_line % dash thickness dx dy
116
117         1 setlinecap 
118         1 setlinejoin 
119         setdash 
120         setlinewidth 
121         0 0 moveto
122         lineto
123         stroke 
124 } bind def 
125
126 /draw_dashed_slur % dash thickness controls
127
128         1 setlinecap 
129         1 setlinejoin 
130         setdash 
131         setlinewidth 
132         8 -2 roll 
133         moveto 
134         curveto 
135         stroke 
136 } bind def 
137
138
139
140 /bracket_traject 
141
142         /traject_ds exch def 
143         /traject_alpha exch def 
144         traject_ds traject_alpha sin mul add 
145         exch 
146         traject_ds traject_alpha cos mul add 
147         exch 
148 } bind def 
149
150
151
152 /half_bracket
153
154 %6 
155         0 0 
156 %5a 
157         bracket_thick arch_height add half_height arch_thick sub arch_width add 
158         arch_angle arch_height -0.15 mul bracket_traject 
159 %5b 
160         bracket_thick 0.5 mul half_height 
161         0 arch_height 0.5 mul bracket_traject 
162 %5c 
163         0 half_height 
164 %4a 
165         bracket_thick half_height arch_thick sub 
166         0 arch_height 0.4 mul bracket_traject 
167 %4b 
168         bracket_thick arch_height add half_height arch_thick sub arch_width add 
169         arch_angle arch_height -0.25 mul bracket_traject 
170 %4c 
171         bracket_thick arch_height add half_height arch_thick sub arch_width add 
172 %3 
173         bracket_thick half_height arch_thick sub 
174 %2 
175         bracket_thick 0 
176 %1 
177         0 0 
178 } bind def 
179
180 /draw_half_bracket { 
181         moveto 
182         lineto 
183         lineto 
184         curveto 
185         curveto 
186         lineto 
187         gsave 
188         fill 
189         grestore 
190 } bind def 
191
192 /draw_bracket % arch_angle arch_width arch_height bracket_width bracket_height arch_thick bracket_thick
193
194         % urg
195         /bracket_thick exch def
196         /arch_thick exch def
197         /bracket_height exch def
198         /bracket_width exch def
199         /arch_height exch def
200         /arch_width exch def
201         /arch_angle exch def
202
203         bracket_height 2 div bracket_thick add /half_height exch def 
204         bracket_thick 0.5 mul setlinewidth
205         1 setlinecap 
206         1 setlinejoin 
207         half_bracket 
208         20 copy 
209         1 -1 scale 
210         draw_half_bracket 
211         stroke 
212         1 -1 scale 
213         draw_half_bracket 
214         stroke 
215 } bind def 
216