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" , "medicaea-1");
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;
25 path ellipse, pat, outline;
27 pickup pencircle xscaled 0.50 linethickness
28 yscaled 0.22 staff_space;
30 ellipse := fullcircle xscaled 0.5 linethickness
31 yscaled 0.22 staff_space;
37 fill get_subpath (ellipse, up, down, z1)
38 -- get_subpath (ellipse, down, up, z2)
41 pickup pencircle xscaled 0.50 linethickness
42 yscaled 0.22 staff_space
45 ellipse := fullcircle xscaled 0.50 linethickness
46 yscaled 0.22 staff_space
49 z3 = (0.10 staff_space, -0.50 staff_space);
50 z4 = (0.40 staff_space, +0.40 staff_space);
51 z5 = (0.10 staff_space, +0.40 staff_space);
57 % the original envelope curve created with `draw' contains
58 % cusps which we avoid
59 outline := get_subpath (ellipse, -direction 0 of pat,
60 direction 0 of pat, z3)
61 .. get_subpoint (ellipse, direction 1 of pat, z4)
62 .. get_subpath (ellipse, direction 2 of pat,
63 -direction 1.8 of pat, z5)
64 .. get_subpoint (ellipse, -direction 1 of pat, z4)
71 % make the outline touch the bounding box
72 shift = find_tangent_shift (((w, -d) -- (w, h)), outline,
74 outline := outline shifted shift;
78 labels (1, 2, 3, 4, 5);
90 fet_beginchar ("Ed. Vat. Flat" , "vaticana-1");
91 z1 = (0.00 staff_space, +0.80 staff_space);
92 z2 = (0.00 staff_space, -0.08 staff_space);
93 z3 = (0.25 staff_space, -0.23 staff_space);
94 z4 = (0.50 staff_space, -0.24 staff_space);
95 z5 = (0.50 staff_space, +0.03 staff_space);
96 z6 = (0.25 staff_space, +0.20 staff_space);
97 z7 = (0.15 staff_space, +0.26 staff_space);
102 pickup pencircle xscaled 0.50 linethickness
103 yscaled 0.22 staff_space;
105 ellipse := fullcircle xscaled 0.50 linethickness
106 yscaled 0.22 staff_space;
116 % the original envelope curve created with `draw' contains
117 % cusps which we avoid
118 fill get_subpath (ellipse, up, down, z1)
119 -- get_subpath (ellipse, down, direction 1.1 of pat, z2)
121 ... get_subpath (ellipse, direction 2.9 of pat, up, z4)
122 -- get_subpath (ellipse, up, direction 4.1 of pat, z5)
124 .. get_subpath (ellipse,
125 direction 6 of pat, -direction 6 of pat, z7)
133 set_char_box (0.00 staff_space# + 0.25 linethickness#,
134 0.50 staff_space# + 0.25 linethickness#,
135 0.23 staff_space# + 0.11 staff_space#,
136 0.80 staff_space# + 0.11 staff_space#);
138 labels (1, 2, 3, 4, 5, 6, 7);
142 fet_beginchar ("Ed. Vat. Natural" , "vaticana0");
146 pickup pencircle xscaled 0.80 linethickness
147 yscaled 0.22 staff_space;
149 ellipse := fullcircle xscaled 0.8 linethickness
150 yscaled 0.22 staff_space;
152 z1 = (0.00 staff_space, +0.65 staff_space);
153 z2 = (0.00 staff_space, -0.35 staff_space);
155 fill get_subpath (ellipse, up, down, z1)
156 -- get_subpath (ellipse, down, up, z2)
159 pickup penrazor scaled 0.22 staff_space
162 z3 = (0.00 staff_space, -0.30 staff_space);
163 z4 = (0.40 staff_space, -0.08 staff_space);
168 addto currentpicture also currentpicture
171 shifted (0.40 staff_space, 0.0 staff_space);
173 set_char_box (0.00 staff_space# + 0.40 linethickness#,
174 0.40 staff_space# + 0.40 linethickness#,
175 0.65 staff_space# + 0.11 staff_space#,
176 0.65 staff_space# + 0.11 staff_space#);
190 fet_beginchar ("Mensural Sharp" , "mensural1");
193 define_pixels (stemthick);
195 stemthick# = linethickness#;
200 pickup pencircle scaled 0.8 stemthick;
202 circle := fullcircle scaled 0.8 stemthick;
204 z1 = 0.4 staff_space * (0.8, 1);
207 pat := get_subpath (circle, z1 - z2, z2 - z1, z1)
208 -- get_subpath (circle, z2 - z1, z1 - z2, z2)
213 fill pat shifted (0.20 staff_space, 0);
214 fill pat xscaled -1 shifted (0.20 staff_space, 0);
216 set_char_box (0.8 * 0.4 staff_space# + 0.4 stemthick#,
217 (0.8 * 0.4 + 0.2) * staff_space# + 0.4 stemthick#,
218 0.4 staff_space# + 0.4 stemthick#,
219 0.4 staff_space# + 0.4 stemthick#);
225 fet_beginchar ("Mensural Flat" , "mensural-1");
228 define_pixels (stemthick);
230 stemthick# = linethickness#;
232 save ellipse, pat, outline;
233 path ellipse, pat, outline;
235 pickup pencircle xscaled 1.4 stemthick
236 yscaled 0.6 stemthick
239 ellipse := fullcircle xscaled 1.4 stemthick
240 yscaled 0.6 stemthick
243 z1 = (0.00 staff_space, +1.80 staff_space);
244 z2 = (0.00 staff_space, -0.25 staff_space);
245 z3 = (0.35 staff_space, -0.25 staff_space);
246 z4 = (0.35 staff_space, +0.25 staff_space);
247 z5 = (0.00 staff_space, +0.25 staff_space);
259 % we approximate `draw pat'
260 for i = 2 step s until (length pat + 2):
261 dirs[i] := direction (i - 2) of pat;
264 outline := get_subpath (ellipse, up, down, z1)
265 -- get_subpath (ellipse, down, dirs2, z2)
266 for i = (2 + s) step s until (length pat + 2 - s):
267 .. get_subpoint (ellipse, dirs[i],
268 point (i - 2) of pat)
272 for i = (length pat + 2 - s) step -s until 2:
273 .. get_subpoint (ellipse, -dirs[i],
274 point (i - 2) of pat)
276 -- get_subpoint (ellipse, up, z2)
281 set_char_box (0.00 staff_space# + 0.75 stemthick#,
282 0.40 staff_space# + 0.75 stemthick#,
283 0.25 staff_space# + 0.75 stemthick#,
284 1.80 staff_space# + 0.75 stemthick#);
286 labels (1, 2, 3, 4, 5);
290 fet_beginchar ("Hufnagel Flat" , "hufnagel-1");
293 define_pixels (stemthick);
295 stemthick# = linethickness#;
300 pickup pencircle xscaled 2.4 stemthick
301 yscaled 0.4 stemthick
304 ellipse := fullcircle xscaled 2.4 stemthick
305 yscaled 0.4 stemthick
308 z1 = (0.00 staff_space, +1.80 staff_space);
309 z2 = (0.00 staff_space, -0.15 staff_space);
310 z3 = (0.25 staff_space, -0.30 staff_space);
311 z4 = (0.50 staff_space, +0.00 staff_space);
312 z5 = (0.30 staff_space, +0.30 staff_space);
313 z6 = (0.00 staff_space, +0.15 staff_space);
322 % we have to find the envelope intersections (if any)
323 t1 = find_envelope_cusp (reverse ellipse, pat, 1/256) + 3;
327 t2 = find_envelope_cusp (ellipse, reverse pat, 1/256);
331 t2 := length pat - t2 + 3;
339 % we approximate `draw pat'
340 for i = 3 step s until 5:
341 dirs[i] := direction (i - 3) of pat;
344 fill get_subpath (ellipse, up, down, z1)
345 -- get_subpath (ellipse, down, z3 - z2, z2)
346 -- get_subpoint (ellipse, z3 - z2, z3)
347 for i = 3 step s until 5:
348 .. get_subpoint (ellipse, dirs[i],
349 point (i - 3) of pat)
351 .. get_subpoint (ellipse, z6 - z5, z5)
352 -- get_subpoint (ellipse, z6 - z5, z6)
353 -- get_subpoint (ellipse, z5 - z6, z6)
354 -- get_subpoint (ellipse, z5 - z6, z5)
355 -- get_subpoint (ellipse, -dirs[5], z5)
356 for i = (5 - s) step -s until t2:
357 .. get_subpoint (ellipse, -dirs[i],
358 point (i - 3) of pat)
360 .. get_subpoint (ellipse, -direction (t2 - 3) of pat,
361 point (t2 - 3) of pat)
362 -- get_subpoint (ellipse, -direction (t1 - 3) of pat,
363 point (t1 - 3) of pat)
364 for i = (floor ((t1 - 3) / s) * s + 3) step -s until (3 + s):
365 .. get_subpoint (ellipse, -dirs[i],
366 point (i - 3) of pat)
368 .. get_subpoint (ellipse, -dirs[3], z3)
369 -- get_subpoint (ellipse, z2 - z3, z3)
370 -- get_subpoint (ellipse, z2 - z3, z2)
371 -- get_subpoint (ellipse, up, z2)
379 set_char_box (0.00 staff_space# + 1.0 stemthick#,
380 0.50 staff_space# + 1.0 stemthick#,
381 0.30 staff_space# + 0.5 stemthick#,
382 1.80 staff_space# + 0.5 stemthick#);
384 labels (1, 2, 3, 4, 5, 6);
388 fet_endgroup ("accidentals");