]> git.donarmstrong.com Git - lilypond.git/blob - mf/feta-eindelijk.mf
release: 1.1.41
[lilypond.git] / mf / feta-eindelijk.mf
1 % feta-eindelijk.mf -- implement rest symbols -*-Fundamental-*-
2 %
3 % part of LilyPond's pretty-but-neat music font
4 %
5 % source file of the Feta (not the Font-En-Tja) music font
6
7 % (c) 1997, 1998 Jan Nieuwenhuizen <janneke@gnu.org>
8
9 fet_begingroup("rests");
10
11 begingroup
12
13 thick#:=1/16designsize;
14 define_blacker_pixels(thick);
15
16 rthin:=1/8*interline;
17 % rthick:=2rthin;
18 rthick:=2thick+rthin;
19
20 def shift_pic (expr pone, ptwo) =
21   currentpicture:=currentpicture shifted (round(pone),round(ptwo))
22 enddef;
23
24 % stuff for     8th,16th etc rests
25 %
26 save stem, ball_crook_stem, ball_crook_balldiam, flare;
27
28 % stem#:=1/8*interline#;
29 stem# = 1/5interline#;
30 % flare# = 2/3interline#;
31 flare# = 2/3interline# - 1/8stafflinethickness#;
32
33 define_pixels(stem,flare);
34
35 ball_crook_stem = stem;
36 ball_crook_balldiam =flare;
37
38
39 save block_rest_y, block_rest_x;
40
41 block_rest_y# = 5/8 interline#;
42 block_rest_x# = 3/2 interline#;
43
44 define_pixels(block_rest_y, block_rest_x);
45
46 def block_rest =
47         draw_block ((0,0), (block_rest_x, block_rest_y));
48         enddef;
49
50 fet_beginchar( "whole rest", "0", "wholerest");
51         set_char_box(0, block_rest_x#,
52                 block_rest_y#,  0);
53         block_rest;
54         currentpicture := currentpicture shifted (0,- block_rest_y);
55 fet_endchar;
56
57 fet_beginchar("half rest", "1", "halfrest");
58         set_char_box(0, block_rest_x#, 0, block_rest_y#);
59         block_rest;
60 fet_endchar;
61
62
63 %
64 % should use ledgerline thickness?
65 %
66 fet_beginchar( "whole rest (outside staff)", "0o", "outsidewholerest");
67         set_char_box(0, block_rest_x#,
68                 block_rest_y#, ledgerlinethickness#/2);
69         block_rest;
70         currentpicture := currentpicture shifted (0, - block_rest_y);
71         pickup pencircle scaled ledgerlinethickness;
72
73         y5 = y6 = 0;
74         lft x5 = - b - block_rest_y;
75         rt x6 = w + block_rest_y;
76         draw z5 .. z6;
77 fet_endchar;
78
79 fet_beginchar("half rest (outside staff)", "1o", "outsidehalfrest");
80         set_char_box(0, block_rest_x#,
81                 ledgerlinethickness#/2, block_rest_y#);
82         block_rest;
83         pickup pencircle scaled ledgerlinethickness;
84         y5 = y6 = 0;
85         lft x5 = - b - block_rest_y ;  
86         rt x6 = w + block_rest_y;
87         draw z5 .. z6;
88 fet_endchar;
89
90
91 save breve_rest_y, breve_rest_x;
92
93 breve_rest_y# =  interline#;
94 breve_rest_x# = 3/5 interline#;
95 multi_rest_x# = 2 interline#;
96 multi_rest_y# = 1/3 interline#;
97
98 define_pixels(breve_rest_y, breve_rest_x, multi_rest_x, multi_rest_y);
99
100 fet_beginchar("breve rest", "-1", "breverest");
101        set_char_box(0, breve_rest_x#, 0, breve_rest_y#);
102        draw_block ((0,0), (breve_rest_x, breve_rest_y));
103 fet_endchar;
104
105 fet_beginchar("longa rest", "-2", "longarest");
106        set_char_box(0, breve_rest_x#, breve_rest_y#, breve_rest_y#);
107        draw_block ((0,-breve_rest_y), (breve_rest_x, breve_rest_y));
108 fet_endchar;
109
110 fet_beginchar("multi rest", "-4", "multirest");
111        set_char_box(multi_rest_x#, multi_rest_x#,
112                     breve_rest_y#, breve_rest_y#);
113        draw_block ((-multi_rest_x, -multi_rest_y),
114                    (multi_rest_x, multi_rest_y));
115        draw_block ((-multi_rest_x,-breve_rest_y),
116                    (rthin-multi_rest_x, breve_rest_y));
117        draw_block ((multi_rest_x-rthin,-breve_rest_y),
118                    (multi_rest_x, breve_rest_y));
119 fet_endchar;
120
121 fet_beginchar("Quarter rest","2","quartrest");
122 %       draw_staff (-2, 2, 0.0);        
123         save alpha, yshift, height;
124         alpha:=-50;
125         yshift# = -1.25 interline#;
126         height# = 2.8125 interline#;
127         define_pixels (yshift, height);
128
129         
130         set_char_box(0, 27/25interline#,
131           -yshift#,
132           yshift# + height#);
133         
134         save ne,nw,se,sw; pair ne,nw,se,sw;
135         
136         se=dir alpha; nw=dir (alpha+180);
137         ne=dir (alpha+90); sw=dir (alpha-90);
138         penpos1(rthin,alpha+90);
139         penpos2(5/4rthick,alpha);
140         penpos4(5/4rthick,alpha);
141         penpos5(rthin,alpha+90);
142         penpos3(3/4rthick,alpha);
143 %       penpos6(5/8rthick,alpha);
144         penpos6(2/3rthick,alpha);
145         penpos7(1/2rthin,alpha+90);
146
147         z10=z2l+1/2rthin*sw;
148 %       z11=z4l+1/2rthin*sw;
149         z11=z4l+1/2rthin*sw+1/2rthin*se;
150         z12=z4r+1/2rthin*ne;
151 %       z13=z2r+1/2rthin*ne;
152         z13=z2r+1/2rthin*ne+1/2rthin*nw;
153
154         y1r = h;
155         x1l=1/3interline;
156         z2r=z1+interline*se;
157         z3=1/2[z2,z4];
158         x4=3/8interline;
159         y4= 0;
160         z5=z4l+1.3interline*se;
161         x6l=x4l;
162         y6l=y4r;
163         x7=2/5interline;
164         y7= -d;
165         
166         fill z1l{se}..{se}z10..z3l..z11{se}..{se}z5l..z5r{nw}..{nw}z12..z3r..z13{nw}..{nw}z1r.. cycle;
167         fill z5r{nw}..tension1.4..z6l..tension1.4..{se}z7l..z7r{nw}..tension1.4..z6r..tension1.4..{se}z5l..cycle;
168         penlabels(1,2,3,4,5,6,7);
169         penlabels(10,11,12,13);
170         
171 %         3/4 interline# + yshift#,
172 %         18/5interline# + yshift#)
173
174         fet_endchar;
175
176 def rest_crook(expr a, w) =
177         balled_crook(a, w, ball_crook_balldiam, ball_crook_stem)
178 enddef;
179
180 fet_beginchar("8th rest","3","eighthrest");
181 %       draw_staff (-2, 2, 0.0);
182         save yshift, ballcorrection;
183         ballcorrection = 0.005 interline;
184
185         yshift# := -1.0 interline#;
186         define_pixels(yshift);
187
188
189         set_char_box(0, 4/3interline#, -yshift#, yshift# +
190                         5/3interline#+7/4stafflinethickness#);
191
192         %
193         % The curve is like a valley causing less space between
194         % the curve and the lower staff line. Correct for this.
195         % 
196         save x,y;
197
198         x1=w-stem/6;
199
200         y1 = yshift + 1.5 interline + flare/4 + ballcorrection; 
201         rest_crook (z1,w-stem/6);
202         z2-z1=whatever*dir70;
203         y2= yshift + stem/2;
204         brush(z1,2/3stem,z2,stem);
205
206         fet_endchar;
207
208 fet_beginchar("16th rest","4","sixteenthrest");
209 %       draw_staff (-2, 2, 0.0);
210         save yshift, ballcorrection;
211         ballcorrection = 0.005 interline;
212
213         yshift# := - 2 interline#;
214         define_pixels(yshift);
215
216         save alpha,cw,h,w, height;
217         alpha=74;
218         cw#=7/6interline#;
219         height# =  5/3interline#+interline#+7/4stafflinethickness#;
220         set_char_box(0, cw#+(height#-3/2interline#)/tand(alpha),
221                 -yshift#, height# + yshift#);
222
223         define_pixels(cw);
224         save x,y;
225         x1=w-stem/6;
226         y1 = yshift + 2.5 interline + flare/4 + ballcorrection;
227
228         z2-z1=whatever*dir alpha;
229         y2= yshift + stem/2;
230         brush(z1,2/3stem,z2,stem);
231         rest_crook (z1,cw);
232         z3-z1=whatever*dir alpha;
233         y3=y1-interline;
234         rest_crook (z3,cw);
235         penlabels(1,2);
236         fet_endchar;
237
238 fet_beginchar("32th rest","5","thirtysecondrest");
239 %       draw_staff (-2, 2, 0.0);
240         save yshift, ballcorrection;
241         ballcorrection = 0.005 interline;
242
243         yshift# := -2 interline#;
244         define_pixels(yshift);
245
246         save alpha,cw,h;
247         alpha=76;
248         cw#=7/6interline#;
249         h#=5/3interline#+2interline#+7/4stafflinethickness#;
250
251         set_char_box(0, cw#+(h#-3/2interline#)/tand(alpha),
252                 -yshift#,yshift# +h#);
253         define_pixels(cw);
254         save x,y;
255         x1=w-stem/6;
256         y1 = yshift + 3.5 interline + flare/4 + ballcorrection;
257
258         z2-z1=whatever*dir alpha;
259         y2=stem/2 + yshift;
260         brush(z1,2/3stem,z2,stem);
261         rest_crook (z1,cw);
262         z3-z1=whatever*dir alpha;
263         y3=y1-interline;
264         rest_crook (z3,cw);
265         z4-z1=whatever*dir alpha;
266         y4=y1-2interline;
267         rest_crook (z4,cw);
268         fet_endchar;
269
270 fet_beginchar("64th rest","6","sixtyfourthrest");
271 %       draw_staff (-2, 2, 0.0);
272         save yshift, ballcorrection;
273         ballcorrection = 0.005 interline;
274
275         yshift# := -3 interline#;
276         define_pixels(yshift);
277
278         save alpha,cw,h,w;
279         alpha=78;
280         cw#=7/6interline#;
281         h#=5/3interline#+3interline#+7/4stafflinethickness#;
282         w#=cw#+(h#-3/2interline#)/tand(alpha);
283         set_char_box(0,w#,-yshift# ,yshift# + h#);
284
285         define_pixels(cw);
286         save x,y;
287         x1=w-stem/6;
288
289         y1 = yshift + 4.5 interline + flare/4 + ballcorrection;
290
291         z2-z1=whatever*dir alpha;
292         y2=stem/2 + yshift;
293         brush (z1,2/3stem,z2,stem);
294         rest_crook (z1,cw);
295         z3-z1=whatever*dir alpha;
296         y3=y1-interline;
297         rest_crook (z3,cw);
298         z4-z1=whatever*dir alpha;
299         y4=y1-2interline;
300         rest_crook (z4,cw);
301         z5-z1=whatever*dir alpha;
302         y5=y1-3interline;
303         rest_crook (z5,cw);
304
305         fet_endchar;
306
307 fet_beginchar("128th rest","7","hundredtwentyeighthrest"); 
308 %       draw_staff (-2, 2, 0.0);
309         save yshift, ballcorrection;
310         ballcorrection = 0.005 interline;
311
312         yshift# := -3 interline#;
313         define_pixels(yshift);
314         save alpha,cw,h,w;
315         alpha=78;
316         cw#=7/6interline#;
317         h#=5/3interline#+4interline#+7/4stafflinethickness#;
318         w#=cw#+(h#-3/2interline#)/tand(alpha);
319         set_char_box(0,w#, -yshift#,yshift#  + h#);
320         define_pixels(cw);
321         save x,y;
322         x1=w-stem/6;
323         y1 = yshift + 5.5 interline + flare/4 + ballcorrection;
324
325         z2-z1=whatever*dir alpha;
326         y2=stem/2 + yshift;
327         brush (z1,2/3stem,z2,stem);
328         rest_crook (z1,cw);
329         z3-z1=whatever*dir alpha;
330         y3=y1-interline;
331         rest_crook (z3,cw);
332         z4-z1=whatever*dir alpha;
333         y4=y1-2interline;
334         rest_crook (z4,cw);
335         z5-z1=whatever*dir alpha;
336         y5=y1-3interline;
337         rest_crook (z5,cw);
338         z6-z1=whatever*dir alpha;
339         y6=y1-4interline;
340         rest_crook (z6,cw);
341         
342         fet_endchar;
343
344 endgroup;
345
346 % Rest symbols for mensural notation:
347
348 mensrestsize# = .8interline#;
349
350 fet_beginchar("Mensural 4th rest","2mensural","minimarest")
351         set_char_box(0,mensrestsize#,0,mensrestsize#);
352         pickup pencircle scaled 2 stafflinethickness;
353         lft x1 = 0;
354         bot y1 = 0;
355         lft x2 = 0;
356         top y2 = h;
357         rt x3 = w;
358         bot y3 = h/2;
359         draw z1 .. z2;
360         draw z2 .. z3;
361 fet_endchar
362
363 fet_beginchar("Mensural 8th rest","3mensural","fusarest")
364         set_char_box(0,mensrestsize#,0,mensrestsize#);
365         pickup pencircle scaled 2 stafflinethickness;
366         rt x1 = w;
367         bot y1 = 0;
368         rt x2 = w;
369         top y2 = h;
370         lft x3 = 0;
371         bot y3 = h/2;
372         draw z1 .. z2;
373         draw z2 .. z3;
374 fet_endchar
375
376 fet_beginchar("Mensural 16th rest","4mensural","semifusarest")
377         set_char_box(0,mensrestsize#,0,interline#);
378         pickup pencircle scaled 2 stafflinethickness;
379         rt x1 = w;
380         bot y1 = 0;
381         rt x2 = w;
382         top y2 = h;
383
384         draw z1 .. z2;
385
386         pickup pencircle scaled 2 stafflinethickness;
387         rt x3 = w;
388         top y3 = h;
389         lft x4 = 0;
390         bot y4 = h/2;
391         rt x5 = w;
392         top y5 = 5/8h;
393         lft x6 = 0;
394         bot y6 = h/8;
395
396         draw z3 .. z4;
397         draw z5 .. z6;
398 fet_endchar
399
400 fet_endgroup("rests")