1 % feta-eindelijk.mf -- implement rest symbols -*-Fundamental-*-
3 % part of LilyPond's pretty-but-neat music font
5 % source file of the Feta (not the Font-En-Tja) music font
7 % (c) 1997--2001 Jan Nieuwenhuizen <janneke@gnu.org>
9 fet_begingroup("rests");
13 thick#:=1/16designsize;
14 define_blacker_pixels(thick);
16 rthin:=1/8*staff_space;
20 def shift_pic (expr pone, ptwo) =
21 currentpicture:=currentpicture shifted (round(pone),round(ptwo))
24 % stuff for 8th,16th etc rests
26 save stem, ball_crook_stem, ball_crook_balldiam, flare;
28 % stem#:=1/8*staff_space#;
29 stem# = 1/5staff_space#;
30 % flare# = 2/3staff_space#;
31 flare# = 2/3staff_space# - 1/8stafflinethickness#;
33 define_pixels(stem,flare);
35 ball_crook_stem = stem;
36 ball_crook_balldiam =flare;
39 save block_rest_y, block_rest_x;
41 block_rest_y# = 5/8 staff_space#;
42 block_rest_x# = 3/2 staff_space#;
44 define_pixels(block_rest_y, block_rest_x);
47 draw_block ((0,0), (block_rest_x, block_rest_y));
50 fet_beginchar( "whole rest", "0", "wholerest");
51 set_char_box(0, block_rest_x#,
54 currentpicture := currentpicture shifted (0,- block_rest_y);
57 fet_beginchar("half rest", "1", "halfrest");
58 set_char_box(0, block_rest_x#, 0, block_rest_y#);
64 % should use ledgerline thickness?
66 fet_beginchar( "whole rest (outside staff)", "0o", "outsidewholerest");
67 set_char_box(0, block_rest_x#,
68 block_rest_y#, ledgerlinethickness#/2);
70 currentpicture := currentpicture shifted (0, - block_rest_y);
71 pickup pencircle scaled ledgerlinethickness;
74 lft x5 = - b - block_rest_y;
75 rt x6 = w + block_rest_y;
79 fet_beginchar("half rest (outside staff)", "1o", "outsidehalfrest");
80 set_char_box(0, block_rest_x#,
81 ledgerlinethickness#/2, block_rest_y#);
83 pickup pencircle scaled ledgerlinethickness;
85 lft x5 = - b - block_rest_y ;
86 rt x6 = w + block_rest_y;
91 save breve_rest_y, breve_rest_x;
93 breve_rest_y# = staff_space#;
94 breve_rest_x# = 3/5 staff_space#;
95 multi_rest_x# = 4 staff_space#;
96 multi_beam_height# = 1/3 staff_space#;
98 define_pixels(breve_rest_y, breve_rest_x, multi_rest_x, multi_beam_height);
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));
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));
110 tracingvariables := 1;
112 fet_beginchar("multi rest", "-4", "multirest");
113 set_char_box(multi_rest_x#, multi_rest_x#,
114 breve_rest_y#, breve_rest_y#);
115 draw_block ((- b, - multi_beam_height),
116 (w, multi_beam_height));
117 draw_block ((- b,-breve_rest_y),
118 (rthin - b, breve_rest_y));
119 draw_block ((w - rthin,-breve_rest_y),
123 fet_beginchar("Quarter rest","2","quartrest");
124 % draw_staff (-2, 2, 0.0);
125 save alpha, yshift, height;
127 yshift# = -1.25 staff_space#;
128 height# = 2.8125 staff_space#;
129 define_pixels (yshift, height);
132 set_char_box(0, 27/25staff_space#,
136 save ne,nw,se,sw; pair ne,nw,se,sw;
138 se=dir alpha; nw=dir (alpha+180);
139 ne=dir (alpha+90); sw=dir (alpha-90);
140 penpos1(rthin,alpha+90);
141 penpos2(5/4rthick,alpha);
142 penpos4(5/4rthick,alpha);
143 penpos5(rthin,alpha+90);
144 penpos3(3/4rthick,alpha);
145 % penpos6(5/8rthick,alpha);
146 penpos6(2/3rthick,alpha);
147 penpos7(1/2rthin,alpha+90);
150 % z11=z4l+1/2rthin*sw;
151 z11=z4l+1/2rthin*sw+1/2rthin*se;
153 % z13=z2r+1/2rthin*ne;
154 z13=z2r+1/2rthin*ne+1/2rthin*nw;
158 z2r=z1+staff_space*se;
162 z5=z4l+1.3staff_space*se;
168 fill z1l{se}..{se}z10..z3l..z11{se}..{se}z5l..z5r{nw}..{nw}z12..z3r..z13{nw}..{nw}z1r.. cycle;
169 fill z5r{nw}..tension1.4..z6l..tension1.4..{se}z7l..z7r{nw}..tension1.4..z6r..tension1.4..{se}z5l..cycle;
170 penlabels(1,2,3,4,5,6,7);
171 penlabels(10,11,12,13);
173 % 3/4 staff_space# + yshift#,
174 % 18/5staff_space# + yshift#)
178 def rest_crook(expr a, w) =
179 balled_crook(a, w, ball_crook_balldiam, ball_crook_stem)
182 fet_beginchar("8th rest","3","eighthrest");
183 % draw_staff (-2, 2, 0.0);
184 save yshift, ballcorrection;
185 ballcorrection = 0.005 staff_space;
187 yshift# := -1.0 staff_space#;
188 define_pixels(yshift);
191 set_char_box(0, 4/3staff_space#, -yshift#, yshift# +
192 5/3staff_space#+7/4stafflinethickness#);
195 % The curve is like a valley causing less space between
196 % the curve and the lower staff line. Correct for this.
202 y1 = yshift + 1.5 staff_space + flare/4 + ballcorrection;
203 rest_crook (z1,w-stem/6);
204 z2-z1=whatever*dir70;
206 brush(z1,2/3stem,z2,stem);
210 fet_beginchar("16th rest","4","sixteenthrest");
211 % draw_staff (-2, 2, 0.0);
212 save yshift, ballcorrection;
213 ballcorrection = 0.005 staff_space;
215 yshift# := - 2 staff_space#;
216 define_pixels(yshift);
218 save alpha,cw,h,w, height;
221 height# = 5/3staff_space#+staff_space#+7/4stafflinethickness#;
222 set_char_box(0, cw#+(height#-3/2staff_space#)/tand(alpha),
223 -yshift#, height# + yshift#);
228 y1 = yshift + 2.5 staff_space + flare/4 + ballcorrection;
230 z2-z1=whatever*dir alpha;
232 brush(z1,2/3stem,z2,stem);
234 z3-z1=whatever*dir alpha;
240 fet_beginchar("32th rest","5","thirtysecondrest");
241 % draw_staff (-2, 2, 0.0);
242 save yshift, ballcorrection;
243 ballcorrection = 0.005 staff_space;
245 yshift# := -2 staff_space#;
246 define_pixels(yshift);
251 h#=5/3staff_space#+2staff_space#+7/4stafflinethickness#;
253 set_char_box(0, cw#+(h#-3/2staff_space#)/tand(alpha),
254 -yshift#,yshift# +h#);
258 y1 = yshift + 3.5 staff_space + flare/4 + ballcorrection;
260 z2-z1=whatever*dir alpha;
262 brush(z1,2/3stem,z2,stem);
264 z3-z1=whatever*dir alpha;
267 z4-z1=whatever*dir alpha;
272 fet_beginchar("64th rest","6","sixtyfourthrest");
273 % draw_staff (-2, 2, 0.0);
274 save yshift, ballcorrection;
275 ballcorrection = 0.005 staff_space;
277 yshift# := -3 staff_space#;
278 define_pixels(yshift);
283 h#=5/3staff_space#+3staff_space#+7/4stafflinethickness#;
284 w#=cw#+(h#-3/2staff_space#)/tand(alpha);
285 set_char_box(0,w#,-yshift# ,yshift# + h#);
291 y1 = yshift + 4.5 staff_space + flare/4 + ballcorrection;
293 z2-z1=whatever*dir alpha;
295 brush (z1,2/3stem,z2,stem);
297 z3-z1=whatever*dir alpha;
300 z4-z1=whatever*dir alpha;
303 z5-z1=whatever*dir alpha;
309 fet_beginchar("128th rest","7","hundredtwentyeighthrest");
310 % draw_staff (-2, 2, 0.0);
311 save yshift, ballcorrection;
312 ballcorrection = 0.005 staff_space;
314 yshift# := -3 staff_space#;
315 define_pixels(yshift);
319 h#=5/3staff_space#+4staff_space#+7/4stafflinethickness#;
320 w#=cw#+(h#-3/2staff_space#)/tand(alpha);
321 set_char_box(0,w#, -yshift#,yshift# + h#);
325 y1 = yshift + 5.5 staff_space + flare/4 + ballcorrection;
327 z2-z1=whatever*dir alpha;
329 brush (z1,2/3stem,z2,stem);
331 z3-z1=whatever*dir alpha;
334 z4-z1=whatever*dir alpha;
337 z5-z1=whatever*dir alpha;
340 z6-z1=whatever*dir alpha;
348 % Rest symbols for mensural notation:
350 mensrestsize# = .8staff_space#;
352 fet_beginchar("Mensural 4th rest","2mensural","minimarest")
353 set_char_box(0,mensrestsize#,0,mensrestsize#);
354 pickup pencircle scaled 2 stafflinethickness;
365 fet_beginchar("Mensural 8th rest","3mensural","fusarest")
366 set_char_box(0,mensrestsize#,0,mensrestsize#);
367 pickup pencircle scaled 2 stafflinethickness;
378 fet_beginchar("Mensural 16th rest","4mensural","semifusarest")
379 set_char_box(0,mensrestsize#,0,staff_space#);
380 pickup pencircle scaled 2 stafflinethickness;
388 pickup pencircle scaled 2 stafflinethickness;
402 fet_endgroup("rests")