]> git.donarmstrong.com Git - lilypond.git/blob - mf/parmesan-accidentals.mf
Merge remote-tracking branch 'origin/translation' into master
[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--2012 Juergen Reuter <reuter@ipd.uka.de>
5
6 %
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.
11 %
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.
16 %
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/>.
19
20 fet_begingroup ("accidentals");
21
22
23 %%%%%%%%
24 %
25 %
26 %
27 % EDITIO MEDICAEA
28 %
29 %
30 %
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#);
34
35         save ellipse, pat, outline, T;
36         path ellipse, pat, outline;
37         transform T;
38
39         T := identity xscaled 0.50 linethickness
40                       yscaled 0.22 staff_space;
41         pickup pencircle transformed T;
42         ellipse := fullcircle transformed T;
43
44         x1 = x2 = 0;
45         top y1 = h;
46         bot y2 = -d;
47
48         fill get_subpath (ellipse, up, down, z1)
49              -- get_subpath (ellipse, down, up, z2)
50              -- cycle;
51
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;
57
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);
61
62         pat := z3{(1, 2)}
63                .. z4
64                .. z5{(-1, -1)};
65
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;
76
77         save shift;
78         pair shift;
79
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;
84
85         fill outline;
86
87         labels (1, 2, 3, 4, 5);
88 fet_endchar;
89
90
91 %%%%%%%%
92 %
93 %
94 %
95 % EDITIO VATICANA
96 %
97 %
98 %
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);
107
108         save pat, ellipse, T;
109         path pat, ellipse;
110         transform T;
111
112         T := identity xscaled 0.50 linethickness
113                       yscaled 0.22 staff_space;
114         pickup pencircle transformed T;
115         ellipse := fullcircle transformed T;
116
117         pat := z1
118                -- z2{down}
119                ... z3
120                ... {up}z4
121                -- z5{up}
122                .. z6
123                .. z7;
124
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;
141
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#);
146
147         labels (1, 2, 3, 4, 5, 6, 7);
148 fet_endchar;
149
150
151 fet_beginchar ("Ed. Vat. Natural" , "vaticana0");
152         save ellipse, T;
153         path ellipse;
154         transform T;
155
156         T := identity xscaled 0.80 linethickness
157                       yscaled 0.22 staff_space;
158         pickup pencircle transformed T;
159         ellipse := fullcircle transformed T;
160
161         z1 = (0.00 staff_space, +0.65 staff_space);
162         z2 = (0.00 staff_space, -0.35 staff_space);
163
164         fill get_subpath (ellipse, up, down, z1)
165              -- get_subpath (ellipse, down, up, z2)
166              -- cycle;
167
168         pickup penrazor scaled 0.22 staff_space
169                         rotated 90;
170
171         z3 = (0.00 staff_space, -0.30 staff_space);
172         z4 = (0.40 staff_space, -0.08 staff_space);
173
174         draw z3
175              -- z4;
176
177         addto currentpicture also currentpicture
178           xscaled -1
179           yscaled -1
180           shifted (0.40 staff_space, 0.0 staff_space);
181
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#);
186
187         labels (1, 2, 3, 4);
188 fet_endchar;
189
190
191 %%%%%%%%
192 %
193 %
194 %
195 % MENSURAL NOTATION
196 %
197 %
198 %
199 fet_beginchar ("Mensural Sharp" , "mensural1");
200         save stemthick;
201
202         define_pixels (stemthick);
203
204         stemthick# = linethickness#;
205
206         save circle, pat, T;
207         path circle, pat;
208         transform T;
209
210         T := identity scaled 0.8 stemthick;
211         pickup pencircle transformed T;
212         circle := fullcircle transformed T;
213
214         z1 = 0.4 staff_space * (0.8, 1);
215         z1 = -z2;
216
217         pat := get_subpath (circle, z1 - z2, z2 - z1, z1)
218                -- get_subpath (circle, z2 - z1, z1 - z2, z2)
219                -- cycle;
220
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);
225
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#);
230
231         labels (1, 2);
232 fet_endchar;
233
234
235 fet_beginchar ("Mensural Flat" , "mensuralM1");
236         save stemthick;
237
238         define_pixels (stemthick);
239
240         stemthick# = linethickness#;
241
242         save ellipse, pat, outline, T;
243         path ellipse, pat, outline;
244         transform T;
245
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;
251
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);
257
258         pat := z2
259                .. z3
260                .. z4
261                .. z5;
262
263         save dirs, s;
264         pair dirs[];
265
266         s := 1/4;
267
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;
272
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;
287
288         fill outline;
289
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#);
294
295         labels (1, 2, 3, 4, 5);
296 fet_endchar;
297
298
299 fet_beginchar ("Hufnagel Flat" , "hufnagelM1");
300         save stemthick;
301
302         define_pixels (stemthick);
303
304         stemthick# = linethickness#;
305
306         save ellipse, pat, T;
307         path ellipse, pat;
308         transform T;
309
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;
315
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);
322
323         pat := z3
324                .. z4
325                .. z5;
326
327         save t;
328         numeric t[];
329
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;
341
342         save dirs, s;
343         pair dirs[];
344
345         s := 1/8;
346
347         % we approximate `draw pat'
348         for i = 3 step s until 5:
349                 dirs[i] := direction (i - 3) of pat;
350         endfor;
351
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;
381
382 %       draw z1
383 %            -- z2
384 %            -- pat
385 %            -- z6;
386
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#);
391
392         labels (1, 2, 3, 4, 5, 6);
393 fet_endchar;
394
395
396 %%%%%%%%%%%%%%%
397 %%%
398 %%% Glyphs for Kievan Music Notation
399 %%%
400 %%%%%%%%%%%%%%%
401
402
403 fet_beginchar ("Kievan sharp", "kievan1");
404         % This draws the sharp.
405         % It never occurs in Synodal music and
406         % can only be found in some early manuscripts.
407
408         z1 = (0.579 staff_space, 1.459 staff_space);
409         z2 = (1.414 staff_space, -0.904 staff_space);
410         z3 = (0.187 staff_space, 0.904 staff_space);
411
412         x2 - x1 = x4 - x3;
413         y1 - y2 = y3 - y4;
414
415         z5 = (1.296 staff_space, 1.613 staff_space);
416         z6 = (0.090 staff_space, -0.864 staff_space);
417         z7 = (1.532 staff_space, 0.892 staff_space);
418
419         x5 - x6 = x7 - x8;
420         y5 - y6 = y7 - y8;
421
422         pickup pensquare xscaled 0.167staff_space
423                          yscaled 0.167staff_space
424                          rotated -69.2;
425         draw z1{dir -69.2}
426              .. {dir -74.1}z2;
427         draw z3{dir -69.2}
428              .. {dir -74.1}z4;
429
430         pickup pensquare xscaled 0.167staff_space
431                          yscaled 0.167staff_space
432                          rotated -114.6;
433         draw z5{dir -114.6}
434              ... {dir -125.0}z6;
435         draw z7{dir -114.6}
436              ... {dir -125.0}z8;
437
438         set_char_box (0, 1.6 staff_space#,
439                       1.6 staff_space#, 1.6 staff_space#);
440 fet_endchar;
441
442
443 fet_beginchar ("Kievan flat", "kievanM1");
444         % This draws the flat sign.
445         % In Synodal music, the flat only occurs on the high B
446         % but it may be used elsewhere in early manuscripts.
447
448         z1 = (0.452 staff_space, 1.772 staff_space);
449         z2 = (0.481 staff_space, 1.735 staff_space);
450         z3 = (0.464 staff_space, 1.626 staff_space);
451         z4 = (0.249 staff_space, 0.322 staff_space);
452         z5 = (0.432 staff_space, -0.762 staff_space);
453         z6 = (0.611 staff_space, -0.583 staff_space);
454         z7 = (0.611 staff_space, 0.224 staff_space);
455         z8 = (0.652 staff_space, 0.513 staff_space);
456         z9 = (0.900 staff_space, 0.684 staff_space);
457         z10 = (0.872 staff_space, 0.640 staff_space);
458         z11 = (0.811 staff_space, 0.359 staff_space);
459         z12 = (0.811 staff_space, -0.587 staff_space);
460         z13 = (0.338 staff_space, -1.063 staff_space);
461         z14 = (0.016 staff_space, 0.196 staff_space);
462         z15 = (0.204 staff_space, 1.316 staff_space);
463
464         fill z13
465              .. z14{up}
466              .. z15{dir 70.8}
467              .. z1{dir 4.9}
468              .. z2
469              .. z3
470              .. z4{down}
471              .. z5
472              -- z6
473              -- z7{up}
474              .. z8
475              .. {dir 23}z9
476              & z9
477              .. z10{dir -135}
478              .. {down}z11
479              -- z12
480              -- z13
481              & cycle;
482
483         set_char_box (0, 1.0 staff_space#,
484                       1.0 staff_space#, 1.8 staff_space#);
485 fet_endchar;
486
487 fet_endgroup ("accidentals");