]> git.donarmstrong.com Git - lilypond.git/blob - mf/feta-toevallig.mf
formatting nits
[lilypond.git] / mf / feta-toevallig.mf
1 %
2 % feta-toevallig.mf -- implement Accidentals
3 %
4 % (c) 1997--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
5 %
6
7
8 %
9 % also show in other configuration wrt staff lines.
10 %
11 def draw_shifted_too =
12 if test > 0:
13         fet_beginchar ("shifted too", "");
14                 set_char_box (0, 0, 0, 0);
15                 currentpicture := remember_pic;
16
17                 draw_staff (-2, 2, 0.5);
18         fet_endchar;
19 fi;
20 enddef;
21
22
23 %
24 % Accidentals from various sources, notably
25 %
26 %   Baerenreiter edition of Schuberts `Auf dem Strom' (sharp, natural)
27 %   F Hofmeister edition of Muellers `Etueden fuer Horn' (double sharp, flat)
28 %
29
30
31 %
32 % Naming for accidentals (including microtonal variants):
33 %
34 %   BASES.SLASHES.STEMS
35 %  
36 % Examples:
37 %
38 %   mirroredflat.flat.slashslash
39 %   sharp.slashslash.stemstem     (the standard sharp sign)
40 %
41
42
43 fet_begingroup ("accidentals");
44
45
46 save remember_pic;
47 picture remember_pic;
48
49 save sharp_beamheight;
50 sharp_beamheight# := 0.3 staff_space# + stafflinethickness#;
51
52 %
53 % The beams of most sharps have horizontal endings (as if drawn with
54 % a square pen).  [Wanske] does not mention this, so we'll just ignore
55 % this fact.
56 %
57
58 def draw_meta_sharp (expr width, offset) =
59         save beamwidth, beamslope;
60         save ne, nw_dist;
61         pair ne, nw_dist;
62
63         beamwidth := width;
64
65         define_whole_vertical_blacker_pixels (sharp_beamheight);
66
67         clearxy;
68
69         beamslope = sharp_beamheight / beamwidth;
70
71         pickup pencircle scaled 2 blot_diameter;
72
73         rt x2 - lft x1 = beamwidth;
74         y2 - y1 = sharp_beamheight;
75         .5 [z1, z3] = (.5 w, offset);
76         x3 = x2;
77         top y2 - bot y3 = sharp_beamheight;
78         x4 = x1;
79         top y1 - bot y4 = sharp_beamheight;
80
81         ne = unitvector (z2 - z1);
82         nw_dist = (ne rotated 90) * blot_diameter;
83
84         fill lft z1{up}
85              ... (z1 + nw_dist){ne}
86              -- (z2 + nw_dist){ne}
87              ... rt z2{down}
88              -- rt z3{down}
89              ... (z3 - nw_dist){-ne}
90              -- (z4 - nw_dist){-ne}
91              ... lft z4{up}
92              -- cycle;
93
94         labels (1, 2, 3, 4);
95 enddef;
96
97
98 fet_beginchar ("Sharp", "sharp");
99         save stem, stemx, stemwidth;
100         save outer_space, interbeam;
101
102         stemwidth# := stafflinethickness# + .05 staff_space#;
103         define_whole_blacker_pixels (stemwidth);
104
105         interbeam := 1.05 staff_space_rounded;
106
107         set_char_box (0, 1.1 staff_space#,
108                       1.5 staff_space#, 1.5 staff_space#);
109
110         stem := 7 / 16 * w;
111         stemx := hround stem;
112         outer_space := hround ((w - stemx - stemwidth) / 2);
113
114         w := 2 outer_space + stemx + stemwidth;
115         d := d - feta_space_shift;
116
117         draw_meta_sharp (w, -.5 interbeam);
118         draw_meta_sharp (w, -.5 interbeam + vround interbeam);
119
120         pickup pencircle scaled stemwidth;
121
122         lft x5 = lft x6 = outer_space;
123         lft x7 = lft x8 = outer_space + stemx;
124         bot y5 = -d;
125         top y6 = vround (1.5 staff_space - stem * beamslope);
126         bot y7 = -top y6 + feta_space_shift;
127         top y8 = h;
128
129         labels (5, 6, 7, 8);    
130
131         draw_gridline (z5, z6, stemwidth);
132         draw_gridline (z7, z8, stemwidth);
133
134         remember_pic := currentpicture;
135
136         draw_staff (-2, 2, 0);
137 fet_endchar;
138
139
140 draw_shifted_too;
141
142
143 fet_beginchar ("1/2 Sharp", "sharp.slashslash.stem");
144         save stem, stemwidth;
145         save outer_space, interbeam;
146
147         stemwidth# := stafflinethickness# + .05 staff_space#;
148         define_whole_blacker_pixels (stemwidth);
149
150         interbeam := 1.05 staff_space_rounded;
151
152         set_char_box (0, 0.7 staff_space#,
153                       1.5 staff_space#, 1.5 staff_space#);
154
155         stem := 7 / 16 * w;
156         outer_space := hround ((w - stemwidth) / 2);
157
158         w := 2 outer_space + stemwidth;
159         d := d - feta_space_shift;
160
161         draw_meta_sharp (w, -.5 interbeam);
162         draw_meta_sharp (w, -.5 interbeam + vround interbeam);
163
164         pickup pencircle scaled stemwidth;
165
166         lft x5 = lft x6 = outer_space;
167         top y6 = vround (1.5 staff_space - .5 stem);
168         bot y5 = -top y6 + feta_space_shift;
169
170         labels (5, 6);
171
172         draw_gridline (z5, z6, stemwidth);
173
174         remember_pic := currentpicture;
175
176         draw_staff (-2, 2, 0);
177 fet_endchar;
178
179
180 draw_shifted_too;
181
182
183 fet_beginchar ("Sharp (3 beams)", "sharp.slashslashslash.stemstem");
184         save stem, stemx, stemwidth;
185         save outer_space, interbeam;
186         save sharp_beamheight;
187
188         sharp_beamheight# := 0.22 staff_space# + stafflinethickness#;
189
190
191         stemwidth# := stafflinethickness# + .05 staff_space#;
192         define_whole_blacker_pixels (stemwidth);
193
194         interbeam := 1.2 staff_space_rounded;
195
196         set_char_box (0, 1.1 staff_space#,
197                       1.5 staff_space#, 1.5 staff_space#);
198
199         stem := 7 / 16 * w;
200         stemx := hround stem;
201         outer_space := hround ((w - stemx - stemwidth) / 2);
202
203         w := 2 outer_space + stemx + stemwidth;
204         d := d - feta_space_shift;
205
206         draw_meta_sharp (.88 w, -.5 interbeam);
207         draw_meta_sharp (w, 0);
208         draw_meta_sharp (.88 w, -.5 interbeam + vround interbeam);
209
210         pickup pencircle scaled stemwidth;
211
212         lft x5 = lft x6 = outer_space;
213         lft x7 = lft x8 = outer_space + stemx;
214         bot y5 = -d;
215         top y6 = vround (1.5 staff_space - stem * beamslope);
216         bot y7 = -top y6 + feta_space_shift;
217         top y8 = h;
218
219         labels (5, 6, 7, 8);    
220
221         draw_gridline (z5, z6, stemwidth);
222         draw_gridline (z7, z8, stemwidth);
223
224         remember_pic := currentpicture;
225
226         draw_staff (-2, 2, 0);
227 fet_endchar;
228
229
230 draw_shifted_too;
231
232
233 fet_beginchar ("1/2 Sharp (3 beams)", "sharp.slashslashslash.stem");
234         save stem, stemx, stemwidth;
235         save outer_space, interbeam;
236         save sharp_beamheight;
237
238         sharp_beamheight# := 0.22 staff_space# + stafflinethickness#;
239
240         stemwidth# := stafflinethickness# + .05 staff_space#;
241         define_whole_blacker_pixels (stemwidth);
242
243         interbeam := 1.2 staff_space_rounded;
244
245         set_char_box (0, 0.95 staff_space#,
246                       1.3 staff_space#, 1.3 staff_space#);
247
248         stem := 7 / 16 * w;
249         outer_space := hround ((w - stemwidth) / 2);
250
251         w := 2 outer_space + stemwidth;
252         d := d - feta_space_shift;
253
254         draw_meta_sharp (.8 w, -.5 interbeam);
255         draw_meta_sharp (w, 0);
256         draw_meta_sharp (.8 w, -.5 interbeam + vround interbeam);
257
258         pickup pencircle scaled stemwidth;
259
260         lft x5 = lft x6 = outer_space;
261         top y6 = vround (1.5 staff_space - .5 stem);
262         bot y5 = -top y6 + feta_space_shift;
263         labels (5, 6);
264
265         draw_gridline (z5, z6, stemwidth);
266
267         remember_pic := currentpicture;
268
269         draw_staff (-2, 2, 0);
270 fet_endchar;
271
272
273 draw_shifted_too;
274
275
276 fet_beginchar ("3/4 Sharp", "sharp.slashslash.stemstemstem");
277         save stem, stemx, stemwidth;
278         save outer_space, interbeam;
279
280         stemwidth# := stafflinethickness# + .05 staff_space#;
281         define_whole_blacker_pixels (stemwidth);
282
283         interbeam := 1.05 staff_space_rounded;
284
285         set_char_box (0, 1.6 staff_space#,
286                       1.5 staff_space#, 1.5 staff_space#);
287
288         stem := 9 / 32 * w;
289         stemx := hround stem;
290         outer_space := hround ((w - 2 stemx - stemwidth) / 2);
291
292         w := 2 outer_space + 2 stemx + stemwidth;
293         d := d - feta_space_shift;
294
295         draw_meta_sharp (w, -.5 interbeam);
296         draw_meta_sharp (w, -.5 interbeam + vround interbeam);
297
298         pickup pencircle scaled stemwidth;
299
300         lft x5 = lft x6 = outer_space;
301         lft x7 = lft x8 = outer_space + stemx;
302         lft x9 = lft x10 = outer_space + 2 stemx;
303         bot y5 = -d;
304         top y6 = vround (1.5 staff_space - 2 stem * beamslope);
305         bot y9 = -top y6 + feta_space_shift;
306         top y10 = h;
307         y7 = .5 [y5, y9];
308         y8 = .5 [y6, y10];
309
310         labels (5, 6, 7, 8, 9, 10);
311
312         draw_gridline (z5, z6, stemwidth);
313         draw_gridline (z7, z8, stemwidth);
314         draw_gridline (z9, z10, stemwidth);
315
316         remember_pic := currentpicture;
317
318         draw_staff (-2, 2, 0);
319 fet_endchar;
320
321
322 draw_shifted_too;
323
324
325 %
326 % The stems of the natural are brushed (at least, in Barenreiter SCS)
327 %
328
329 fet_beginchar ("Natural", "natural");
330         save stemwidth, top_stem_thick;
331         save ne, pat_top, pat_bottom;
332         pair ne;
333         path pat_top, pat_bottom;
334
335         top_stem_thick# = stafflinethickness# + .10 staff_space#;
336         stemwidth# = 0.09 staff_space# + .5 stafflinethickness#;
337         define_whole_blacker_pixels (top_stem_thick, stemwidth);
338
339         set_char_box (0, 2/3 staff_space#,
340                       1.5 staff_space#, 1.5 staff_space#);
341
342         d := d - feta_space_shift;
343
344         pickup pencircle scaled stemwidth;
345
346         penpos1 (top_stem_thick, 0);
347         penpos3 (top_stem_thick, 0);
348         penpos2 (stemwidth, 0);
349         penpos4 (stemwidth, 0);
350
351         x2r = w;
352         x4l = 0;
353         x3 = x2;
354         x1 = x4;
355
356         y1 = h;
357         y3 = -d;
358         top y2 = vround (staff_space - 3/2 stafflinethickness);
359         y4 = -y2 + feta_space_shift;
360
361         pat_bottom := z4r{z4r - z1r}
362                       .. bot z4
363                       .. z4l{z1l - z4l};
364         fill simple_serif (z1l, z1r, -30)
365              -- pat_bottom
366              -- cycle;
367
368         pat_top := z2r{z2r - z3r}
369                    .. top z2
370                    .. z2l{z3l - z2l};
371         fill simple_serif (z3l, z3r, 30)
372              -- pat_top
373              -- cycle;
374
375         ne = (x2 - x4, stafflinethickness);
376
377         z11' = z3l + whatever * (z2l - z3l);
378         y11' = vround (.5 (staff_space - stafflinethickness));
379         z11 = z11' + whatever * ne;
380         x11 = x12;
381         z12 = directionpoint -ne of pat_top;
382         z13 = z12 + whatever * ne;
383         x13 = x1;
384         z14 = z11 + whatever * ne;
385         x14 = x1;
386
387         z21' = z4r + whatever * (z1r - z4r);
388         y21' = -y11' + feta_space_shift;
389         z21 = z21' + whatever * ne;
390         x21 = x22;
391         z22 = directionpoint -ne of pat_bottom;
392         z23 = z22 + whatever * ne;
393         x23 = x3;
394         z24 = z21 + whatever * ne;
395         x24 = x3;
396
397         fill z11
398              -- z12
399              -- z13
400              -- z14
401              -- cycle;
402         fill z21
403              -- z22
404              -- z23
405              -- z24
406              -- cycle;
407
408         penlabels (1, 2, 3, 4);
409         labels (11, 11', 12, 13, 14, 21, 21', 22, 23, 24);
410
411         remember_pic := currentpicture;
412
413         draw_staff (-2, 2, 0);
414 fet_endchar;
415
416
417 draw_shifted_too;
418
419
420 %
421 % Dedicated to my mom.    (3/10/97)
422 %
423 % Mamma, ik hou van je; kom je alsjeblieft terug?
424 %    -- HW
425 %
426 %
427 % TODO: remove crook_fatness
428 % TODO: document, simplify!
429 %
430
431 def draw_meta_flat (expr xcenter, w, crook_fatness) =
432         save crook_thinness;
433         save bottom_overshoot, bot_crook_dir;
434         save top_stem_thick, bottom_stem_thick, hair, smaller_hole;
435         save top_crook_thinness;
436         save zwiep;
437         save center;
438         pair center, bot_crook_dir;
439         save clearing;
440
441         clearxy;
442
443         % the stem shouldn't reach the top staff line.
444         %% TODO: should take from height.
445         %
446         % TODO: parameterize this
447         %
448         if w >= 0.75 staff_space:
449                 smaller_hole = 0.35 stafflinethickness;
450         else:
451                 smaller_hole = 0;
452         fi
453         clearing = 1.7 stafflinethickness;
454         crook_thinness = .7 stafflinethickness + .06 staff_space;
455         top_crook_thinness = 1 stafflinethickness + .065 staff_space;
456         bottom_overshoot = stafflinethickness;
457
458         bottom_stem_thick# = 0.06 staff_space# + 0.6 stafflinethickness#;
459         top_stem_thick# = 0.1 staff_space# + 1.2 stafflinethickness#;
460         define_whole_blacker_pixels (bottom_stem_thick, top_stem_thick);
461
462         if odd (top_stem_thick - bottom_stem_thick):
463                 top_stem_thick := top_stem_thick - 1;
464         fi;
465
466         center = (xcenter, 0);
467
468         x1l = hround (xcenter - .5 top_stem_thick);
469         y1 = vround (2 staff_space - clearing);
470         x2l = hround (xcenter - .5 bottom_stem_thick);
471         y2 = -.5 staff_space - .5 stafflinethickness;
472
473         penpos1 (top_stem_thick, 0);
474         penpos2 (bottom_stem_thick, 0);
475
476         y3l = vfloor ((staff_space - stafflinethickness) / 2);
477         z3l = whatever [z2r, z1r];
478         z3r = .3 [z2r, z1r] + (smaller_hole, 0);
479         x3r := hceiling x3r;
480
481         % we insert z3l to get better conversion with mf2pt1
482         fill simple_serif (z1r, z1l, 30)
483              -- z2l
484              -- z2r
485              -- z3l
486              -- cycle;
487
488         z10 = whatever [z2r, z1r] + (smaller_hole, 0);
489         y10 = -1/10 staff_space;
490         x10 := hceiling x10;
491
492         x11 = xcenter + bottom_overshoot / 3;
493         y11 = -vround (.5 (staff_space + stafflinethickness)
494                        + bottom_overshoot);
495
496         penpos4 (whatever, 53);
497
498         y4l - y4r = top_crook_thinness;
499         y5r = .15 staff_space;
500         x5l = hround (w + xcenter);
501         y4 = staff_space / 2;
502         x4r = .45 [x5r, x3r];
503         y4l := vround y4l;
504
505         penpos5 (crook_fatness, -175);
506
507         bot_crook_dir = unitvector ((x5l, 0) - z11);
508         z8 = z11 + whatever * bot_crook_dir;
509         y8 = -staff_space / 2;
510
511         z7 = z8
512              + whatever * bot_crook_dir
513              + crook_thinness * (bot_crook_dir rotated 90);
514         x7 = .1 [x3r, x8];
515
516         unfill z3r{z3r - z10}
517                .. z4r{right}
518                .. z5r{down}
519                .. z7{-bot_crook_dir}
520                & z7
521                .. z10{z3r - z10}
522                -- cycle;
523
524         fill z2l{down}
525              .. z11{right}
526              .. z8{bot_crook_dir}
527              .. z5l{up}
528              .. z4l{left}
529              .. z3l
530              -- cycle;
531 enddef;
532
533
534 %
535 % unfortunately, 600dpi is not enough to show the brush of the stem.
536 %
537
538 fet_beginchar ("Flat", "flat");
539         set_char_box (1.2 stafflinethickness#, .8 staff_space#,
540                       0.6 staff_space#, 1.9 staff_space#);
541
542         draw_meta_flat (0, w, 0.31 staff_space);
543         penlabels (range 0 thru 11);
544
545         remember_pic := currentpicture;
546
547         draw_staff (-2, 2, 0);
548 fet_endchar;
549
550
551 draw_shifted_too;
552
553
554 fet_beginchar ("Flat (slashed)", "flat.slash");
555         set_char_box (.4 staff_space#, .8 staff_space#,
556                       0.6 staff_space#, 1.9 staff_space#);
557
558         draw_meta_flat (0, w, 0.31 staff_space);
559
560         clearxy;
561
562         save slope, slash_width;
563         slope = 0.5;
564         slash_width = w;
565
566         z1 = (0, h / 2);
567         z2 = z1 - (slash_width, slash_width * slope) / 2;
568         z3 = z1 + (slash_width, slash_width * slope) / 2;
569
570         pickup pencircle scaled 1.5 stafflinethickness;
571         draw z2 .. z3;
572         labels (1, 2, 3);
573         remember_pic := currentpicture;
574
575         draw_staff (-2, 2, 0);
576 fet_endchar;
577
578
579 fet_beginchar ("Flat (slashed twice)", "flat.slashslash");
580         set_char_box (.4 staff_space#, .8 staff_space#,
581                       0.6 staff_space#, 1.9 staff_space#);
582
583         draw_meta_flat (0, w, 0.31 staff_space);
584
585         clearxy;
586
587         save slope, slash_width;
588         slope = 0.5;
589         slash_width = w;
590
591         z1 = (0, 5/12 h);
592         z2 = (0, 2/3 h);
593
594         pickup pencircle scaled 1.5 stafflinethickness;
595         draw z1 - (slash_width, slash_width * slope) / 2
596              .. z1 + (slash_width, slash_width * slope) / 2;
597         draw z2 - (slash_width, slash_width * slope) / 2
598              .. z2 + (slash_width, slash_width * slope) / 2;
599         labels (1, 2);
600         remember_pic := currentpicture;
601
602         draw_staff (-2, 2, 0);
603 fet_endchar;
604
605
606 fet_beginchar ("Flatflat (mirrored)", "mirroredflat.flat");
607         set_char_box (0, 1.6 staff_space#, 
608                       0.6 staff_space#, 1.9 staff_space#);
609
610         draw_meta_flat (0, w/2, 0.31 staff_space);
611         currentpicture := currentpicture xscaled -1;
612         draw_meta_flat (0, w/2, 0.31 staff_space);
613
614         currentpicture := currentpicture shifted (w/2, 0);
615         penlabels (range 0 thru 11);
616
617         remember_pic := currentpicture;
618
619         draw_staff (-2, 2, 0);
620 fet_endchar;
621
622
623 draw_shifted_too;
624
625
626 fet_beginchar ("Semi flat", "mirroredflat");
627         set_char_box (1.2 stafflinethickness#, .8 staff_space#,
628                       0.6 staff_space#, 1.9 staff_space#);
629
630         draw_meta_flat (0, w, 0.31 staff_space);
631         currentpicture := currentpicture xscaled -1 shifted (w - b, 0);
632 fet_endchar;
633
634
635 fet_beginchar ("Semi flat", "mirroredflat.backslash");
636         set_char_box (.4 staff_space#, .8 staff_space#,
637                       0.6 staff_space#, 1.9 staff_space#);
638
639         draw_meta_flat (0, w, 0.31 staff_space);
640
641         clearxy;
642
643         save slope, slash_width;
644         slope = 0.5;
645         slash_width = w;
646
647         z1 = (0, h / 2);
648         z2 = z1 - (slash_width, slash_width * slope) / 2;
649         z3 = z1 + (slash_width, slash_width * slope) / 2;
650
651         pickup pencircle scaled 1.5 stafflinethickness;
652         draw z2 .. z3;
653
654         currentpicture := currentpicture xscaled -1 shifted (w - b, 0);
655
656         labels (1, 2, 3);
657 fet_endchar;
658
659
660 fet_beginchar ("Double Flat", "flatflat");
661         save left_wid, overlap, right_wid;
662
663         left_wid = .7;
664         right_wid = .8;
665         overlap = .05;
666
667         set_char_box (1.2 stafflinethickness#,
668                       (left_wid + right_wid - overlap) * staff_space#,
669                       .6 staff_space#, 1.9 staff_space#);
670         draw_meta_flat (0, left_wid * staff_space, 1/3 staff_space);
671         draw_meta_flat (round ((left_wid - overlap) * staff_space),
672                         right_wid * staff_space, 0.33 staff_space);
673 fet_endchar;
674
675
676 fet_beginchar ("3/4 Flat", "flatflat.slash");
677         save left_wid, overlap, right_wid;
678
679         left_wid = .7;
680         right_wid = .8;
681         overlap = .05;
682
683         set_char_box (1.2 stafflinethickness#,
684                       (left_wid + right_wid - overlap) * staff_space#,
685                       .6 staff_space#, 1.9 staff_space#);
686         draw_meta_flat (0, left_wid * staff_space, 1/3 staff_space);
687         draw_meta_flat (round ((left_wid - overlap) * staff_space),
688                         right_wid * staff_space, 0.33 staff_space);
689
690         %% maybe we should clip part of the stems?
691         %% or make the 1st flat smaller?
692         %% or reverse it?
693         pickup pencircle scaled 2 stafflinethickness;
694
695         z12 = round (-.25 w - b, .55 staff_space) + feta_offset;
696         z13 = round (.75 w, 1.45 staff_space) + feta_offset;
697         penpos12 (2 stafflinethickness, angle (z13 - z12) - 90);
698         penpos13 (2 stafflinethickness, angle (z13 - z12) - 90);
699
700         z14 = z12 - stafflinethickness * unitvector (z13 - z12);
701         z15 = z13 + stafflinethickness * unitvector (z13 - z12);
702
703         fill z13r
704              .. z15
705              .. z13l
706              -- z12l
707              .. z14
708              .. z12 r
709              -- z13r
710              .. cycle;
711
712         penlabels (12, 13);
713         labels (14, 15);
714
715         remember_pic := currentpicture;
716
717         draw_staff (-2, 2, 0);
718 fet_endchar;
719
720
721 draw_shifted_too;
722
723
724 fet_beginchar ("Double Sharp", "doublesharp");
725         save klaverblad, klaversteel;
726         save pat;
727         path pat;
728
729         klaversteel = 1/15 staff_space;
730         klaverblad = .4 staff_space - .5 stafflinethickness;
731
732         set_char_box (0, staff_space#, .5 staff_space#, .5 staff_space#);
733
734         z1 = (klaversteel, 0);
735         z2 = (w / 2 - klaverblad / 10, h - klaverblad);
736         z3 = (w / 2, h);
737         z4 = z2 reflectedabout ((0, 0), (1, 1));
738         z5 = z1 reflectedabout ((0, 0), (1, 1));
739
740         labels (1, 2, 3, 4, 5);
741
742         pickup pencircle scaled blot_diameter;
743
744         x2 := hfloor (rt x2) - blot_diameter / 2;
745         x3 := hfloor (rt x3) - blot_diameter / 2;
746         y3 := vfloor (top y3) - blot_diameter / 2;
747         y4 := vfloor (top y4) - blot_diameter / 2;
748
749         pat = (rt z1){dir45}
750               .. {right}(bot z2)
751               .. rt z2
752               -- rt z3{z3 - z2}
753               .. top z3{z4 - z3}
754               -- top z4{z4 - z3}
755               .. (lft z4){down}
756               .. {dir 225}(top z5);
757         pat := pat
758                -- reverse pat xscaled -1 shifted (-feta_eps, 0);
759
760         % assure symmetry -- it's more important to center the glyph on the
761         % staff line than centering it between staff lines, so we use
762         % feta_shift, not feta_space_shift.
763         h := h + feta_shift;
764
765         fill pat shifted (0, feta_shift)
766              -- reverse pat yscaled -1 shifted (0, -feta_eps)
767              -- cycle;
768
769         % ugh
770         currentpicture := currentpicture shifted (hround (w / 2), 0);
771
772         remember_pic := currentpicture;
773
774         draw_staff (-2, 2, 0);
775 fet_endchar;
776
777
778 draw_shifted_too;
779
780
781 def draw_paren =
782         save leftindent;
783
784         leftindent := .2 staff_space;
785
786         set_char_box (0, .5 staff_space# + stafflinethickness#,
787                       staff_space#, staff_space#);
788
789         d := d - feta_shift;
790
791         z1 = (leftindent, h);
792         z2 = (w - stafflinethickness, .5 (h - d));
793         z3 = (leftindent, -d);
794
795         penpos1 (stafflinethickness, 35);
796         penpos2 (.1 staff_space + stafflinethickness, 0);
797         penpos3 (stafflinethickness, -35);
798
799         fill z2l{down}
800              .. simple_serif (z3l, z3r, 90)
801              .. z2r{up}
802              .. simple_serif (z1r, z1l, 90)
803              .. z2l{down}
804              -- cycle;
805 enddef;
806
807
808 fet_beginchar ("Right Parenthesis", "rightparen");
809         draw_paren;
810         penlabels (1, 2, 3);
811
812         remember_pic := currentpicture;
813
814         draw_staff (-2, 2, 0);
815 fet_endchar;
816
817
818 draw_shifted_too;
819
820
821 fet_beginchar ("Left Parenthesis", "leftparen");
822         draw_paren;
823
824         currentpicture := currentpicture xscaled -1;
825
826         set_char_box (charwd, charbp, chardp, charht);
827 fet_endchar;
828
829 fet_endgroup ("accidentals");