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, 1998 Jan Nieuwenhuizen <janneke@gnu.org>
9 fet_begingroup("rests");
13 thick#:=1/16designsize;
14 define_blacker_pixels(thick);
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*interline#;
29 stem# = 1/5interline#;
30 % flare# = 2/3interline#;
31 flare# = 2/3interline# - 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 interline#;
42 block_rest_x# = 3/2 interline#;
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# = interline#;
94 breve_rest_x# = 3/5 interline#;
95 multi_rest_x# = 2 interline#;
96 multi_rest_y# = 1/3 interline#;
98 define_pixels(breve_rest_y, breve_rest_x, multi_rest_x, multi_rest_y);
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 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));
121 fet_beginchar("Quarter rest","2","quartrest");
122 % draw_staff (-2, 2, 0.0);
123 save alpha, yshift, height;
125 yshift# = -1.25 interline#;
126 height# = 2.8125 interline#;
127 define_pixels (yshift, height);
130 set_char_box(0, 27/25interline#,
134 save ne,nw,se,sw; pair ne,nw,se,sw;
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);
148 % z11=z4l+1/2rthin*sw;
149 z11=z4l+1/2rthin*sw+1/2rthin*se;
151 % z13=z2r+1/2rthin*ne;
152 z13=z2r+1/2rthin*ne+1/2rthin*nw;
160 z5=z4l+1.3interline*se;
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);
171 % 3/4 interline# + yshift#,
172 % 18/5interline# + yshift#)
176 def rest_crook(expr a, w) =
177 balled_crook(a, w, ball_crook_balldiam, ball_crook_stem)
180 fet_beginchar("8th rest","3","eighthrest");
181 % draw_staff (-2, 2, 0.0);
182 save yshift, ballcorrection;
183 ballcorrection = 0.005 interline;
185 yshift# := -1.0 interline#;
186 define_pixels(yshift);
189 set_char_box(0, 4/3interline#, -yshift#, yshift# +
190 5/3interline#+7/4stafflinethickness#);
193 % The curve is like a valley causing less space between
194 % the curve and the lower staff line. Correct for this.
200 y1 = yshift + 1.5 interline + flare/4 + ballcorrection;
201 rest_crook (z1,w-stem/6);
202 z2-z1=whatever*dir70;
204 brush(z1,2/3stem,z2,stem);
208 fet_beginchar("16th rest","4","sixteenthrest");
209 % draw_staff (-2, 2, 0.0);
210 save yshift, ballcorrection;
211 ballcorrection = 0.005 interline;
213 yshift# := - 2 interline#;
214 define_pixels(yshift);
216 save alpha,cw,h,w, height;
219 height# = 5/3interline#+interline#+7/4stafflinethickness#;
220 set_char_box(0, cw#+(height#-3/2interline#)/tand(alpha),
221 -yshift#, height# + yshift#);
226 y1 = yshift + 2.5 interline + flare/4 + ballcorrection;
228 z2-z1=whatever*dir alpha;
230 brush(z1,2/3stem,z2,stem);
232 z3-z1=whatever*dir alpha;
238 fet_beginchar("32th rest","5","thirtysecondrest");
239 % draw_staff (-2, 2, 0.0);
240 save yshift, ballcorrection;
241 ballcorrection = 0.005 interline;
243 yshift# := -2 interline#;
244 define_pixels(yshift);
249 h#=5/3interline#+2interline#+7/4stafflinethickness#;
251 set_char_box(0, cw#+(h#-3/2interline#)/tand(alpha),
252 -yshift#,yshift# +h#);
256 y1 = yshift + 3.5 interline + flare/4 + ballcorrection;
258 z2-z1=whatever*dir alpha;
260 brush(z1,2/3stem,z2,stem);
262 z3-z1=whatever*dir alpha;
265 z4-z1=whatever*dir alpha;
270 fet_beginchar("64th rest","6","sixtyfourthrest");
271 % draw_staff (-2, 2, 0.0);
272 save yshift, ballcorrection;
273 ballcorrection = 0.005 interline;
275 yshift# := -3 interline#;
276 define_pixels(yshift);
281 h#=5/3interline#+3interline#+7/4stafflinethickness#;
282 w#=cw#+(h#-3/2interline#)/tand(alpha);
283 set_char_box(0,w#,-yshift# ,yshift# + h#);
289 y1 = yshift + 4.5 interline + flare/4 + ballcorrection;
291 z2-z1=whatever*dir alpha;
293 brush (z1,2/3stem,z2,stem);
295 z3-z1=whatever*dir alpha;
298 z4-z1=whatever*dir alpha;
301 z5-z1=whatever*dir alpha;
307 fet_beginchar("128th rest","7","hundredtwentyeighthrest");
308 % draw_staff (-2, 2, 0.0);
309 save yshift, ballcorrection;
310 ballcorrection = 0.005 interline;
312 yshift# := -3 interline#;
313 define_pixels(yshift);
317 h#=5/3interline#+4interline#+7/4stafflinethickness#;
318 w#=cw#+(h#-3/2interline#)/tand(alpha);
319 set_char_box(0,w#, -yshift#,yshift# + h#);
323 y1 = yshift + 5.5 interline + flare/4 + ballcorrection;
325 z2-z1=whatever*dir alpha;
327 brush (z1,2/3stem,z2,stem);
329 z3-z1=whatever*dir alpha;
332 z4-z1=whatever*dir alpha;
335 z5-z1=whatever*dir alpha;
338 z6-z1=whatever*dir alpha;
346 % Rest symbols for mensural notation:
348 mensrestsize# = .8interline#;
350 fet_beginchar("Mensural 4th rest","2mensural","minimarest")
351 set_char_box(0,mensrestsize#,0,mensrestsize#);
352 pickup pencircle scaled 2 stafflinethickness;
363 fet_beginchar("Mensural 8th rest","3mensural","fusarest")
364 set_char_box(0,mensrestsize#,0,mensrestsize#);
365 pickup pencircle scaled 2 stafflinethickness;
376 fet_beginchar("Mensural 16th rest","4mensural","semifusarest")
377 set_char_box(0,mensrestsize#,0,interline#);
378 pickup pencircle scaled 2 stafflinethickness;
386 pickup pencircle scaled 2 stafflinethickness;
400 fet_endgroup("rests")