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