]> git.donarmstrong.com Git - lilypond.git/blob - mf/parmesan-timesignatures.mf
Add '-dcrop' option to ps and svg backends
[lilypond.git] / mf / parmesan-timesignatures.mf
1 % Feta (not the Font-En-Tja) music font --  ancient time signatures
2 % This file is part of LilyPond, the GNU music typesetter.
3 %
4 % Copyright (C) 1998--2015 Mats Bengtsson <matsb@s3.kth.se>,
5 %                Christian Mondrup <scancm@biobase.dk>
6 % Copyright (C) 2002--2015 Juergen Reuter <reuter@ipd.uka.de>
7 %
8 % The LilyPond font is free software: you can redistribute it and/or modify
9 % it under the terms of the GNU General Public License as published by
10 % the Free Software Foundation, either version 3 of the License, or
11 % (at your option) any later version, or under the SIL Open Font License.
12 %
13 % LilyPond is distributed in the hope that it will be useful,
14 % but WITHOUT ANY WARRANTY; without even the implied warranty of
15 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 % GNU General Public License for more details.
17 %
18 % You should have received a copy of the GNU General Public License
19 % along with LilyPond.  If not, see <http://www.gnu.org/licenses/>.
20
21 fet_begingroup ("timesig");
22
23
24 path threequartercircle;
25
26 threequartercircle := halfcircle & quartercircle rotated 180;
27
28 save mensural_Cdiameter, mensural_Cthickness, mensural_Chairpin;
29
30 mensural_Cdiameter# := 3/2 staff_space#;
31 mensural_Cthickness# := 2 linethickness#;
32 mensural_Chairpin# := 0.5 linethickness#;
33
34 define_pixels (mensural_Cdiameter, mensural_Cthickness, mensural_Chairpin);
35
36
37 %%%%%%%%
38 %
39 %
40 %
41 % MENSURAL NOTATION
42 %
43 %
44 %
45
46 def draw_nail (expr bottom_left, top_right) =
47         save round;
48
49         round = floor min (blot_diameter,
50                            xpart (top_right-bottom_left),
51                            ypart (top_right-bottom_left));
52
53         pickup pencircle scaled round;
54
55         z2 + (round / 2, round / 2) = top_right +
56                                         (mensural_Cthickness / 2, 0);
57         z4 - (round / 2,round / 2) = bottom_left;
58         y3 = y2;
59         y4 = y1;
60         x2 = x1 + mensural_Cthickness / 2;
61         x2 - x1 = x4 - x3;
62         x5 = x1;
63         x6 = x4;
64         y5 = y6 = y2 - 2 mensural_Cthickness;
65
66         fill bot z1{right}
67              .. rt z1{up}
68              -- rt z5{up}
69              .. rt z2
70              .. top z2{left}
71              -- top z3{left}
72              .. lft z3
73              .. lft z6{down}
74              -- lft z4{down}
75              .. bot z4{right}
76              -- cycle;
77
78 %       labels (1, 2, 3, 4, 5, 6);
79 enddef;
80
81
82 def mensural_timesig (expr verbose_name, internal_name,
83                            full_circle, reverse_circle, slashed, dotted) =
84         fet_beginchar (verbose_name, internal_name);
85                 if slashed:
86                         set_char_box (
87                           0,
88                           mensural_Cdiameter# + mensural_Cthickness#,
89                           .75 (mensural_Cdiameter# + mensural_Cthickness#),
90                           .75 (mensural_Cdiameter# + mensural_Cthickness#));
91
92                         if (full_circle or dotted):
93                                 draw_nail ((-mensural_Cthickness / 2, -d),
94                                            (mensural_Cthickness / 2, h));
95                         elseif reverse_circle:
96                                 draw_nail ((0, -d), (mensural_Cthickness, h));
97                         else:
98                                 draw_nail ((-mensural_Cthickness, -d), (0, h));
99                         fi;
100                 else:
101                         set_char_box (
102                           0,
103                           mensural_Cdiameter# + mensural_Cthickness#,
104                           .5 (mensural_Cdiameter# + mensural_Cthickness#),
105                           .5 (mensural_Cdiameter# + mensural_Cthickness#));
106                 fi;
107
108                 save ellipse, pat;
109                 path ellipse, pat;
110
111                 ellipse := fullcircle xscaled mensural_Cthickness
112                                       yscaled mensural_Chairpin;
113
114                 save rot;
115
116                 if reverse_circle:
117                         rot := 225;
118                 else:
119                         rot := 45;
120                 fi;
121
122                 if full_circle:
123                         pat := fullcircle scaled mensural_Cdiameter;
124
125                         fill get_subpoint (ellipse,
126                                            direction 0 of pat,
127                                            point 0 of pat)
128                              for i = 1 step 1 until length pat:
129                                      .. get_subpoint (ellipse,
130                                                       direction i of pat,
131                                                       point i of pat)
132                              endfor
133                              .. cycle;
134                         unfill get_subpoint (ellipse,
135                                              -direction 0 of pat,
136                                              point 0 of pat)
137                                for i = 1 step 1 until length pat:
138                                        .. get_subpoint (ellipse,
139                                                         -direction i of pat,
140                                                         point i of pat)
141                                endfor
142                                .. cycle;
143                 else:
144                         pat := threequartercircle rotated rot
145                                                   scaled mensural_Cdiameter;
146
147                         fill get_subpath (ellipse,
148                                           -direction 0 of pat,
149                                           direction 0 of pat,
150                                           point 0 of pat)
151                              for i = 1 step 1 until (length pat - 1):
152                                      .. get_subpoint (ellipse,
153                                                       direction i of pat,
154                                                       point i of pat)
155                              endfor
156                              .. get_subpath (ellipse,
157                                              direction infinity of pat,
158                                              -direction infinity of pat,
159                                              point infinity of pat)
160                              for i = (length pat - 1) step -1 until 1:
161                                      .. get_subpoint (ellipse,
162                                                       -direction i of pat,
163                                                       point i of pat)
164                              endfor
165                              .. cycle;
166                 fi;
167
168                 if dotted:
169                         pickup pencircle scaled 4 linethickness;
170                         drawdot (0, 0);
171                 fi;
172
173                 currentpicture := currentpicture
174                                     shifted 0.5 (mensural_Cdiameter
175                                                  + mensural_Cthickness, 0);
176         fet_endchar;
177 enddef;
178
179
180 %% tempus imperfectum cum prolatione imperfecta
181 mensural_timesig ("Mensural 4/4 meter", "mensural44",
182                   false, false, false, false);
183
184
185 %% tempus imperfectum cum prolatione imperfecta proportio dupla
186 mensural_timesig ("Mensural 2/2 meter", "mensural22",
187                   false, false, true, false);
188
189
190 %% tempus perfectum cum prolatione imperfecta
191 mensural_timesig ("Mensural 3/2 meter", "mensural32",
192                   true, false, false, false);
193
194
195 %% tempus imperfectum cum prolatione perfecta
196 mensural_timesig ("Mensural 6/4 meter", "mensural64",
197                   false, false, false, true);
198
199
200 %% tempus perfectum cum prolatione perfecta
201 mensural_timesig ("Mensural 9/4 meter", "mensural94",
202                   true, false, false, true);
203
204
205 %% tempus perfectum cum prolatione imperfecta proportio dupla
206 mensural_timesig ("Mensural 3/4 meter", "mensural34",
207                   true, false, true, false);
208
209
210 %% tempus imperfectum cum prolatione perfecta proportio dupla
211 mensural_timesig ("Mensural 6/8 meter", "mensural68",
212                   false, false, true, true);
213
214
215 %% tempus perfectum cum prolatione perfecta proportio dupla
216 mensural_timesig ("Mensural 9/8 meter", "mensural98",
217                   true, false, true, true);
218
219
220 %% tempus imperfectum cum prolatione imperfecta diminutio simplex
221 mensural_timesig ("Mensural 4/8 meter", "mensural48",
222                   false, true, false, false);
223
224
225 %% tempus imperfectum cum prolatione perfecta diminutio simplex
226 mensural_timesig ("Mensural 6/8 meter", "mensural68alt",
227                   false, true, false, true);
228
229
230 %% tempus imperfectum cum prolatione imperfecta diminutio duplex
231 mensural_timesig ("Mensural 2/4 meter", "mensural24",
232                   false, true, true, false);
233
234
235 %%%%%%%%
236 %
237 %
238 %
239 % NEO-MENSURAL NOTATION
240 %
241 %
242 %
243
244 save neomensural_Cdiameter, neomensural_Cthickness;
245
246 neomensural_Cdiameter# := 3/2 staff_space#;
247 neomensural_Cthickness# := 2 linethickness#;
248
249 define_pixels (neomensural_Cdiameter, neomensural_Cthickness);
250
251
252 def neomensural_timesig (expr verbose_name, internal_name,
253                               full_circle, reverse_circle, slashed, dotted) =
254         fet_beginchar (verbose_name, internal_name);
255                 set_char_box (
256                   0,
257                   neomensural_Cdiameter# + neomensural_Cthickness#,
258                   .5 (neomensural_Cdiameter# + neomensural_Cthickness#),
259                   .5 (neomensural_Cdiameter# + neomensural_Cthickness#));
260
261                 if slashed:
262                         pickup penrazor scaled neomensural_Cthickness;
263
264                         save t;
265                         t := neomensural_Cthickness / 2;
266
267                         if (full_circle or dotted):
268                                 draw (0, -d + t)
269                                      -- (0, h - t);
270                         elseif reverse_circle:
271                                 draw (t, -d + t)
272                                      -- (t, h - t);
273                         else:
274                                 draw (-t, -d + t)
275                                      -- (-t, h - t);
276                         fi;
277                 fi;
278
279                 save ellipse, pat;
280                 path ellipse, pat;
281
282                 ellipse := fullcircle scaled neomensural_Cthickness;
283
284                 save rot;
285
286                 if reverse_circle:
287                         rot := 225;
288                 else:
289                         rot := 45;
290                 fi;
291
292                 if full_circle:
293                         pat := fullcircle scaled neomensural_Cdiameter;
294
295                         fill get_subpoint (ellipse,
296                                            direction 0 of pat,
297                                            point 0 of pat)
298                              for i = 1 step 1 until length pat:
299                                      .. get_subpoint (ellipse,
300                                                       direction i of pat,
301                                                       point i of pat)
302                              endfor
303                              .. cycle;
304                         unfill get_subpoint (ellipse,
305                                              -direction 0 of pat,
306                                              point 0 of pat)
307                                for i = 1 step 1 until length pat:
308                                        .. get_subpoint (ellipse,
309                                                         -direction i of pat,
310                                                         point i of pat)
311                                endfor
312                                .. cycle;
313                 else:
314                         pat := threequartercircle rotated rot
315                                                   scaled neomensural_Cdiameter;
316
317                         fill get_subpath (ellipse,
318                                           -direction 0 of pat,
319                                           direction 0 of pat,
320                                           point 0 of pat)
321                              for i = 1 step 1 until (length pat - 1):
322                                      .. get_subpoint (ellipse,
323                                                       direction i of pat,
324                                                       point i of pat)
325                              endfor
326                              .. get_subpath (ellipse,
327                                              direction infinity of pat,
328                                              -direction infinity of pat,
329                                              point infinity of pat)
330                              for i = (length pat - 1) step -1 until 1:
331                                      .. get_subpoint (ellipse,
332                                                       -direction i of pat,
333                                                       point i of pat)
334                              endfor
335                              .. cycle;
336                 fi;
337
338                 if dotted:
339                         pickup pencircle scaled 4 linethickness;
340                         drawdot (0, 0);
341                 fi;
342
343                 currentpicture := currentpicture
344                                      shifted 0.5 (neomensural_Cdiameter
345                                                   + neomensural_Cthickness, 0);
346         fet_endchar;
347 enddef;
348
349
350 %% tempus imperfectum cum prolatione imperfecta
351 neomensural_timesig ("Mensural 4/4 meter", "neomensural44",
352                      false, false, false, false);
353
354
355 %% tempus imperfectum cum prolatione imperfecta proportio dupla
356 neomensural_timesig ("Mensural 2/2 meter", "neomensural22",
357                      false, false, true, false);
358
359
360 %% tempus perfectum cum prolatione imperfecta
361 neomensural_timesig ("Mensural 3/2 meter", "neomensural32",
362                      true, false, false, false);
363
364
365 %% tempus imperfectum cum prolatione perfecta
366 neomensural_timesig ("Mensural 6/4 meter", "neomensural64",
367                      false, false, false, true);
368
369
370 %% tempus perfectum cum prolatione perfecta
371 neomensural_timesig ("Mensural 9/4 meter", "neomensural94",
372                      true, false, false, true);
373
374
375 %% tempus perfectum cum prolatione imperfecta proportio dupla
376 neomensural_timesig ("Mensural 3/4 meter", "neomensural34",
377                      true, false, true, false);
378
379
380 %% tempus imperfectum cum prolatione perfecta proportio dupla
381 neomensural_timesig ("Mensural 6/8 meter", "neomensural68",
382                      false, false, true, true);
383
384
385 %% tempus perfectum cum prolatione perfecta proportio dupla
386 neomensural_timesig ("Mensural 9/8 meter", "neomensural98",
387                      true, false, true, true);
388
389
390 %% tempus imperfectum cum prolatione imperfecta diminutio simplex
391 neomensural_timesig ("Mensural 4/8 meter", "neomensural48",
392                      false, true, false, false);
393
394
395 %% tempus imperfectum cum prolatione perfecta diminutio simplex
396 neomensural_timesig ("Mensural 6/8 meter", "neomensural68alt",
397                      false, true, false, true);
398
399
400 %% tempus imperfectum cum prolatione imperfecta diminutio duplex
401 neomensural_timesig ("Mensural 2/4 meter", "neomensural24",
402                      false, true, true, false);
403
404
405 fet_endgroup ("timesig");