]> git.donarmstrong.com Git - lilypond.git/blob - mf/parmesan-rests.mf
Add '-dcrop' option to ps and svg backends
[lilypond.git] / mf / parmesan-rests.mf
1 % Feta (not the Font-En-Tja) music font --  ancient rests
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 % Neo-mensural rests originally by
7 % Christian Mondrup and Mats Bengtsson.
8
9 %
10 % The LilyPond font is free software: you can redistribute it and/or modify
11 % it under the terms of the GNU General Public License as published by
12 % the Free Software Foundation, either version 3 of the License, or
13 % (at your option) any later version, or under the SIL Open Font License.
14 %
15 % LilyPond is distributed in the hope that it will be useful,
16 % but WITHOUT ANY WARRANTY; without even the implied warranty of
17 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 % GNU General Public License for more details.
19 %
20 % You should have received a copy of the GNU General Public License
21 % along with LilyPond.  If not, see <http://www.gnu.org/licenses/>.
22
23 fet_begingroup ("rests")
24
25
26 %%%%%%%%
27 %
28 %
29 %
30 % NEO-MENSURAL NOTATION
31 %
32 %
33 %
34
35 % Neo-mensural longa and breve are identical with default longa and breve.
36
37 neomens_block_rest_x# = 2/5 staff_space#;
38 neomens_block_rest_y# = 1/1 staff_space#;
39 neomens_half_block_rest_y# = 5/8 staff_space#;
40
41 define_pixels (neomens_block_rest_x,
42                neomens_block_rest_y,
43                neomens_half_block_rest_y);
44
45
46 def neomens_half_block_rest =
47         draw_block ((0, 0),
48                     (neomens_block_rest_x, neomens_half_block_rest_y));
49 enddef;
50
51
52 fet_beginchar ("Neo-mensural maxima rest", "M3neomensural");
53         set_char_box (0, 3 neomens_block_rest_x#,
54                       neomens_block_rest_y#, neomens_block_rest_y#);
55
56         draw_block ((0, -neomens_block_rest_y),
57                      (neomens_block_rest_x, neomens_block_rest_y));
58         addto currentpicture also currentpicture
59                 shifted (2 neomens_block_rest_x, 0);
60 fet_endchar;
61
62
63 fet_beginchar ("Neo-mensural longa rest", "M2neomensural");
64         set_char_box (0, neomens_block_rest_x#,
65                       neomens_block_rest_y#, neomens_block_rest_y#);
66
67         draw_block ((0, -neomens_block_rest_y),
68                     (neomens_block_rest_x, neomens_block_rest_y));
69 fet_endchar;
70
71
72 fet_beginchar ("Neo-mensural breve rest", "M1neomensural");
73         set_char_box (0, neomens_block_rest_x#,
74                       0, neomens_block_rest_y#);
75
76         draw_block ((0, 0),
77                     (neomens_block_rest_x, neomens_block_rest_y));
78 fet_endchar;
79
80
81 fet_beginchar ("Neo-mensural whole rest", "0neomensural");
82         set_char_box (0, neomens_block_rest_x#,
83                       neomens_half_block_rest_y#,  0);
84
85         neomens_half_block_rest;
86         currentpicture :=
87                 currentpicture shifted (0, -neomens_half_block_rest_y);
88 fet_endchar;
89
90
91 fet_beginchar ("Neo-mensural half rest", "1neomensural");
92         set_char_box (0, neomens_block_rest_x#,
93                       0, neomens_half_block_rest_y#);
94
95         neomens_half_block_rest;
96 fet_endchar;
97
98
99 neomensrestsize# = 0.8 staff_space#;
100
101
102 fet_beginchar ("Neo-mensural 4th rest", "2neomensural");
103         set_char_box (0, neomensrestsize#,
104                       0, neomensrestsize#);
105
106         pickup pencircle scaled 2 stafflinethickness;
107
108         lft x1 = 0;
109         bot y1 = 0;
110         lft x2 = lft x3 = 0;
111         top y2 = top y3 = h;
112         rt x4 = w;
113         bot y4 = h / 2;
114
115         z11 = z1 - stafflinethickness * unitvector (z2 - z1);
116         z14 = z4 + stafflinethickness * unitvector (z4 - z3);
117
118         penpos1 (2 stafflinethickness, 0);
119         penpos2 (2 stafflinethickness, 0);
120         penpos3 (2 stafflinethickness, angle (z4 - z3) - 90);
121         penpos4 (2 stafflinethickness, angle (z4 - z3) - 90);
122
123         fill z1l
124              -- z2l
125              -- z2r
126              -- z1r
127              .. z11
128              .. z1l
129              .. cycle;
130         fill z3l
131              -- z4l
132              .. z14
133              .. z4r
134              -- z3r
135              .. z2l{up}
136              .. z3l
137              .. cycle;
138
139         penlabels (1, 2, 3, 4);
140         labels (11, 14);
141 fet_endchar;
142
143
144 fet_beginchar ("Neo-mensural 8th rest", "3neomensural");
145         set_char_box (0, neomensrestsize#,
146                       0, neomensrestsize#);
147
148         pickup pencircle scaled 2 stafflinethickness;
149
150         rt x1 = w;
151         bot y1 = 0;
152         rt x2 = rt x3 = w;
153         top y2 = top y3 = h;
154         lft x4 = 0;
155         bot y4 = h / 2;
156
157         z11 = z1 - stafflinethickness * unitvector (z2 - z1);
158         z14 = z4 + stafflinethickness * unitvector (z4 - z3);
159
160         penpos1 (2 stafflinethickness, 0);
161         penpos2 (2 stafflinethickness, 0);
162         penpos3 (2 stafflinethickness, angle (z4 - z3) - 90);
163         penpos4 (2 stafflinethickness, angle (z4 - z3) - 90);
164
165         fill z1l
166              -- z2l
167              -- z2r
168              -- z1r
169              .. z11
170              .. z1l
171              .. cycle;
172         fill z3l
173              -- z4l
174              .. z14
175              .. z4r
176              -- z3r
177              .. z2r{down}
178              .. z3l
179              .. cycle;
180
181         penlabels (1, 2, 3, 4);
182         labels (11, 14);
183 fet_endchar;
184
185
186 fet_beginchar ("Neo-mensural 16th rest", "4neomensural");
187         set_char_box (0, neomensrestsize#,
188                       0, staff_space#);
189
190         pickup pencircle scaled 2 stafflinethickness;
191
192         rt x1 = w;
193         bot y1 = 0;
194         rt x2 = w;
195         top y2 = h;
196
197         rt x3 = w;
198         top y3 = h;
199         lft x4 = 0;
200         bot y4 = h / 2;
201         rt x5 = w;
202         top y5 = 5/8 h;
203         lft x6 = 0;
204         bot y6 = h / 8;
205
206         z11 = z1 - stafflinethickness * unitvector (z2 - z1);
207         z14 = z4 + stafflinethickness * unitvector (z4 - z3);
208         z16 = z6 + stafflinethickness * unitvector (z6 - z5);
209
210         penpos1 (2 stafflinethickness, 0);
211         penpos2 (2 stafflinethickness, 0);
212         penpos3 (2 stafflinethickness, angle (z4 - z3) - 90);
213         penpos4 (2 stafflinethickness, angle (z4 - z3) - 90);
214         penpos5 (2 stafflinethickness, angle (z6 - z5) - 90);
215         penpos6 (2 stafflinethickness, angle (z6 - z5) - 90);
216
217         fill z1l
218              -- z2l
219              -- z2r
220              -- z1r
221              .. z11
222              .. z1l
223              .. cycle;
224         fill z3l
225              -- z4l
226              .. z14
227              .. z4r
228              -- z3r
229              .. z2r{down}
230              .. z3l
231              .. cycle;
232         fill z5l
233              -- z6l
234              .. z16
235              .. z6r
236              -- z5r
237              -- z5l
238              -- cycle;
239
240         penlabels (1, 2, 3, 4, 5, 6);
241         labels (11, 14, 16);
242 fet_endchar;
243
244
245 %%%%%%%%
246 %
247 %
248 %
249 % MENSURAL NOTATION
250 %
251 %
252 %
253
254 pen_width# = 0.3 staff_space#;
255 pen_height# = 0;
256 pen_rotation = 30;
257 slight_pen_rotation = 15;
258
259 mens_block_rest_y# = 1/1 staff_space#;
260 mens_half_block_rest_y# = 5/8 staff_space#;
261
262 define_pixels (mens_block_rest_y, mens_half_block_rest_y,
263                pen_width, pen_height);
264
265
266 fet_beginchar ("Mensural maxima rest", "M3mensural");
267         set_char_box (0, pen_width#,
268                       mens_block_rest_y#, 2 mens_block_rest_y#);
269
270         pickup pencircle xscaled pen_width
271                          yscaled pen_height
272                          rotated slight_pen_rotation;
273
274         draw (w / 2, -mens_block_rest_y)
275              -- (w / 2, 2 mens_block_rest_y);
276 fet_endchar;
277
278
279 fet_beginchar ("Mensural longa rest", "M2mensural");
280         set_char_box (0, pen_width#,
281                       mens_block_rest_y#, mens_block_rest_y#);
282
283         pickup pencircle xscaled pen_width
284                          yscaled pen_height
285                          rotated slight_pen_rotation;
286
287         draw (w / 2, -mens_block_rest_y)
288              -- (w / 2, mens_block_rest_y);
289 fet_endchar;
290
291
292 fet_beginchar ("Mensural breve rest", "M1mensural");
293         set_char_box (0, pen_width#,
294                       0, mens_block_rest_y#);
295
296         pickup pencircle xscaled pen_width
297                          yscaled pen_height
298                          rotated slight_pen_rotation;
299
300         draw (w / 2, 0)
301              -- (w / 2, mens_block_rest_y);
302 fet_endchar;
303
304
305 fet_beginchar ("Mensural whole rest", "0mensural");
306         set_char_box (0, pen_width#,
307                       mens_half_block_rest_y#, 0);
308
309         pickup pencircle xscaled pen_width
310                          yscaled pen_height
311                          rotated slight_pen_rotation;
312
313         draw (w / 2, 0)
314               -- (w / 2, -mens_half_block_rest_y);
315 fet_endchar;
316
317
318 fet_beginchar ("Mensural half rest", "1mensural");
319         set_char_box (0, pen_width#,
320                       0, mens_half_block_rest_y#);
321
322         pickup pencircle xscaled pen_width
323                          yscaled pen_height
324                          rotated slight_pen_rotation;
325
326         draw (w / 2, 0)
327               -- (w / 2, mens_half_block_rest_y);
328 fet_endchar;
329
330
331 mensrestsize# = .8 staff_space#;
332
333
334 fet_beginchar ("Mensural 4th rest", "2mensural");
335         set_char_box (0, mensrestsize#,
336                       0, mensrestsize#);
337
338         pickup pencircle xscaled pen_width
339                          yscaled pen_height
340                          rotated pen_rotation;
341
342         lft x1 = 0;
343         y1 = 0;
344         lft x2 = 0;
345         top y2 = 5/8 h;
346         rt x3 = 1/5 w;
347         bot y3 = 6/8 h;
348         rt x4 = w;
349         bot y4 = 4/8 h;
350
351         draw z1
352              -- z2
353              -- z3
354              -- z4;
355
356         labels (1, 2, 3, 4);
357 fet_endchar;
358
359 %
360 % FIXME: The left sharp corner produces ugly results at lower resolutions.
361 %
362 fet_beginchar ("Mensural 8th rest", "3mensural");
363         set_char_box (0, mensrestsize#,
364                       0, mensrestsize#);
365
366         pickup pencircle xscaled pen_width
367                          yscaled pen_height
368                          rotated pen_rotation;
369
370         rt x1 = w;
371         y1 = 0;
372         rt x2 = w;
373         top y2 = 5/8 h;
374         lft x3 = 1/5 w;
375         bot y3 = 6/8 h;
376         lft x4 = 0;
377         bot y4 = 4/8 h;
378
379         draw z1
380              -- z2
381              -- z3
382              -- z4;
383
384         labels (1, 2, 3, 4);
385 fet_endchar;
386
387 %
388 % FIXME: So far, I have never seen a semifusa rest printed.  Hence,
389 % the shape of this font character is currently pure invention.  --jr
390 %
391 %
392 % FIXME: The left sharp corner produces ugly results at lower resolutions.
393 %
394 fet_beginchar ("Mensural 16th rest", "4mensural");
395         set_char_box (0, mensrestsize#,
396                       0, staff_space#);
397
398         pickup pencircle xscaled pen_width
399                          yscaled pen_height
400                          rotated pen_rotation;
401
402         rt x1 = w;
403         y1 = 0;
404         rt x2 = w;
405         top y2 = 5.5/8 h;
406         lft x3 = 1/5 w;
407         bot y3 = 6.5/8 h;
408         lft x4 = 0;
409         bot y4 = 4.5/8 h;
410         rt x5 =  w;
411         top y5 = 2.5/8 h;
412         lft x6 = 1/5 w;
413         bot y6 = 3.5/8 h;
414         lft x7 = 0;
415         bot y7 = 1.5/8 h;
416
417         draw z1
418              -- z2
419              -- z3
420              -- z4;
421         draw z5
422              -- z6
423              -- z7;
424
425         labels (1, 2, 3, 4, 5, 6, 7);
426 fet_endchar;
427
428
429 fet_endgroup ("rests")