]> git.donarmstrong.com Git - lilypond.git/blob - mf/feta-schrift.mf
release: 0.1.20
[lilypond.git] / mf / feta-schrift.mf
1 %
2 % scripts
3 %
4
5
6 fet_begingroup("foobars")
7
8
9 def draw_fermata =
10         save alpha, radius, crook_thinness, crook_fatness, dot_diam;
11         
12         % [Wanske] and some  Baerenreiter editions
13         % suggest ca 80 degrees iso half-circle
14         alpha := 10;
15
16         radius# = 1.5 interline#;
17         crook_thinness# = 1.5stafflinethickness#;
18         crook_fatness# = 4 stafflinethickness#;
19
20         radius# + crook_fatness#/2 = h#;
21         radius# + crook_thinness#/2 = w#;
22         set_char_box(w#, w#, 0, h#);
23         
24         define_pixels(radius, crook_thinness, crook_fatness);
25         dot_diam = 4/3 crook_fatness;
26
27
28         penpos1(crook_thinness, 0);
29         penpos2(crook_fatness, -90);
30         z1 = (-radius,0);
31         z2 = (0, radius);
32
33         fill z1l{dir (-alpha-90)}..{dir (90-alpha)}z1r..
34                 {right}z2r -- z2l{left} .. cycle;
35
36         addto currentpicture also 
37                 currentpicture xscaled -1;
38
39         pickup pencircle scaled dot_diam;
40         x4 =0;
41         bot y4 = - crook_thinness/2;
42         draw z4;
43 enddef;
44
45 fet_beginchar("fermata up", "ufermata", "ufermata")
46         draw_fermata;   
47         penlabels(1,2,4);
48 fet_endchar;
49
50 fet_beginchar("fermata down", "dfermata", "dfermata")
51         draw_fermata;
52         currentpicture:=currentpicture yscaled -1 ;
53         set_char_box(w#, w#, h#, 0);
54         
55 fet_endchar;
56
57
58 %
59 % FIXME: rounded endings
60 %
61 % `\accent' is TeX reserved.
62 fet_beginchar("> accent", "accent", "sforzatoaccent")
63         set_char_box(.9 interline#, .9 interline#, .5 interline#, .5 interline#);
64         save thickness, diminish;
65
66         thickness = 2 stafflinethickness;
67
68         % prevent blobs at crossing lines
69         diminish = .75;
70
71         y1 + thickness/2 = h;
72         x1 = -b;
73         x2 = w;
74         y2 = .25 thickness* diminish;
75
76         z4 = (w,0);
77         x3 =0;
78         z3 = whatever [z1, z4];
79
80         penpos2(thickness*(2 - diminish)/2 , 90);
81         penpos1(thickness, 90);
82         penpos3(thickness, 90);
83
84         penstroke z1e .. z3e .. z2e;
85         penstroke (z1e .. z3e .. z2e) yscaled -1;
86
87         penlabels(1,2,3);
88 fet_endchar;
89
90 fet_beginchar("staccato dot", "staccato", "staccato")
91         save radius;
92         radius# = 1.25 stafflinethickness#;
93         define_pixels(radius);
94         pickup pencircle scaled 2 radius;
95         draw (0,0);
96         set_char_box(radius#, radius#, radius#, radius#);
97 fet_endchar;
98
99 def draw_staccatissimo =
100         save radius, height;
101         height# = .8 interline#;
102         radius# = 2 stafflinethickness#;
103         define_pixels(radius, height);
104
105         draw_brush((0,0), blot_diameter, (0, height),2 radius);
106         set_char_box(radius#,radius#, blot_diameter#/2, height# + radius#);
107 enddef;
108
109 fet_beginchar("staccatissimo/martellato up", "ustaccatissimo", 
110                 "ustaccatissimo")
111         draw_staccatissimo;
112 fet_endchar;
113
114 %
115 % FIXEM: scale labels too.
116 %
117 fet_beginchar("staccatissimo/martellato down", "dstaccatissimo", "dstaccatissimo")
118         draw_staccatissimo;
119         y_mirror_char;
120 fet_endchar;
121
122 fet_beginchar("portato/single tenuto", "tenuto", "tenuto")
123         save thick;
124         thick# = 1.2 stafflinethickness#;
125         define_pixels(thick);
126
127         set_char_box(.9 interline#, .9 interline#, thick#/2,thick#/2);
128         pickup pencircle scaled thick;
129         lft x1 = -b;
130         rt x2 = w;
131         y1 = y2 = 0;
132         draw z1 .. z2;
133 fet_endchar;
134
135
136 def draw_marcato = 
137         save fatness, thinness;
138         set_char_box(interline#/2, interline#/2, 0, 1.1 interline#);
139
140         fatness = 3 stafflinethickness;
141         thinness = .8 stafflinethickness;
142         x2 - x1  + blot_diameter = fatness;
143         x2 + thinness/2 = w;
144         
145         y1 = y2;
146         y1 = thinness/2;
147         z2 - z3 = whatever * (charwd, -charht);
148         z1 - z4 = whatever * (charwd, -charht);
149         z3 - z4 = whatever * (charwd, charht);
150         y3 + thinness/2 = h;
151         draw_rounded_path(z1 -- z2 -- z3 -- z4 -- cycle, thinness);
152
153         pickup pencircle scaled thinness;
154         z3 - z5 = whatever* (z3 - z4);
155         bot y5 = 0;
156         draw z3 .. z5;
157 enddef;
158
159 fet_beginchar("marcato up", "umarcato", "umarcato")
160         draw_marcato;
161         labels(1,2,3,4,5);
162 fet_endchar;
163
164
165 %
166 % The down marcato char (not very much used). 
167 % Contrary to what some MF/TeX `gurus' believe
168 % it is *point*-symmetric with the "up" version; (at least [Chlapik] 
169 % agrees with us)
170 %
171 fet_beginchar("marcato down", "dmarcato", "dmarcato")
172         draw_marcato;
173         xy_mirror_char;
174 fet_endchar;
175  
176 fet_beginchar("open (unstopped)", "open", "ouvert")
177         save thin, height, width, thick;
178         height# = 5/4 width#;
179         height# = 7/8 interline#;
180         thin = 1.2 stafflinethickness;
181         thick =  1.4 thin;
182         set_char_box(width#/2, width#/2, 0, height#);
183         
184         penpos1(thick, 0);
185         penpos2(thin, 90);
186         z1r = (w,h/2);
187         z2r = (0, h);
188         penlabels(1,2);
189         penstroke z1e{up} .. {left}z2e;
190         addto currentpicture also currentpicture xscaled -1;
191         addto currentpicture also currentpicture reflectedabout((w,h/2), (0,h/2));
192 fet_endchar;
193
194
195 fet_beginchar("plus (stopped)", "stopped", "plusstop")
196         save thick, size;
197         thick = 2 stafflinethickness;
198         size# = 1.1 interline#;
199
200         set_char_box(size#/2, size#/2, size#/2, size#/2);
201         pickup pencircle scaled thick;
202
203         rt x1 = w;
204         y1 = 0;
205         z2 = -z1;
206
207         draw z1 .. z2;
208         draw (z1 .. z2) rotated 90;
209 fet_endchar;
210
211 %
212 % FIXME: blotting 
213 %
214 fet_beginchar("Upbow", "upbow", "upbow")
215         save ht, wd, thick;
216
217         thick = 1.4 stafflinethickness;
218         wd# = 1.3 interline#;
219         ht# = 3/2 wd#; 
220
221         
222         set_char_box(wd#/2, wd#/2, 0, ht#);
223         pickup pencircle scaled thick;
224
225         x1 = 0;
226         bot y1 = 0;
227         rt x2 =  w;
228         top y2 = h;
229
230         labels(1,2);
231         draw z2 -- z1 -- (z2 xscaled -1);
232 fet_endchar;
233
234
235 fet_beginchar("Downbow", "downbow", "downbow")
236         save stemthick, beamheight;
237         save wd;
238         define_pixels(wd)
239
240         wd# = 7/4 interline#;
241         stemthick = 1.2 stafflinethickness;
242
243         set_char_box(wd#/2, wd#/2, 0, interline#);
244
245         beamheight = 4/10 h;
246
247
248         pickup pencircle scaled blot_diameter;
249         top y2 - bot y1  = beamheight;
250         top y2 = h;
251         rt x1 = w;
252         x1 = x2;
253         y2 = y3;
254         y1 = y4;
255         x3 = 0;
256         x4 = x3;
257         save p;
258         path p;
259         p := z1 -- z2 -- z3 -- z4 --cycle;
260         draw_rounded_path(p, blot_diameter);
261         pickup pencircle scaled stemthick;
262
263         bot y5 =0;
264         rt x5 = rt x6 = w;
265         y6 = h - beamheight;
266         draw z6 -- z5;
267         labels(1, 2,3,4,5,6);
268         addto currentpicture also currentpicture xscaled -1;
269 fet_endchar;
270
271 %
272 % FIXME the middle part (NW -> SE) may have some more (ok; it is
273 % negative: less) slope
274 %
275 fet_beginchar("Turn","turn","turn")
276         save thin, thick, ball_diam, darkness;
277         save wd, ht, thick_nibangle, ball_nib_thick;
278         save turndir;
279         pair turndir;
280
281         wd# = 35/16 interline#;
282         ht# = 18/17 interline#;
283         darkness = 1.3 stafflinethickness;
284
285         set_char_box(wd#/2, wd#/2, ht#/2, ht#/2);
286
287         thick_nibangle = 60;
288         thick = 3 darkness;
289         thin = darkness;
290         ball_nib_thick = 2.7 darkness;
291         ball_diam = ball_nib_thick + (h - ball_nib_thick) / 10;
292
293         
294         x3l = w;
295         y3 = 0;
296         y4l = h;
297         x4 = x2;
298         x2l = w/2;
299         y2l = -d;
300         z1 = (0,0);
301
302         penpos1(1.1 thick, thick_nibangle);
303         penpos2(thick, thick_nibangle);
304         penpos3(thin, 180);
305         penpos4(ball_nib_thick, -90);
306
307         path swoosh, ploop;
308         swoosh :=  z1l{curl 0} .. z2l .. z3l{up} .. {left}z4l 
309           -- z4r .. z3r{down} .. z2r{left} ;
310         fill swoosh .. (swoosh scaled -1) .. cycle;
311         penlabels(2,3,4);
312
313         x5r = x4;
314         y5r = y4l - ball_diam /2;
315         z6r = z5r;
316
317         penpos5(1.6 ball_diam/2, 10);
318         penpos6(ball_diam/2, 150);
319
320         ploop := z4l{left} .. z5l .. z6l -- cycle;
321         fill ploop;
322         fill ploop scaled -1;
323
324
325         penlabels(5,6,7);
326         
327 fet_endchar;
328
329 fet_endgroup("foobars");