Fixes Issue 1504, allowing feather beam line breaking.
[lilypond/patrick.git] / mf / parmesan-accidentals.mf
blob4c8fae7574cbbd8c029791ac06dc5fa8a92b4939
1 % Feta (not the Font-En-Tja) music font --  ancient accidentals
2 % This file is part of LilyPond, the GNU music typesetter.
4 % Copyright (C) 2001--2011 Juergen Reuter <reuter@ipd.uka.de>
5
7 % LilyPond is free software: you can redistribute it and/or modify
8 % it under the terms of the GNU General Public License as published by
9 % the Free Software Foundation, either version 3 of the License, or
10 % (at your option) any later version.
12 % LilyPond is distributed in the hope that it will be useful,
13 % but WITHOUT ANY WARRANTY; without even the implied warranty of
14 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 % GNU General Public License for more details.
17 % You should have received a copy of the GNU General Public License
18 % along with LilyPond.  If not, see <http://www.gnu.org/licenses/>.
20 fet_begingroup ("accidentals");
23 %%%%%%%%
27 % EDITIO MEDICAEA
31 fet_beginchar ("Ed. Med. Flat" , "medicaeaM1");
32         set_char_box (0.1 staff_space#, 0.6 staff_space#,
33                       0.6 staff_space#, 1.0 staff_space#);
35         save ellipse, pat, outline, T;
36         path ellipse, pat, outline;
37         transform T;
39         T := identity xscaled 0.50 linethickness
40                       yscaled 0.22 staff_space;
41         pickup pencircle transformed T;
42         ellipse := fullcircle transformed T;
44         x1 = x2 = 0;
45         top y1 = h;
46         bot y2 = -d;
48         fill get_subpath (ellipse, up, down, z1)
49              -- get_subpath (ellipse, down, up, z2)
50              -- cycle;
52         T := identity xscaled 0.50 linethickness
53                       yscaled 0.22 staff_space
54                       rotated -63;
55         pickup pencircle transformed T;
56         ellipse := fullcircle transformed T;
58         z3 = (0.10 staff_space, -0.50 staff_space);
59         z4 = (0.40 staff_space, +0.40 staff_space);
60         z5 = (0.10 staff_space, +0.40 staff_space);
62         pat := z3{(1, 2)}
63                .. z4
64                .. z5{(-1, -1)};
66         % the original envelope curve created with `draw' contains
67         % cusps which we avoid
68         outline := get_subpath (ellipse, -direction 0 of pat,
69                                 direction 0 of pat, z3)
70                    .. get_subpoint (ellipse, direction 1 of pat, z4)
71                    .. get_subpath (ellipse, direction 2 of pat,
72                                    -direction 1.8 of pat, z5)
73                    .. get_subpoint (ellipse, -direction 1 of pat, z4)
74                         {-direction 1 of pat}
75                    .. cycle;
77         save shift;
78         pair shift;
80         % make the outline touch the bounding box
81         shift = find_tangent_shift (((w, -d) -- (w, h)), outline,
82                                     (b, 0), (-b, 0));
83         outline := outline shifted shift;
85         fill outline;
87         labels (1, 2, 3, 4, 5);
88 fet_endchar;
91 %%%%%%%%
95 % EDITIO VATICANA
99 fet_beginchar ("Ed. Vat. Flat" , "vaticanaM1");
100         z1 = (0.00 staff_space, +0.80 staff_space);
101         z2 = (0.00 staff_space, -0.08 staff_space);
102         z3 = (0.25 staff_space, -0.23 staff_space);
103         z4 = (0.50 staff_space, -0.24 staff_space);
104         z5 = (0.50 staff_space, +0.03 staff_space);
105         z6 = (0.25 staff_space, +0.20 staff_space);
106         z7 = (0.15 staff_space, +0.26 staff_space);
108         save pat, ellipse, T;
109         path pat, ellipse;
110         transform T;
112         T := identity xscaled 0.50 linethickness
113                       yscaled 0.22 staff_space;
114         pickup pencircle transformed T;
115         ellipse := fullcircle transformed T;
117         pat := z1
118                -- z2{down}
119                ... z3
120                ... {up}z4
121                -- z5{up}
122                .. z6
123                .. z7;
125         % the original envelope curve created with `draw' contains
126         % cusps which we avoid
127         fill get_subpath (ellipse, up, down, z1)
128              -- get_subpath (ellipse, down, direction 1.1 of pat, z2)
129              ... bot z3
130              ... get_subpath (ellipse, direction 2.9 of pat, up, z4)
131              -- get_subpath (ellipse, up, direction 4.1 of pat, z5)
132              .. top z6
133              .. get_subpath (ellipse,
134                              direction 6 of pat, -direction 6 of pat, z7)
135              .. bot z6
136              .. {down}bot lft z5
137              -- top lft z4{down}
138              ... top z3
139              ... top rt z2{up}
140              -- cycle;
142         set_char_box (0.00 staff_space# + 0.25 linethickness#,
143                       0.50 staff_space# + 0.25 linethickness#,
144                       0.23 staff_space# + 0.11 staff_space#,
145                       0.80 staff_space# + 0.11 staff_space#);
147         labels (1, 2, 3, 4, 5, 6, 7);
148 fet_endchar;
151 fet_beginchar ("Ed. Vat. Natural" , "vaticana0");
152         save ellipse, T;
153         path ellipse;
154         transform T;
156         T := identity xscaled 0.80 linethickness
157                       yscaled 0.22 staff_space;
158         pickup pencircle transformed T;
159         ellipse := fullcircle transformed T;
161         z1 = (0.00 staff_space, +0.65 staff_space);
162         z2 = (0.00 staff_space, -0.35 staff_space);
164         fill get_subpath (ellipse, up, down, z1)
165              -- get_subpath (ellipse, down, up, z2)
166              -- cycle;
168         pickup penrazor scaled 0.22 staff_space
169                         rotated 90;
171         z3 = (0.00 staff_space, -0.30 staff_space);
172         z4 = (0.40 staff_space, -0.08 staff_space);
174         draw z3
175              -- z4;
177         addto currentpicture also currentpicture
178           xscaled -1
179           yscaled -1
180           shifted (0.40 staff_space, 0.0 staff_space);
182         set_char_box (0.00 staff_space# + 0.40 linethickness#,
183                       0.40 staff_space# + 0.40 linethickness#,
184                       0.65 staff_space# + 0.11 staff_space#,
185                       0.65 staff_space# + 0.11 staff_space#);
187         labels (1, 2, 3, 4);
188 fet_endchar;
191 %%%%%%%%
195 % MENSURAL NOTATION
199 fet_beginchar ("Mensural Sharp" , "mensural1");
200         save stemthick;
202         define_pixels (stemthick);
204         stemthick# = linethickness#;
206         save circle, pat, T;
207         path circle, pat;
208         transform T;
210         T := identity scaled 0.8 stemthick;
211         pickup pencircle transformed T;
212         circle := fullcircle transformed T;
214         z1 = 0.4 staff_space * (0.8, 1);
215         z1 = -z2;
217         pat := get_subpath (circle, z1 - z2, z2 - z1, z1)
218                -- get_subpath (circle, z2 - z1, z1 - z2, z2)
219                -- cycle;
221         fill pat;
222         fill pat xscaled -1;
223         fill pat shifted (0.20 staff_space, 0);
224         fill pat xscaled -1 shifted (0.20 staff_space, 0);
226         set_char_box (0.8 * 0.4 staff_space# + 0.4 stemthick#,
227                       (0.8 * 0.4 + 0.2) * staff_space# + 0.4 stemthick#,
228                       0.4 staff_space# + 0.4 stemthick#, 
229                       0.4 staff_space# + 0.4 stemthick#);
231         labels (1, 2);
232 fet_endchar;
235 fet_beginchar ("Mensural Flat" , "mensuralM1");
236         save stemthick;
238         define_pixels (stemthick);
240         stemthick# = linethickness#;
242         save ellipse, pat, outline, T;
243         path ellipse, pat, outline;
244         transform T;
246         T := identity xscaled 1.4 stemthick
247                       yscaled 0.6 stemthick
248                       rotated 45;
249         pickup pencircle transformed T;
250         ellipse := fullcircle transformed T;
252         z1 = (0.00 staff_space, +1.80 staff_space);
253         z2 = (0.00 staff_space, -0.25 staff_space);
254         z3 = (0.35 staff_space, -0.25 staff_space);
255         z4 = (0.35 staff_space, +0.25 staff_space);
256         z5 = (0.00 staff_space, +0.25 staff_space);
258         pat := z2
259                .. z3
260                .. z4
261                .. z5;
263         save dirs, s;
264         pair dirs[];
266         s := 1/4;
268         % we approximate `draw pat'
269         for i = 2 step s until (length pat + 2):
270                 dirs[i] := direction (i - 2) of pat;
271         endfor;
273         outline := get_subpath (ellipse, up, down, z1)
274                    -- get_subpath (ellipse, down, dirs2, z2)
275                    for i = (2 + s) step s until (length pat + 2 - s):
276                            .. get_subpoint (ellipse, dirs[i],
277                                               point (i - 2) of pat)
278                    endfor
279                    .. top z5
280                    -- bot z5
281                    for i = (length pat + 2 - s) step -s until 2:
282                            .. get_subpoint (ellipse, -dirs[i],
283                                             point (i - 2) of pat)
284                    endfor
285                    -- get_subpoint (ellipse, up, z2)
286                    -- cycle;
288         fill outline;
290         set_char_box (0.00 staff_space# + 0.75 stemthick#,
291                       0.40 staff_space# + 0.75 stemthick#,
292                       0.25 staff_space# + 0.75 stemthick#,
293                       1.80 staff_space# + 0.75 stemthick#);
295         labels (1, 2, 3, 4, 5);
296 fet_endchar;
299 fet_beginchar ("Hufnagel Flat" , "hufnagelM1");
300         save stemthick;
302         define_pixels (stemthick);
304         stemthick# = linethickness#;
306         save ellipse, pat, T;
307         path ellipse, pat;
308         transform T;
310         T := identity xscaled 2.4 stemthick
311                       yscaled 0.4 stemthick
312                       rotated 45;
313         pickup pencircle transformed T;
314         ellipse := fullcircle transformed T;
316         z1 = (0.00 staff_space, +1.80 staff_space);
317         z2 = (0.00 staff_space, -0.15 staff_space);
318         z3 = (0.25 staff_space, -0.30 staff_space);
319         z4 = (0.50 staff_space, +0.00 staff_space);
320         z5 = (0.30 staff_space, +0.30 staff_space);
321         z6 = (0.00 staff_space, +0.15 staff_space);
323         pat := z3
324                .. z4
325                .. z5;
327         save t;
328         numeric t[];
330         % we have to find the envelope intersections (if any)
331         t1 = find_envelope_cusp (reverse ellipse, pat, 1/256) + 3;
332         if t1 < 3:
333                 t1 := 3;
334         fi;
335         t2 = find_envelope_cusp (ellipse, reverse pat, 1/256);
336         if t2 < 0:
337                 t2 := 3;
338         else:
339                 t2 := length pat - t2 + 3;
340         fi;
342         save dirs, s;
343         pair dirs[];
345         s := 1/8;
347         % we approximate `draw pat'
348         for i = 3 step s until 5:
349                 dirs[i] := direction (i - 3) of pat;
350         endfor;
352         fill get_subpath (ellipse, up, down, z1)
353              -- get_subpath (ellipse, down, z3 - z2, z2)
354              -- get_subpoint (ellipse, z3 - z2, z3)
355              for i = 3 step s until 5:
356                      .. get_subpoint (ellipse, dirs[i],
357                                       point (i - 3) of pat)
358              endfor
359              .. get_subpoint (ellipse, z6 - z5, z5)
360              -- get_subpoint (ellipse, z6 - z5, z6)
361              -- get_subpoint (ellipse, z5 - z6, z6)
362              -- get_subpoint (ellipse, z5 - z6, z5)
363              -- get_subpoint (ellipse, -dirs[5], z5)
364              for i = (5 - s) step -s until t2:
365                      .. get_subpoint (ellipse, -dirs[i],
366                                       point (i - 3) of pat)
367              endfor
368              .. get_subpoint (ellipse, -direction (t2 - 3) of pat,
369                               point (t2 - 3) of pat)
370              -- get_subpoint (ellipse, -direction (t1 - 3) of pat,
371                               point (t1 - 3) of pat)
372              for i = (floor ((t1 - 3) / s) * s + 3) step -s until (3 + s):
373                      .. get_subpoint (ellipse, -dirs[i],
374                                       point (i - 3) of pat)
375              endfor
376              .. get_subpoint (ellipse, -dirs[3], z3)
377              -- get_subpoint (ellipse, z2 - z3, z3)
378              -- get_subpoint (ellipse, z2 - z3, z2)
379              -- get_subpoint (ellipse, up, z2)
380              -- cycle;
382 %       draw z1
383 %            -- z2
384 %            -- pat
385 %            -- z6;
387         set_char_box (0.00 staff_space# + 1.0 stemthick#,
388                       0.50 staff_space# + 1.0 stemthick#,
389                       0.30 staff_space# + 0.5 stemthick#, 
390                       1.80 staff_space# + 0.5 stemthick#);
392         labels (1, 2, 3, 4, 5, 6);
393 fet_endchar;
396 fet_endgroup ("accidentals");