* lily/kpath.cc:
[lilypond.git] / mf / parmesan-custodes.mf
blob4b167fee0c3711ed5faf7a002e9a529defc75632
1 % -*-Fundamental-*-
2 % parmesan-custodes.mf -- implement ancient custodes
3
4 % source file of LilyPond's pretty-but-neat music font
5
6 % (c) 2000--2002 Juergen Reuter <reuter@ipd.uka.de>
7
9 save black_notehead_width;
10 numeric black_notehead_width;
12 fet_begingroup ("custodes")
14 noteheight#:=staff_space#+ (1 + overdone_heads) *stafflinethickness#;
15 define_pixels(noteheight);
17 save between_staff_lines, on_staff_line, anywhere;
18 between_staff_lines = 0;
19 on_staff_line = 1;
20 anywhere = 2;
22 save dir_up, dir_down;
23 dir_up = 1;
24 dir_down = -1;
27 %%%%%%%%
30 % Hufnagel style
34 % parameterized hufnagel custos
35 def custos_hufnagel(expr verbose_name, internal_name, mudela_name,
36                     direction, staffline_adjustment) =
38         fet_beginchar(verbose_name, internal_name, mudela_name)
40                 save b_h, a_w;
41                 a_b := 1.54; % b_h * a_b / a_w = wd / ht
42                 b_h := 0.85;
43                 a_w := 1.09;
45                 save a, beta, ht, wd;
46                 ht# = noteheight#;
47                 2beta# = ht# * b_h;
48                 a# = beta# * a_b;
49                 wd# = 2a# / a_w;
50                 set_char_box(0, wd#, ht# / 2, ht# / 2);
51                 black_notehead_width# := wd#;
53                 save rh_width, rh_height, rh_edge; % rhombus dimensions
54                 rh_width# / ht# = tand(35);
55                 rh_height# = 1.0ht#;
56                 rh_edge# * cosd(35) = ht# / 2;
58                 save stem_size;
59                 if staffline_adjustment = between_staff_lines:
60                         stem_size = 0.25;
61                 elseif staffline_adjustment = on_staff_line:
62                         stem_size = 0.75;
63                 else: % staffline_adjustment = anywhere
64                         stem_size = 0.50;
65                 fi;
67                 define_pixels(rh_width, rh_height, rh_edge);
68                 pickup pencircle
69                   xscaled stafflinethickness
70                   yscaled rh_edge
71                   rotated (-35*direction);
72                 z1=(0.5rh_width,+0.25direction*rh_height);
73                 z2=(1.0rh_width,-0.25direction*rh_height);
74                 z3-z2=(stem_size*rh_width,+0.75*stem_size*direction*rh_height);
75                 draw z1 -- z2 -- z3;
77         fet_endchar;
78 enddef;
80 % custos hufnagel, stem up, between staff lines
81 custos_hufnagel("Custos Hufnagel", "hufnagel-u0", "hufnagel_u0",
82                 dir_up, between_staff_lines);
84 % custos hufnagel, stem up, on staff line
85 custos_hufnagel("Custos Hufnagel", "hufnagel-u1", "hufnagel_u1",
86                 dir_up, on_staff_line);
88 % custos hufnagel, stem up, anywhere
89 custos_hufnagel("Custos Hufnagel", "hufnagel-u2", "hufnagel_u2",
90                 dir_up, anywhere);
92 % custos hufnagel, stem down, between staff lines
93 custos_hufnagel("Reverse Custos Hufnagel", "hufnagel-d0", "hufnagel_d0",
94                 dir_down, between_staff_lines);
96 % custos hufnagel, stem down, on staff line
97 custos_hufnagel("Reverse Custos Hufnagel", "hufnagel-d1", "hufnagel_d1",
98                 dir_down, on_staff_line);
100 % custos hufnagel, stem down, anywhere
101 custos_hufnagel("Reverse Custos Hufnagel", "hufnagel-d2", "hufnagel_d2",
102                 dir_down, anywhere);
104 %%%%%%%%
107 % Medicaea style
111 def custos_medicaea(expr verbose_name, internal_name, mudela_name,
112                     direction, staffline_adjustment) =
114         fet_beginchar(verbose_name, internal_name, mudela_name)
116                 save b_h, a_w;
117                 a_b := 1.54; % b_h * a_b / a_w = wd / ht
118                 b_h := 0.85;
119                 a_w := 1.09;
121                 save a, beta, ht, wd;
122                 ht# = noteheight#; %%  * mag;
123                 2beta# = ht# * b_h;
124                 a# = beta# * a_b;
125                 wd# = 0.4a# / a_w;      % width intentionally too small
126                 set_char_box(0, wd#, ht# / 2, ht# / 2);
127                 black_notehead_width# := wd#;
129                 define_pixels(ht, wd);
131                 save stem_size;
132                 if staffline_adjustment = between_staff_lines:
133                         stem_size = 0.90;
134                 elseif staffline_adjustment = on_staff_line:
135                         stem_size = 1.40;
136                 else: % staffline_adjustment = anywhere
137                         stem_size = 1.15;
138                 fi;
140                 pickup pencircle xscaled blot_diameter yscaled 1.0ht;
141                 z1 = (0.0wd, 0.0ht);
142                 z2 = z1 + (1.0wd - blot_diameter/2, 0);
143                 draw z1 .. z2;
145                 pickup pencircle scaled stafflinethickness;
146                 z3 = (1.0wd - stafflinethickness/2, 0.0ht);
147                 z4 = z3 + (0, +direction*stem_size*ht);
148                 draw z3 .. z4;
150         fet_endchar;
151 enddef;
153 % custos medicaea, stem up, between staff lines
154 custos_medicaea("Custos Med.", "medicaea-u0", "medicaea_u0",
155                 dir_up, between_staff_lines);
157 % custos medicaea, stem up, on staff line
158 custos_medicaea("Custos Med.", "medicaea-u1", "medicaea_u1",
159                 dir_up, on_staff_line);
161 % custos medicaea, stem up, anywhere
162 custos_medicaea("Custos Med.", "medicaea-u2", "medicaea_u2",
163                 dir_up, anywhere);
165 % custos medicaea, stem down, between staff lines
166 custos_medicaea("Reverse Custos Med.", "medicaea-d0", "medicaea_d0",
167                 dir_down, between_staff_lines);
169 % custos medicaea, stem down, on staff line
170 custos_medicaea("Reverse Custos Med.", "medicaea-d1", "medicaea_d1",
171                 dir_down, on_staff_line);
173 % custos medicaea, stem down, anywhere
174 custos_medicaea("Reverse Custos Med.", "medicaea-d2", "medicaea_d2",
175                 dir_down, anywhere);
177 %%%%%%%%
180 % Editio Vaticana style
184 def custos_vaticana(expr verbose_name, internal_name, mudela_name,
185                     direction, staffline_adjustment) =
187         fet_beginchar(verbose_name, internal_name, mudela_name)
189                 save b_h, a_w;
190                 a_b := 1.54; % b_h * a_b / a_w = wd / ht
191                 b_h := 0.85;
192                 a_w := 1.09;
194                 save a, beta, ht, wd;
195                 ht# = noteheight# ; %%  * mag;
196                 2beta# = ht# * b_h;
197                 a# = beta# * a_b;
198                 wd# = 0.4a# / a_w;
199                 set_char_box(0, wd#, ht# / 2, ht# / 2);
200                 black_notehead_width# := wd#;
202                 save stem_size;
203                 if staffline_adjustment = between_staff_lines:
204                         stem_size = 0.60;
205                 elseif staffline_adjustment = on_staff_line:
206                         stem_size = 1.10;
207                 else: % staffline_adjustment = anywhere
208                         stem_size = 0.85;
209                 fi;
211                 define_pixels(ht, wd);
212                 pickup pencircle scaled stafflinethickness;
214                 z1 = (0.0wd, +direction*0.05ht);
215                 z2 = (1.0wd + 0.5stafflinethickness, 0.0ht);
216                 penpos1(0.5ht, 90);
217                 penpos2(0.5ht, 90);
218                 penstroke z1e{z2 - z1} .. {right}z2e;
220                 z3=(1.0wd, +0.0ht);
221                 z4=(1.0wd, +direction*stem_size*ht);
222                 draw z3 -- z4;
224         fet_endchar;
225 enddef;
227 % custos vaticana, stem up, between staff lines
228 custos_vaticana("Custos Ed. Vat.", "vaticana-u0", "vaticana_u0",
229                 dir_up, between_staff_lines);
231 % custos vaticana, stem up, on staff line
232 custos_vaticana("Custos Ed. Vat.", "vaticana-u1", "vaticana_u1",
233                 dir_up, on_staff_line);
235 % custos vaticana, stem up, anywhere
236 custos_vaticana("Custos Ed. Vat.", "vaticana-u2", "vaticana_u2",
237                 dir_up, anywhere);
239 % custos vaticana, stem down, between staff lines
240 custos_vaticana("Reverse Custos Ed. Vat.", "vaticana-d0", "vaticana_d0",
241                 dir_down, between_staff_lines);
243 % custos vaticana, stem down, on_staff_line
244 custos_vaticana("Reverse Custos Ed. Vat.", "vaticana-d1", "vaticana_d1",
245                 dir_down, on_staff_line);
247 % custos vaticana, stem down, anywhere
248 custos_vaticana("Reverse Custos Ed. Vat.", "vaticana-d2", "vaticana_d2",
249                 dir_down, anywhere);
251 %%%%%%%%
254 % Mensural style
258 def custos_mensural(expr verbose_name, internal_name, mudela_name,
259                     direction, staffline_adjustment) =
261         fet_beginchar(verbose_name, internal_name, mudela_name)
263                 save b_h,a_w;
264                 a_b:=1.54; % b_h * a_b / a_w = wd / ht
265                 b_h:=0.85;
266                 a_w:=1.09;
268                 save a, beta, ht, wd;
269                 ht# = noteheight#;
270                 2beta# = ht# * b_h;
271                 a# = beta# * a_b;
272                 wd# = 2a# / a_w;        % width intentionally too small
273                 set_char_box(0, wd#, ht# / 2, ht# / 2);
274                 black_notehead_width# := wd#;
276                 save stem_size;
277                 if staffline_adjustment = between_staff_lines:
278                         stem_size = 0.85;
279                 elseif staffline_adjustment = on_staff_line:
280                         stem_size = 1.35;
281                 else: % staffline_adjustment = anywhere
282                         stem_size = 1.10;
283                 fi;
285                 define_pixels(ht, wd);
286                 pickup pencircle
287                   xscaled stafflinethickness
288                   yscaled 0.4ht
289                   rotated (-35*direction);
290                 z1=(0.0wd,-direction*0.2ht);
291                 z2=(0.2wd,+direction*0.2ht);
292                 z3=(0.4wd,-direction*0.2ht);
293                 z4=(0.6wd,+direction*0.2ht);
294                 z5=(0.8wd,-direction*0.2ht);
295                 z6-z5=(stem_size*0.5wd,+direction*stem_size*ht);
296                 draw z1 -- z2 -- z3 -- z4 -- z5 -- z6;
298         fet_endchar;
299 enddef;
301 % custos mensural, stem up, between staff lines
302 custos_mensural("Custos Mensural", "mensural-u0", "mensural_u0",
303                 dir_up, between_staff_lines);
305 % custos mensural, stem up, on staff line
306 custos_mensural("Custos Mensural", "mensural-u1", "mensural_u1",
307                 dir_up, on_staff_line);
309 % custos mensural, stem up, anywhere
310 custos_mensural("Custos Mensural", "mensural-u2", "mensural_u2",
311                 dir_up, anywhere);
313 % custos mensural, stem down, between staff lines
314 custos_mensural("Reverse Custos Mensural", "mensural-d0", "mensural_d0",
315                 dir_down, between_staff_lines);
317 % custos mensural, stem down, on staff line
318 custos_mensural("Reverse Custos Mensural", "mensural-d1", "mensural_d1",
319                 dir_down, on_staff_line);
321 % custos mensural, stem down, anywhere
322 custos_mensural("Reverse Custos Mensural", "mensural-d2", "mensural_d2",
323                 dir_down, anywhere);
325 fet_endgroup ("custodes")