1 % -%-Fundamental-%- -*-Metafont-*-
2 % parmesan-accidentals.mf -- implement ancient accidentals
4 % source file of LilyPond's pretty-but-neat music font
6 % (c) 2001--2006 Juergen Reuter <reuter@ipd.uka.de>
9 fet_begingroup ("accidentals");
20 fet_beginchar ("Ed. Med. Flat" , "medicaeaM1");
21 set_char_box (0.1 staff_space#, 0.6 staff_space#,
22 0.6 staff_space#, 1.0 staff_space#);
24 save ellipse, pat, outline, T;
25 path ellipse, pat, outline;
28 T := identity xscaled 0.50 linethickness
29 yscaled 0.22 staff_space;
30 pickup pencircle transformed T;
31 ellipse := fullcircle transformed T;
37 fill get_subpath (ellipse, up, down, z1)
38 -- get_subpath (ellipse, down, up, z2)
41 T := identity xscaled 0.50 linethickness
42 yscaled 0.22 staff_space
44 pickup pencircle transformed T;
45 ellipse := fullcircle transformed T;
47 z3 = (0.10 staff_space, -0.50 staff_space);
48 z4 = (0.40 staff_space, +0.40 staff_space);
49 z5 = (0.10 staff_space, +0.40 staff_space);
55 % the original envelope curve created with `draw' contains
56 % cusps which we avoid
57 outline := get_subpath (ellipse, -direction 0 of pat,
58 direction 0 of pat, z3)
59 .. get_subpoint (ellipse, direction 1 of pat, z4)
60 .. get_subpath (ellipse, direction 2 of pat,
61 -direction 1.8 of pat, z5)
62 .. get_subpoint (ellipse, -direction 1 of pat, z4)
69 % make the outline touch the bounding box
70 shift = find_tangent_shift (((w, -d) -- (w, h)), outline,
72 outline := outline shifted shift;
76 labels (1, 2, 3, 4, 5);
88 fet_beginchar ("Ed. Vat. Flat" , "vaticanaM1");
89 z1 = (0.00 staff_space, +0.80 staff_space);
90 z2 = (0.00 staff_space, -0.08 staff_space);
91 z3 = (0.25 staff_space, -0.23 staff_space);
92 z4 = (0.50 staff_space, -0.24 staff_space);
93 z5 = (0.50 staff_space, +0.03 staff_space);
94 z6 = (0.25 staff_space, +0.20 staff_space);
95 z7 = (0.15 staff_space, +0.26 staff_space);
101 T := identity xscaled 0.50 linethickness
102 yscaled 0.22 staff_space;
103 pickup pencircle transformed T;
104 ellipse := fullcircle transformed T;
114 % the original envelope curve created with `draw' contains
115 % cusps which we avoid
116 fill get_subpath (ellipse, up, down, z1)
117 -- get_subpath (ellipse, down, direction 1.1 of pat, z2)
119 ... get_subpath (ellipse, direction 2.9 of pat, up, z4)
120 -- get_subpath (ellipse, up, direction 4.1 of pat, z5)
122 .. get_subpath (ellipse,
123 direction 6 of pat, -direction 6 of pat, z7)
131 set_char_box (0.00 staff_space# + 0.25 linethickness#,
132 0.50 staff_space# + 0.25 linethickness#,
133 0.23 staff_space# + 0.11 staff_space#,
134 0.80 staff_space# + 0.11 staff_space#);
136 labels (1, 2, 3, 4, 5, 6, 7);
140 fet_beginchar ("Ed. Vat. Natural" , "vaticana0");
145 T := identity xscaled 0.80 linethickness
146 yscaled 0.22 staff_space;
147 pickup pencircle transformed T;
148 ellipse := fullcircle transformed T;
150 z1 = (0.00 staff_space, +0.65 staff_space);
151 z2 = (0.00 staff_space, -0.35 staff_space);
153 fill get_subpath (ellipse, up, down, z1)
154 -- get_subpath (ellipse, down, up, z2)
157 pickup penrazor scaled 0.22 staff_space
160 z3 = (0.00 staff_space, -0.30 staff_space);
161 z4 = (0.40 staff_space, -0.08 staff_space);
166 addto currentpicture also currentpicture
169 shifted (0.40 staff_space, 0.0 staff_space);
171 set_char_box (0.00 staff_space# + 0.40 linethickness#,
172 0.40 staff_space# + 0.40 linethickness#,
173 0.65 staff_space# + 0.11 staff_space#,
174 0.65 staff_space# + 0.11 staff_space#);
188 fet_beginchar ("Mensural Sharp" , "mensural1");
191 define_pixels (stemthick);
193 stemthick# = linethickness#;
199 T := identity scaled 0.8 stemthick;
200 pickup pencircle transformed T;
201 circle := fullcircle transformed T;
203 z1 = 0.4 staff_space * (0.8, 1);
206 pat := get_subpath (circle, z1 - z2, z2 - z1, z1)
207 -- get_subpath (circle, z2 - z1, z1 - z2, z2)
212 fill pat shifted (0.20 staff_space, 0);
213 fill pat xscaled -1 shifted (0.20 staff_space, 0);
215 set_char_box (0.8 * 0.4 staff_space# + 0.4 stemthick#,
216 (0.8 * 0.4 + 0.2) * staff_space# + 0.4 stemthick#,
217 0.4 staff_space# + 0.4 stemthick#,
218 0.4 staff_space# + 0.4 stemthick#);
224 fet_beginchar ("Mensural Flat" , "mensuralM1");
227 define_pixels (stemthick);
229 stemthick# = linethickness#;
231 save ellipse, pat, outline, T;
232 path ellipse, pat, outline;
235 T := identity xscaled 1.4 stemthick
236 yscaled 0.6 stemthick
238 pickup pencircle transformed T;
239 ellipse := fullcircle transformed T;
241 z1 = (0.00 staff_space, +1.80 staff_space);
242 z2 = (0.00 staff_space, -0.25 staff_space);
243 z3 = (0.35 staff_space, -0.25 staff_space);
244 z4 = (0.35 staff_space, +0.25 staff_space);
245 z5 = (0.00 staff_space, +0.25 staff_space);
257 % we approximate `draw pat'
258 for i = 2 step s until (length pat + 2):
259 dirs[i] := direction (i - 2) of pat;
262 outline := get_subpath (ellipse, up, down, z1)
263 -- get_subpath (ellipse, down, dirs2, z2)
264 for i = (2 + s) step s until (length pat + 2 - s):
265 .. get_subpoint (ellipse, dirs[i],
266 point (i - 2) of pat)
270 for i = (length pat + 2 - s) step -s until 2:
271 .. get_subpoint (ellipse, -dirs[i],
272 point (i - 2) of pat)
274 -- get_subpoint (ellipse, up, z2)
279 set_char_box (0.00 staff_space# + 0.75 stemthick#,
280 0.40 staff_space# + 0.75 stemthick#,
281 0.25 staff_space# + 0.75 stemthick#,
282 1.80 staff_space# + 0.75 stemthick#);
284 labels (1, 2, 3, 4, 5);
288 fet_beginchar ("Hufnagel Flat" , "hufnagelM1");
291 define_pixels (stemthick);
293 stemthick# = linethickness#;
295 save ellipse, pat, T;
299 T := identity xscaled 2.4 stemthick
300 yscaled 0.4 stemthick
302 pickup pencircle transformed T;
303 ellipse := fullcircle transformed T;
305 z1 = (0.00 staff_space, +1.80 staff_space);
306 z2 = (0.00 staff_space, -0.15 staff_space);
307 z3 = (0.25 staff_space, -0.30 staff_space);
308 z4 = (0.50 staff_space, +0.00 staff_space);
309 z5 = (0.30 staff_space, +0.30 staff_space);
310 z6 = (0.00 staff_space, +0.15 staff_space);
319 % we have to find the envelope intersections (if any)
320 t1 = find_envelope_cusp (reverse ellipse, pat, 1/256) + 3;
324 t2 = find_envelope_cusp (ellipse, reverse pat, 1/256);
328 t2 := length pat - t2 + 3;
336 % we approximate `draw pat'
337 for i = 3 step s until 5:
338 dirs[i] := direction (i - 3) of pat;
341 fill get_subpath (ellipse, up, down, z1)
342 -- get_subpath (ellipse, down, z3 - z2, z2)
343 -- get_subpoint (ellipse, z3 - z2, z3)
344 for i = 3 step s until 5:
345 .. get_subpoint (ellipse, dirs[i],
346 point (i - 3) of pat)
348 .. get_subpoint (ellipse, z6 - z5, z5)
349 -- get_subpoint (ellipse, z6 - z5, z6)
350 -- get_subpoint (ellipse, z5 - z6, z6)
351 -- get_subpoint (ellipse, z5 - z6, z5)
352 -- get_subpoint (ellipse, -dirs[5], z5)
353 for i = (5 - s) step -s until t2:
354 .. get_subpoint (ellipse, -dirs[i],
355 point (i - 3) of pat)
357 .. get_subpoint (ellipse, -direction (t2 - 3) of pat,
358 point (t2 - 3) of pat)
359 -- get_subpoint (ellipse, -direction (t1 - 3) of pat,
360 point (t1 - 3) of pat)
361 for i = (floor ((t1 - 3) / s) * s + 3) step -s until (3 + s):
362 .. get_subpoint (ellipse, -dirs[i],
363 point (i - 3) of pat)
365 .. get_subpoint (ellipse, -dirs[3], z3)
366 -- get_subpoint (ellipse, z2 - z3, z3)
367 -- get_subpoint (ellipse, z2 - z3, z2)
368 -- get_subpoint (ellipse, up, z2)
376 set_char_box (0.00 staff_space# + 1.0 stemthick#,
377 0.50 staff_space# + 1.0 stemthick#,
378 0.30 staff_space# + 0.5 stemthick#,
379 1.80 staff_space# + 0.5 stemthick#);
381 labels (1, 2, 3, 4, 5, 6);
385 fet_endgroup ("accidentals");