1 % -*- Fundamental -*- (emacs-20 mf mode mucks
2 % feta-pendaal.mf -- piano pedal markings
4 % part of LilyPond's pretty-but-neat music font
6 % source file of the Feta (not the Font-En-Tja) music font
8 % (c) 2000--2004 Jan Nieuwenhuizen <janneke@gnu.org>
14 % Pe = -0.034 pedalh == -0.07 staff-space
15 % ed = -0.27 pedalh == -0.53 staff-space
18 fet_begingroup ("pedal");
23 penh# = 0.7 linethickness#;
24 penw# = 2 penh# + 0.14 staff_space#;
25 define_pixels (penh, penw);
27 pedalh# = 2 staff_space#;
28 pedalbh# = 4/7 pedalh#;
29 define_pixels (pedalh, pedalbh);
32 fet_beginchar ("Pedal asterisk", "*");
33 save bulb, p, radius, thin, inner_r;
36 set_char_box (0, 7/9 pedalh#, 0, pedalh#);
38 z0 = (1/2 w, h - 1/2 w);
40 thin = 0.8 linethickness;
43 0.9 thin + bulb = (radius * pi * 2) / 8;
45 pickup pencircle scaled penh;
51 z1 = z0 + (0, radius);
56 z4l = z0 + inner_r * dir (90 + 360/16);
57 z4r = z0 + inner_r * dir (90 - 360/16);
62 penlabels (0, 1, 2, 3, 4);
68 .. z4l{dir (180 + 360/16)};
75 .. z4l{dir (180 + 360/16)})
76 rotatedaround (z0, 360/8 i));
82 % Uh, oh, there is a bug in metapost 0.641 which makes mf2pt1.mp's
83 % redefinion of `fill' fail for this particular path, using a
84 % wrong path orientation.
86 % Note that using `unfill' here makes the direct mpost output
87 % wrong, but the `mf2pt1' script fixes it for the Type 1 output.
89 if known bp_per_pixel:
95 pickup pencircle scaled (7/8 inner_r);
101 %% ugh. rounded corners!
103 fet_beginchar ("Pedal dash", "-");
106 dash_thickness# := penw#;
107 define_whole_vertical_blacker_pixels (dash_thickness);
109 set_char_box (0, 3 penw#, 0, pedalbh#);
111 penpos1 (dash_thickness, 60);
112 penpos2 (dash_thickness, 60);
114 z1l = (0, vround (2/3 h - 1/2 penw));
115 z2r = (w, vround (y1l + 1.2 penw));
119 penstroke z1e{dir 40}
120 ..tension 1.2.. z2e{dir 40};
124 fet_beginchar ("Pedal dot", ".");
125 set_char_box (0, penw#, 0, penw#);
127 pickup pencircle scaled penw;
129 drawdot (hround (1/2 penw), vround (1/2 penw));
133 def draw_pedal_P (expr show_labels) =
137 penpos1 (hround penh, 0);
139 penpos3 (penw, pedalpha);
140 penpos4 (1.2 penh, -pedalpha);
141 penpos5 (penh, -pedalpha);
142 penpos6 (penh, 180 - pedalpha);
143 penpos7 (2 penh, 180 - pedalpha);
145 penpos9 (4/3 penw, 50);
146 penpos10 (1.4 penw, 50);
147 penpos11 (penh, 90 + pedalpha);
149 z1r = (hround 0.6 w, h);
150 x2l = hround (x1l - penw) + xpart feta_offset;
151 y2 = vround (0.7 h) + ypart feta_offset;
152 x3r = hround (x2l + 2 penw);
154 z4l = z5r + 1/4 (z3r - z5r);
158 z7 = z6r + 1/3 (z8r - z6r);
159 z8r = z5r + 3/5 (z3r - z5r);
162 x10l = w - tand (90 - pedalpha) * y11l;
167 z1' = round (0.9 [z2, z1]) + (xpart feta_offset, 0);
171 penlabels (range 1 thru 11);
182 ..tension 1.5.. z8e{right}
183 ..tension 1.5.. z9e{dir - pedalpha}
185 ..tension 2.5.. z11e;
187 penpos12 (hround penh, 0);
188 penpos13 (penw, -90 - pedbeta);
189 penpos14 (vround penh, 90);
190 penpos15 (penw, -90 + pedbeta);
191 penpos16 (penh, 180 + pedbeta);
193 z12r = (hround (5/9 x1 + 1/2 hround penh), y2);
194 z13l = (1/2 x12r, y15r);
196 z15l = (1/2 [x16, w], y2l + 0.5 penw);
201 penlabels (range 12 thru 16);
204 soft_penstroke z12e{down}
205 ..tension 1.1.. z13e{dir (180 - pedbeta)}
206 ..tension 1.1.. z14e{right}
207 ..tension 1.1.. z15e{dir (180 + pedbeta)}
208 ..tension 1.1.. z16e{dir (90 + pedbeta)};
213 def draw_pedal_d (expr show_labels) =
217 penpos1 (vround penh, -10 - 90);
218 penpos2 (hround penw, 190);
219 penpos3 (vround (2 penh), 90);
220 penpos4 (hround (3/4 penw), 0);
225 z2 = (w - 1/2 hround penw, 1/2 pedalbh + penh);
226 z4l = (hround (1/3 w), 1/2 pedalbh);
227 z5l = (2/3 w, pedalbh);
228 z3l = (hround x5l, 0);
231 penlabels (1, 2, 3, 4, 5);
234 soft_penstroke z1e{dir (-10)}
235 ..tension 1.1.. z2e{dir (-90 + 10)}
236 ..tension 1.1.. z3e{left}
237 ..tension 1.1.. z4e{up}
238 ..tension 1.1.. z5e{dir (-70 + 90)};
243 def draw_pedal_e (expr show_labels) =
247 penpos1 (penh, pedalpha - 90);
248 penpos2 (penh, pedalpha - 90);
249 penpos3 (3/5 penw, pedalpha);
250 penpos4 (1.2 penh, 90 + pedalpha);
251 penpos5 (2/3 penw, 180);
252 penpos6 (penw, 180 + pedalpha);
253 penpos7 (2/3 penw, -90 - 20);
254 penpos8 (penh, pedalpha - 90);
256 z1l = (0, 1/5 pedalh);
257 % this helps to make the path go through z2 at low resolutions
258 z2 = round (z1 + dir pedalpha * penw) + feta_offset;
266 z7l = (x6l + penh, y6l);
275 ..tension 1.5.. z6e{dir - pedalpha}
280 penlabels (range 1 thru 8);
286 fet_beginchar ("Pedal P", "P");
287 set_char_box (0, 5/6 pedalh#, 0, pedalh#);
293 fet_beginchar ("Pedal d", "d");
294 set_char_box (0, 2/3 pedalh#, 0, 7/8 pedalh#);
300 fet_beginchar ("Pedal e", "e");
301 set_char_box (0, 2/5 pedalh#, 0, pedalbh#);
307 fet_beginchar ("Pedal Ped", "Ped");
308 P_width# = 5/6 pedalh#;
309 e_width# = 2/5 pedalh#;
310 d_width# = 2/3 pedalh#;
311 define_pixels (P_width, e_width, d_width);
314 d_height = 7/8 pedalh;
316 % Pe = -0.034 pedalh == -0.07 staff-space
317 % ed = -0.27 pedalh == -0.53 staff-space
318 Pe_kern# = -0.034 pedalh#;
319 ed_kern# = -0.27 pedalh#;
320 define_pixels (Pe_kern, ed_kern);
323 h := vround d_height;
325 currentpicture := currentpicture
326 shifted (hround (e_width + ed_kern), 0);
329 h := vround e_height;
331 currentpicture := currentpicture
332 shifted (hround (P_width + Pe_kern), 0);
338 set_char_box (0, P_width# + Pe_kern# + e_width# + ed_kern# + d_width#,
343 fet_endgroup ("pedal");