]> git.donarmstrong.com Git - lilypond.git/blob - ps/lily.ps
release: 1.3.2
[lilypond.git] / ps / lily.ps
1 %!PS-Adobe-1.0: lily.ps 
2
3 % 2 setlanguagelevel %  hmm. auto_resize_dicts doesn't help either.  
4 % round cappings 
5 1 setlinecap 
6
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 % urg: the only Level-2 PS, check effect in print 
59 %       true setstrokeadjust 
60         /dir exch def 
61         setlinewidth 
62         1 setlinecap 
63         1 setlinejoin 
64         /tuplet_dy exch def 
65         /tuplet_dx exch def 
66         /tuplet_gapx exch def 
67         /tuplet_h exch def 
68         tuplet_dy tuplet_dx div tuplet_gapx mul /tuplet_gapy exch def 
69
70
71         0 0 moveto 
72         0 tuplet_h dir mul lineto  
73         tuplet_dx tuplet_gapx sub 2 div  
74                 tuplet_dy tuplet_gapy sub 2 div tuplet_h dir mul add lineto 
75         tuplet_dx tuplet_gapx add 2 div  
76                 tuplet_dy tuplet_gapy add 2 div tuplet_h dir mul add moveto 
77         tuplet_dx tuplet_dy tuplet_h dir mul add lineto 
78         tuplet_dx tuplet_dy lineto 
79         stroke 
80 } bind def 
81
82 /draw_volta % h w thick vert_start vert_end 
83
84         /vert_end exch def 
85         /vert_start exch def 
86         setlinewidth 
87         /volta_w exch def 
88         /volta_h exch def 
89 % urg: the only Level-2 PS, check effect in print 
90 %       true setstrokeadjust 
91         1 setlinecap 
92         1 setlinejoin 
93         vert_start 0 eq { 
94                 0 0 moveto 
95                 0 volta_h lineto 
96         } if 
97         0 volta_h moveto 
98         volta_w volta_h lineto 
99         vert_end 0 eq { 
100                 volta_w 0 lineto 
101         } if 
102         stroke 
103 } bind def 
104
105 % this is for drawing slurs. 
106 /draw_bezier_sandwich  % thickness  
107
108         setlinewidth 
109         moveto 
110         curveto 
111         lineto 
112         curveto 
113         gsave 
114         fill 
115         grestore 
116         stroke 
117 } bind def 
118
119 /draw_dashed_slur 
120
121         1 setlinecap 
122         1 setlinejoin 
123         setdash 
124         setlinewidth 
125         8 -2 roll 
126         moveto 
127         curveto 
128         stroke 
129 } bind def 
130
131
132
133 /bracket_traject 
134
135   /traject_ds exch def 
136   /traject_alpha exch def 
137   traject_ds traject_alpha sin mul add 
138   exch 
139   traject_ds traject_alpha cos mul add 
140   exch 
141 } bind def 
142
143
144
145 /half_bracket
146
147 %6 
148         0 0 
149 %5a 
150         arch_thick arch_height add half_height bracket_thick sub arch_width add 
151         arch_angle arch_height -0.15 mul bracket_traject 
152 %5b 
153         1 half_height 
154         0 arch_height 0.5 mul bracket_traject 
155 %5c 
156         0 half_height 
157 %4a 
158         arch_thick half_height bracket_thick sub 
159         0 arch_height 0.4 mul bracket_traject 
160 %4b 
161         arch_thick arch_height add half_height bracket_thick sub arch_width add 
162         arch_angle arch_height -0.25 mul bracket_traject 
163 %4c 
164         arch_thick arch_height add half_height bracket_thick sub arch_width add 
165 %3 
166         arch_thick half_height bracket_thick sub 
167 %2 
168         arch_thick 0 
169 %1 
170         0 0 
171 } bind def 
172
173 /draw_half_bracket { 
174         moveto 
175         lineto 
176         lineto 
177         curveto 
178         curveto 
179         lineto 
180         gsave 
181         fill 
182         grestore 
183 } bind def 
184
185 /draw_bracket % arch_angle arch_width arch_height bracket_width bracket_height arch_thick bracket_thick
186
187         % urg
188         /bracket_thick exch def
189         /arch_thick exch def
190         /bracket_height exch def
191         /bracket_width exch def
192         /arch_height exch def
193         /arch_width exch def
194         /arch_angle exch def
195 %
196         bracket_height 2 div arch_thick add /half_height exch def 
197 % urg: the only Level-2 PS, check effect in print 
198 %       true setstrokeadjust 
199         1 setlinecap 
200         1 setlinejoin 
201         half_bracket 
202         20 copy 
203         1 -1 scale 
204         draw_half_bracket 
205         stroke 
206         1 -1 scale 
207 % ugh, ugh: 
208         0.05 0 translate 
209         draw_half_bracket 
210         stroke 
211 } bind def 
212