]> git.donarmstrong.com Git - lilypond.git/blob - mf/parmesan-scripts.mf
Add '-dcrop' option to ps and svg backends
[lilypond.git] / mf / parmesan-scripts.mf
1 % Feta (not the Font-En-Tja) music font --  ancient script symbols
2 % This file is part of LilyPond, the GNU music typesetter.
3 %
4 % Copyright (C) 2002--2015 Juergen Reuter <reuter@ipd.uka.de>
5
6 %
7 % The LilyPond font 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, or under the SIL Open Font License.
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 ("scripts");
21
22 fet_beginchar ("ictus", "ictus");
23         save ht, wd;
24         ht# = .35 staff_space#;
25         wd# = linethickness#;
26
27         define_pixels (wd, ht);
28
29         save ellipse, T;
30         path ellipse;
31         transform T;
32
33         T := identity xscaled wd
34                       yscaled blot_diameter;
35         pickup pencircle transformed T;
36         ellipse := fullcircle transformed T;
37
38         set_char_box (wd# / 2, wd# / 2, ht# / 2, ht# / 2);
39
40         x1 = 0;
41         top y1 = ht / 2;
42         x2 = 0;
43         bot y2 = -ht / 2;
44
45         fill get_subpath (ellipse, up, down, z1)
46              -- get_subpath (ellipse, down, up, z2)
47              -- cycle;
48
49         labels (1, 2);
50 fet_endchar;
51
52
53 def draw_accentus =
54         save thick, thin, ht, wd;
55
56         thin# = 1 linethickness#;
57         thick# = 1.2 linethickness#;
58         ht# = .35 staff_space#;
59         wd# = .25 staff_space#;
60
61         define_pixels (wd, ht, thin, thick);
62
63         z1 = z2 = (-wd / 2 + thin / 2, -ht / 2 + thin / 2);
64         z3 = z4 = (wd / 2 - thick / 2, ht / 2 - thick / 2);
65
66         penpos1 (thin, angle (z1 - z3));
67         penpos2 (thin, angle (z1 - z3) + 90);
68         penpos3 (thick, angle (z3 - z1) + 90);
69         penpos4 (thick, angle (z3 - z1));
70
71         fill z1r
72              .. z2r
73              -- z3l
74              .. z4r
75              .. z3r
76              -- z2l
77              .. cycle;
78
79         set_char_box (wd#/2, wd#/2, ht#/2, ht#/2);
80 enddef;
81
82
83 fet_beginchar ("accentus up", "uaccentus");
84         draw_accentus;
85         penlabels (1, 2, 3, 4);
86 fet_endchar;
87
88
89 fet_beginchar ("accentus down", "daccentus");
90         draw_accentus;
91         y_mirror_char;
92 fet_endchar;
93
94
95 def draw_half_circle (expr diam) =
96         save diameter, thick;
97
98         diameter# = diam;
99
100         define_pixels (diameter);
101
102         thick = 0.6 linethickness;
103
104         penpos1 (thick, 0);
105         penpos2 (thick, -90);
106         penpos3 (thick, -180);
107
108         z1r = (diameter / 2, 0);
109         z2r = (0, -diameter / 2);
110         z3r = (-diameter / 2, 0);
111         
112         penstroke z1e{down}
113                   .. z2e{left}
114                   .. z3e{up};
115 enddef;
116
117
118 fet_beginchar ("half circle", "usemicirculus");
119         draw_half_circle (5/16 staff_space#);
120
121         currentpicture := currentpicture yscaled -1;
122
123         set_char_box (diameter# / 2, diameter# / 2,
124                       0, diameter# / 2);
125 fet_endchar;
126
127
128 fet_beginchar ("half circle", "dsemicirculus");
129         draw_half_circle (5/16 staff_space#);
130
131         set_char_box (diameter# / 2, diameter# / 2,
132                       diameter# / 2, 0);
133
134         penlabels (1, 2, 3);
135 fet_endchar;
136
137
138 fet_beginchar ("circle", "circulus");
139         save diameter, thick;
140
141         diameter# = 5/16 staff_space#;
142
143         define_pixels (diameter);
144
145         thick = 0.6 linethickness;
146
147         fill fullcircle scaled diameter;
148         unfill fullcircle scaled (diameter - 2 thick);
149
150         set_char_box (diameter# / 2, diameter# / 2,
151                       diameter# / 2, diameter# / 2);
152 fet_endchar;
153
154
155 fet_beginchar ("augmentum", "augmentum");
156         save diameter;
157
158         diameter# = 0.25 staff_space#;
159
160         define_pixels (diameter);
161
162         pickup pencircle scaled diameter;
163
164         drawdot (0, 0);
165
166         set_char_box (diameter# / 2, diameter# / 2,
167                       diameter# / 2, diameter# / 2);
168 fet_endchar;
169
170
171 def draw_signum_congruentiae =
172         set_char_box (0.50 staff_space# + 1.5 linethickness#,
173                       0.50 staff_space# + 1.5 linethickness#,
174                       2.5 linethickness#,
175                       2.00 staff_space# + 3.5 linethickness#);
176
177         save ellipse, pat;
178         path ellipse, pat;
179
180         ellipse := fullcircle xscaled 1.0 linethickness
181                               yscaled 5.0 linethickness
182                               rotated -35;
183
184         z1 = (+0.50 staff_space, +2.00 staff_space);
185         z2 = (+0.00 staff_space, +2.00 staff_space);
186         z3 = (-0.50 staff_space, +1.50 staff_space);
187         z4 = (-0.25 staff_space, +1.00 staff_space);
188         z5 = (+0.10 staff_space, +0.80 staff_space);
189         z6 = (+0.00 staff_space, +0.00 staff_space);
190
191         pat := z1{-1, +1}
192                .. z2
193                .. z3
194                .. z4
195                .. z5
196                .. z6;
197
198         % we avoid cusps originally present in `draw pat'
199         fill get_subpath (ellipse,
200                           -direction 0 of pat, direction 0 of pat, z1)
201              .. get_subpoint (ellipse, direction 1 of pat, z2)
202                   {direction 1 of pat}
203              .. get_subpoint (ellipse, direction 2 of pat, z3)
204                   {direction 2 of pat}
205              .. get_subpoint (ellipse, direction 3 of pat, z4)
206                   {direction 3 of pat}
207              .. get_subpoint (ellipse, direction 4 of pat, z5)
208                   {direction 4 of pat}
209              .. get_subpath (ellipse,
210                              direction 4.8 of pat, -direction 5 of pat, z6)
211              .. get_subpoint (ellipse, -direction 4 of pat, z5)
212                   {-direction 4 of pat}
213              .. get_subpoint (ellipse, -direction 3 of pat, z4)
214                   {-direction 3 of pat}
215              .. get_subpoint (ellipse, -direction 2.5 of pat, point 2.5 of pat)
216              .. get_subpoint (ellipse, -direction 1 of pat, z2)
217                   {-direction 1 of pat}
218              .. cycle;
219
220         pickup pencircle scaled 3.0 linethickness;
221
222         z7 = (-0.5 staff_space, +0.0 staff_space);
223         z8 = (+0.5 staff_space, +0.0 staff_space);
224
225         drawdot z7;
226         drawdot z8;
227 enddef;
228
229
230 fet_beginchar ("signum congruentiae up", "usignumcongruentiae");
231         draw_signum_congruentiae;
232         labels (1, 2, 3, 4, 5, 6, 7, 8);
233 fet_endchar;
234
235
236 fet_beginchar ("signum congruentiae down", "dsignumcongruentiae");
237         draw_signum_congruentiae;
238         xy_mirror_char;
239 fet_endchar;
240
241
242 %%%%%%%%%%%%%
243 %%%%
244 %%%% Code for Kievan Notation
245 %%%%
246 %%%%%%%%%%%%%
247
248
249 fet_beginchar ("Kievan end of piece (slash)", "barline.kievan");
250         % This draws the end of piece figure.
251         % This figure is placed at the end of the musical piece,
252         % after the staff.
253
254         save hair_thickness, thick_thickness, width, depth, height, padding;
255         hair# = 1.9 linethickness#;
256         thick# = 6.0 linethickness#;
257         width# = 1.0 staff_space#;
258         height# + depth# = 4 staff_space#;
259         depth# = height# + hair#;
260         padding# = .2 staff_space#;
261
262         set_char_box (0, width# + 3 padding#, depth#, height# + staff_space#);
263         define_pixels (hair, thick, width, padding, depth, height);
264
265         x7r - x2l = width;
266         y1 - y3r = depth + height + linethickness / 2;
267         z3 = z2;
268         z4 = .5 [z1, z2]
269            = (width / 2 + padding, hair / 8);
270         z5 = (x2 - .17 staff_space, 9/10 [y2, y1]);
271         z7 - z6 = (.5 staff_space, -.2 staff_space);
272         .4 [z6, z7] = 7/6 [z2, z1];
273
274         penpos1 (hair, 0);
275         penpos2 (hair, 0);
276         penpos3 (hair, -90);
277         penpos4 (thick, 10);
278         penpos5 (thick, 35);
279         penpos6 (hair, -90);
280         penpos7 (.5 thick, -120);
281
282         penlabels (1, 2, 3, 4, 5, 6, 7);
283
284         penstroke z1e
285                   -- z2e;
286
287         fill z3l
288              -- z2l{z2 - z1}
289              .. z3r{right}
290              .. z4r
291              .. z5r
292              .. z6r
293              .. simple_serif (z7r, z7l, 80)
294              .. {left}z6l
295              .. z5l
296              .. z4l
297              .. {left}cycle;
298 fet_endchar;
299
300 fet_endgroup ("scripts");