]> git.donarmstrong.com Git - lilypond.git/blob - mf/parmesan-accidentals.mf
Add '-dcrop' option to ps and svg backends
[lilypond.git] / mf / parmesan-accidentals.mf
1 % Feta (not the Font-En-Tja) music font --  ancient accidentals
2 % This file is part of LilyPond, the GNU music typesetter.
3 %
4 % Copyright (C) 2001--2015 Juergen Reuter <reuter@ipd.uka.de>
5
6 % The LilyPond font is free software: you can redistribute it and/or modify
7 % it under the terms of the GNU General Public License as published by
8 % the Free Software Foundation, either version 3 of the License, or
9 % (at your option) any later version, or under the SIL Open Font License.
10 %
11 % LilyPond is distributed in the hope that it will be useful,
12 % but WITHOUT ANY WARRANTY; without even the implied warranty of
13 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 % GNU General Public License for more details.
15 %
16 % You should have received a copy of the GNU General Public License
17 % along with LilyPond.  If not, see <http://www.gnu.org/licenses/>.
18
19 fet_begingroup ("accidentals");
20
21
22 %%%%%%%%
23 %
24 %
25 %
26 % EDITIO MEDICAEA
27 %
28 %
29 %
30 fet_beginchar ("Ed. Med. Flat" , "medicaeaM1");
31         set_char_box (0.1 staff_space#, 0.6 staff_space#,
32                       0.6 staff_space#, 1.0 staff_space#);
33
34         save ellipse, pat, outline, T;
35         path ellipse, pat, outline;
36         transform T;
37
38         T := identity xscaled 0.50 linethickness
39                       yscaled 0.22 staff_space;
40         pickup pencircle transformed T;
41         ellipse := fullcircle transformed T;
42
43         x1 = x2 = 0;
44         top y1 = h;
45         bot y2 = -d;
46
47         fill get_subpath (ellipse, up, down, z1)
48              -- get_subpath (ellipse, down, up, z2)
49              -- cycle;
50
51         T := identity xscaled 0.50 linethickness
52                       yscaled 0.22 staff_space
53                       rotated -63;
54         pickup pencircle transformed T;
55         ellipse := fullcircle transformed T;
56
57         z3 = (0.10 staff_space, -0.50 staff_space);
58         z4 = (0.40 staff_space, +0.40 staff_space);
59         z5 = (0.10 staff_space, +0.40 staff_space);
60
61         pat := z3{(1, 2)}
62                .. z4
63                .. z5{(-1, -1)};
64
65         % the original envelope curve created with `draw' contains
66         % cusps which we avoid
67         outline := get_subpath (ellipse, -direction 0 of pat,
68                                 direction 0 of pat, z3)
69                    .. get_subpoint (ellipse, direction 1 of pat, z4)
70                    .. get_subpath (ellipse, direction 2 of pat,
71                                    -direction 1.8 of pat, z5)
72                    .. get_subpoint (ellipse, -direction 1 of pat, z4)
73                         {-direction 1 of pat}
74                    .. cycle;
75
76         save shift;
77         pair shift;
78
79         % make the outline touch the bounding box
80         shift = find_tangent_shift (((w, -d) -- (w, h)), outline,
81                                     (b, 0), (-b, 0));
82         outline := outline shifted shift;
83
84         fill outline;
85
86         labels (1, 2, 3, 4, 5);
87 fet_endchar;
88
89
90 %%%%%%%%
91 %
92 %
93 %
94 % EDITIO VATICANA
95 %
96 %
97 %
98 fet_beginchar ("Ed. Vat. Flat" , "vaticanaM1");
99         z1 = (0.00 staff_space, +0.80 staff_space);
100         z2 = (0.00 staff_space, -0.08 staff_space);
101         z3 = (0.25 staff_space, -0.23 staff_space);
102         z4 = (0.50 staff_space, -0.24 staff_space);
103         z5 = (0.50 staff_space, +0.03 staff_space);
104         z6 = (0.25 staff_space, +0.20 staff_space);
105         z7 = (0.15 staff_space, +0.26 staff_space);
106
107         save pat, ellipse, T;
108         path pat, ellipse;
109         transform T;
110
111         T := identity xscaled 0.50 linethickness
112                       yscaled 0.22 staff_space;
113         pickup pencircle transformed T;
114         ellipse := fullcircle transformed T;
115
116         pat := z1
117                -- z2{down}
118                ... z3
119                ... {up}z4
120                -- z5{up}
121                .. z6
122                .. z7;
123
124         % the original envelope curve created with `draw' contains
125         % cusps which we avoid
126         fill get_subpath (ellipse, up, down, z1)
127              -- get_subpath (ellipse, down, direction 1.1 of pat, z2)
128              ... bot z3
129              ... get_subpath (ellipse, direction 2.9 of pat, up, z4)
130              -- get_subpath (ellipse, up, direction 4.1 of pat, z5)
131              .. top z6
132              .. get_subpath (ellipse,
133                              direction 6 of pat, -direction 6 of pat, z7)
134              .. bot z6
135              .. {down}bot lft z5
136              -- top lft z4{down}
137              ... top z3
138              ... top rt z2{up}
139              -- cycle;
140
141         set_char_box (0.00 staff_space# + 0.25 linethickness#,
142                       0.50 staff_space# + 0.25 linethickness#,
143                       0.23 staff_space# + 0.11 staff_space#,
144                       0.80 staff_space# + 0.11 staff_space#);
145
146         labels (1, 2, 3, 4, 5, 6, 7);
147 fet_endchar;
148
149
150 fet_beginchar ("Ed. Vat. Natural" , "vaticana0");
151         save ellipse, T;
152         path ellipse;
153         transform T;
154
155         T := identity xscaled 0.80 linethickness
156                       yscaled 0.22 staff_space;
157         pickup pencircle transformed T;
158         ellipse := fullcircle transformed T;
159
160         z1 = (0.00 staff_space, +0.65 staff_space);
161         z2 = (0.00 staff_space, -0.35 staff_space);
162
163         fill get_subpath (ellipse, up, down, z1)
164              -- get_subpath (ellipse, down, up, z2)
165              -- cycle;
166
167         pickup penrazor scaled 0.22 staff_space
168                         rotated 90;
169
170         z3 = (0.00 staff_space, -0.30 staff_space);
171         z4 = (0.40 staff_space, -0.08 staff_space);
172
173         draw z3
174              -- z4;
175
176         addto currentpicture also currentpicture
177           xscaled -1
178           yscaled -1
179           shifted (0.40 staff_space, 0.0 staff_space);
180
181         set_char_box (0.00 staff_space# + 0.40 linethickness#,
182                       0.40 staff_space# + 0.40 linethickness#,
183                       0.65 staff_space# + 0.11 staff_space#,
184                       0.65 staff_space# + 0.11 staff_space#);
185
186         labels (1, 2, 3, 4);
187 fet_endchar;
188
189
190 %%%%%%%%
191 %
192 %
193 %
194 % MENSURAL NOTATION
195 %
196 %
197 %
198 fet_beginchar ("Mensural Sharp" , "mensural1");
199         save stemthick;
200
201         define_pixels (stemthick);
202
203         stemthick# = linethickness#;
204
205         save circle, pat, T;
206         path circle, pat;
207         transform T;
208
209         T := identity scaled 0.8 stemthick;
210         pickup pencircle transformed T;
211         circle := fullcircle transformed T;
212
213         z1 = 0.4 staff_space * (0.8, 1);
214         z1 = -z2;
215
216         pat := get_subpath (circle, z1 - z2, z2 - z1, z1)
217                -- get_subpath (circle, z2 - z1, z1 - z2, z2)
218                -- cycle;
219
220         fill pat;
221         fill pat xscaled -1;
222         fill pat shifted (0.20 staff_space, 0);
223         fill pat xscaled -1 shifted (0.20 staff_space, 0);
224
225         set_char_box (0.8 * 0.4 staff_space# + 0.4 stemthick#,
226                       (0.8 * 0.4 + 0.2) * staff_space# + 0.4 stemthick#,
227                       0.4 staff_space# + 0.4 stemthick#, 
228                       0.4 staff_space# + 0.4 stemthick#);
229
230         labels (1, 2);
231 fet_endchar;
232
233
234 fet_beginchar ("Mensural Flat" , "mensuralM1");
235         save stemthick;
236
237         define_pixels (stemthick);
238
239         stemthick# = linethickness#;
240
241         save ellipse, pat, outline, T;
242         path ellipse, pat, outline;
243         transform T;
244
245         T := identity xscaled 1.4 stemthick
246                       yscaled 0.6 stemthick
247                       rotated 45;
248         pickup pencircle transformed T;
249         ellipse := fullcircle transformed T;
250
251         z1 = (0.00 staff_space, +1.80 staff_space);
252         z2 = (0.00 staff_space, -0.25 staff_space);
253         z3 = (0.35 staff_space, -0.25 staff_space);
254         z4 = (0.35 staff_space, +0.25 staff_space);
255         z5 = (0.00 staff_space, +0.25 staff_space);
256
257         pat := z2
258                .. z3
259                .. z4
260                .. z5;
261
262         save dirs, s;
263         pair dirs[];
264
265         s := 1/4;
266
267         % we approximate `draw pat'
268         for i = 2 step s until (length pat + 2):
269                 dirs[i] := direction (i - 2) of pat;
270         endfor;
271
272         outline := get_subpath (ellipse, up, down, z1)
273                    -- get_subpath (ellipse, down, dirs2, z2)
274                    for i = (2 + s) step s until (length pat + 2 - s):
275                            .. get_subpoint (ellipse, dirs[i],
276                                               point (i - 2) of pat)
277                    endfor
278                    .. top z5
279                    -- bot z5
280                    for i = (length pat + 2 - s) step -s until 2:
281                            .. get_subpoint (ellipse, -dirs[i],
282                                             point (i - 2) of pat)
283                    endfor
284                    -- get_subpoint (ellipse, up, z2)
285                    -- cycle;
286
287         fill outline;
288
289         set_char_box (0.00 staff_space# + 0.75 stemthick#,
290                       0.40 staff_space# + 0.75 stemthick#,
291                       0.25 staff_space# + 0.75 stemthick#,
292                       1.80 staff_space# + 0.75 stemthick#);
293
294         labels (1, 2, 3, 4, 5);
295 fet_endchar;
296
297
298 fet_beginchar ("Hufnagel Flat" , "hufnagelM1");
299         save stemthick;
300
301         define_pixels (stemthick);
302
303         stemthick# = linethickness#;
304
305         save ellipse, pat, T;
306         path ellipse, pat;
307         transform T;
308
309         T := identity xscaled 2.4 stemthick
310                       yscaled 0.4 stemthick
311                       rotated 45;
312         pickup pencircle transformed T;
313         ellipse := fullcircle transformed T;
314
315         z1 = (0.00 staff_space, +1.80 staff_space);
316         z2 = (0.00 staff_space, -0.15 staff_space);
317         z3 = (0.25 staff_space, -0.30 staff_space);
318         z4 = (0.50 staff_space, +0.00 staff_space);
319         z5 = (0.30 staff_space, +0.30 staff_space);
320         z6 = (0.00 staff_space, +0.15 staff_space);
321
322         pat := z3
323                .. z4
324                .. z5;
325
326         save t;
327         numeric t[];
328
329         % we have to find the envelope intersections (if any)
330         t1 = find_envelope_cusp (reverse ellipse, pat, 1/256) + 3;
331         if t1 < 3:
332                 t1 := 3;
333         fi;
334         t2 = find_envelope_cusp (ellipse, reverse pat, 1/256);
335         if t2 < 0:
336                 t2 := 3;
337         else:
338                 t2 := length pat - t2 + 3;
339         fi;
340
341         save dirs, s;
342         pair dirs[];
343
344         s := 1/8;
345
346         % we approximate `draw pat'
347         for i = 3 step s until 5:
348                 dirs[i] := direction (i - 3) of pat;
349         endfor;
350
351         fill get_subpath (ellipse, up, down, z1)
352              -- get_subpath (ellipse, down, z3 - z2, z2)
353              -- get_subpoint (ellipse, z3 - z2, z3)
354              for i = 3 step s until 5:
355                      .. get_subpoint (ellipse, dirs[i],
356                                       point (i - 3) of pat)
357              endfor
358              .. get_subpoint (ellipse, z6 - z5, z5)
359              -- get_subpoint (ellipse, z6 - z5, z6)
360              -- get_subpoint (ellipse, z5 - z6, z6)
361              -- get_subpoint (ellipse, z5 - z6, z5)
362              -- get_subpoint (ellipse, -dirs[5], z5)
363              for i = (5 - s) step -s until t2:
364                      .. get_subpoint (ellipse, -dirs[i],
365                                       point (i - 3) of pat)
366              endfor
367              .. get_subpoint (ellipse, -direction (t2 - 3) of pat,
368                               point (t2 - 3) of pat)
369              -- get_subpoint (ellipse, -direction (t1 - 3) of pat,
370                               point (t1 - 3) of pat)
371              for i = (floor ((t1 - 3) / s) * s + 3) step -s until (3 + s):
372                      .. get_subpoint (ellipse, -dirs[i],
373                                       point (i - 3) of pat)
374              endfor
375              .. get_subpoint (ellipse, -dirs[3], z3)
376              -- get_subpoint (ellipse, z2 - z3, z3)
377              -- get_subpoint (ellipse, z2 - z3, z2)
378              -- get_subpoint (ellipse, up, z2)
379              -- cycle;
380
381 %       draw z1
382 %            -- z2
383 %            -- pat
384 %            -- z6;
385
386         set_char_box (0.00 staff_space# + 1.0 stemthick#,
387                       0.50 staff_space# + 1.0 stemthick#,
388                       0.30 staff_space# + 0.5 stemthick#, 
389                       1.80 staff_space# + 0.5 stemthick#);
390
391         labels (1, 2, 3, 4, 5, 6);
392 fet_endchar;
393
394
395 %%%%%%%%%%%%%%%
396 %%%
397 %%% Glyphs for Kievan Music Notation
398 %%%
399 %%%%%%%%%%%%%%%
400
401
402 fet_beginchar ("Kievan sharp", "kievan1");
403         % This draws the sharp.
404         % It never occurs in Synodal music and
405         % can only be found in some early manuscripts.
406
407         z1 = (0.579 staff_space, 1.459 staff_space);
408         z2 = (1.414 staff_space, -0.904 staff_space);
409         z3 = (0.187 staff_space, 0.904 staff_space);
410
411         x2 - x1 = x4 - x3;
412         y1 - y2 = y3 - y4;
413
414         z5 = (1.296 staff_space, 1.613 staff_space);
415         z6 = (0.090 staff_space, -0.864 staff_space);
416         z7 = (1.532 staff_space, 0.892 staff_space);
417
418         x5 - x6 = x7 - x8;
419         y5 - y6 = y7 - y8;
420
421         pickup pensquare xscaled 0.167staff_space
422                          yscaled 0.167staff_space
423                          rotated -69.2;
424         draw z1{dir -69.2}
425              .. {dir -74.1}z2;
426         draw z3{dir -69.2}
427              .. {dir -74.1}z4;
428
429         pickup pensquare xscaled 0.167staff_space
430                          yscaled 0.167staff_space
431                          rotated -114.6;
432         draw z5{dir -114.6}
433              ... {dir -125.0}z6;
434         draw z7{dir -114.6}
435              ... {dir -125.0}z8;
436
437         set_char_box (0, 1.6 staff_space#,
438                       1.6 staff_space#, 1.6 staff_space#);
439 fet_endchar;
440
441
442 fet_beginchar ("Kievan flat", "kievanM1");
443         % This draws the flat sign.
444         % In Synodal music, the flat only occurs on the high B
445         % but it may be used elsewhere in early manuscripts.
446
447         z1 = (0.452 staff_space, 1.772 staff_space);
448         z2 = (0.481 staff_space, 1.735 staff_space);
449         z3 = (0.464 staff_space, 1.626 staff_space);
450         z4 = (0.249 staff_space, 0.322 staff_space);
451         z5 = (0.432 staff_space, -0.762 staff_space);
452         z6 = (0.611 staff_space, -0.583 staff_space);
453         z7 = (0.611 staff_space, 0.224 staff_space);
454         z8 = (0.652 staff_space, 0.513 staff_space);
455         z9 = (0.900 staff_space, 0.684 staff_space);
456         z10 = (0.872 staff_space, 0.640 staff_space);
457         z11 = (0.811 staff_space, 0.359 staff_space);
458         z12 = (0.811 staff_space, -0.587 staff_space);
459         z13 = (0.338 staff_space, -1.063 staff_space);
460         z14 = (0.016 staff_space, 0.196 staff_space);
461         z15 = (0.204 staff_space, 1.316 staff_space);
462
463         fill z13
464              .. z14{up}
465              .. z15{dir 70.8}
466              .. z1{dir 4.9}
467              .. z2
468              .. z3
469              .. z4{down}
470              .. z5
471              -- z6
472              -- z7{up}
473              .. z8
474              .. {dir 23}z9
475              & z9
476              .. z10{dir -135}
477              .. {down}z11
478              -- z12
479              -- z13
480              & cycle;
481
482         set_char_box (0, 1.0 staff_space#,
483                       1.0 staff_space#, 1.8 staff_space#);
484 fet_endchar;
485
486 fet_endgroup ("accidentals");