+
+def draw_half_circle (expr diam) =
+ save diameter, thick;
+
+ diameter# = diam;
+
+ define_pixels (diameter);
+
+ thick = 0.6 linethickness;
+
+ penpos1 (thick, 0);
+ penpos2 (thick, -90);
+ penpos3 (thick, -180);
+
+ z1r = (diameter / 2, 0);
+ z2r = (0, -diameter / 2);
+ z3r = (-diameter / 2, 0);
+
+ penstroke z1e{down}
+ .. z2e{left}
+ .. z3e{up};
+enddef;
+
+
+fet_beginchar ("half circle", "usemicirculus");
+ draw_half_circle (5/16 staff_space#);
+
+ currentpicture := currentpicture yscaled -1;
+
+ set_char_box (diameter# / 2, diameter# / 2,
+ 0, diameter# / 2);
+fet_endchar;
+
+
+fet_beginchar ("half circle", "dsemicirculus");
+ draw_half_circle (5/16 staff_space#);
+
+ set_char_box (diameter# / 2, diameter# / 2,
+ diameter# / 2, 0);
+
+ penlabels (1, 2, 3);
+fet_endchar;
+
+
+fet_beginchar ("circle", "circulus");
+ save diameter, thick;
+
+ diameter# = 5/16 staff_space#;
+
+ define_pixels (diameter);
+
+ thick = 0.6 linethickness;
+
+ fill fullcircle scaled diameter;
+ unfill fullcircle scaled (diameter - 2 thick);
+
+ set_char_box (diameter# / 2, diameter# / 2,
+ diameter# / 2, diameter# / 2);
+fet_endchar;
+
+
+fet_beginchar ("augmentum", "augmentum");
+ save diameter;
+
+ diameter# = 0.25 staff_space#;
+
+ define_pixels (diameter);
+
+ pickup pencircle scaled diameter;
+
+ drawdot (0, 0);
+
+ set_char_box (diameter# / 2, diameter# / 2,
+ diameter# / 2, diameter# / 2);
+fet_endchar;
+
+
+def draw_signum_congruentiae =
+ set_char_box (0.50 staff_space# + 1.5 linethickness#,
+ 0.50 staff_space# + 1.5 linethickness#,
+ 2.5 linethickness#,
+ 2.00 staff_space# + 3.5 linethickness#);
+
+ save ellipse, pat;
+ path ellipse, pat;
+
+ ellipse := fullcircle xscaled 1.0 linethickness
+ yscaled 5.0 linethickness
+ rotated -35;
+
+ z1 = (+0.50 staff_space, +2.00 staff_space);
+ z2 = (+0.00 staff_space, +2.00 staff_space);
+ z3 = (-0.50 staff_space, +1.50 staff_space);
+ z4 = (-0.25 staff_space, +1.00 staff_space);
+ z5 = (+0.10 staff_space, +0.80 staff_space);
+ z6 = (+0.00 staff_space, +0.00 staff_space);
+
+ pat := z1{-1, +1}
+ .. z2
+ .. z3
+ .. z4
+ .. z5
+ .. z6;
+
+ % we avoid cusps originally present in `draw pat'
+ fill get_subpath (ellipse,
+ -direction 0 of pat, direction 0 of pat, z1)
+ .. get_subpoint (ellipse, direction 1 of pat, z2)
+ {direction 1 of pat}
+ .. get_subpoint (ellipse, direction 2 of pat, z3)
+ {direction 2 of pat}
+ .. get_subpoint (ellipse, direction 3 of pat, z4)
+ {direction 3 of pat}
+ .. get_subpoint (ellipse, direction 4 of pat, z5)
+ {direction 4 of pat}
+ .. get_subpath (ellipse,
+ direction 4.8 of pat, -direction 5 of pat, z6)
+ .. get_subpoint (ellipse, -direction 4 of pat, z5)
+ {-direction 4 of pat}
+ .. get_subpoint (ellipse, -direction 3 of pat, z4)
+ {-direction 3 of pat}
+ .. get_subpoint (ellipse, -direction 2.5 of pat, point 2.5 of pat)
+ .. get_subpoint (ellipse, -direction 1 of pat, z2)
+ {-direction 1 of pat}
+ .. cycle;
+
+ pickup pencircle scaled 3.0 linethickness;
+
+ z7 = (-0.5 staff_space, +0.0 staff_space);
+ z8 = (+0.5 staff_space, +0.0 staff_space);
+
+ drawdot z7;
+ drawdot z8;
+enddef;
+
+
+fet_beginchar ("signum congruentiae up", "usignumcongruentiae");
+ draw_signum_congruentiae;
+ labels (1, 2, 3, 4, 5, 6, 7, 8);
+fet_endchar;
+
+
+fet_beginchar ("signum congruentiae down", "dsignumcongruentiae");
+ draw_signum_congruentiae;
+ xy_mirror_char;
+fet_endchar;
+
+
+%%%%%%%%%%%%%
+%%%%
+%%%% Code for Kievan Notation
+%%%%
+%%%%%%%%%%%%%
+
+
+fet_beginchar ("Kievan end of piece (slash)", "barline.kievan");
+ % This draws the end of piece figure.
+ % This figure is placed at the end of the musical piece,
+ % after the staff.
+
+ save hair_thickness, thick_thickness, width, depth, height, padding;
+ hair# = 1.9 linethickness#;
+ thick# = 6.0 linethickness#;
+ width# = 1.0 staff_space#;
+ height# + depth# = 4 staff_space#;
+ depth# = height# + hair#;
+ padding# = .2 staff_space#;
+
+ set_char_box (0, width# + 3 padding#, depth#, height# + staff_space#);
+ define_pixels (hair, thick, width, padding, depth, height);
+
+ x7r - x2l = width;
+ y1 - y3r = depth + height + linethickness / 2;
+ z3 = z2;
+ z4 = .5 [z1, z2]
+ = (width / 2 + padding, hair / 8);
+ z5 = (x2 - .17 staff_space, 9/10 [y2, y1]);
+ z7 - z6 = (.5 staff_space, -.2 staff_space);
+ .4 [z6, z7] = 7/6 [z2, z1];
+
+ penpos1 (hair, 0);
+ penpos2 (hair, 0);
+ penpos3 (hair, -90);
+ penpos4 (thick, 10);
+ penpos5 (thick, 35);
+ penpos6 (hair, -90);
+ penpos7 (.5 thick, -120);
+
+ penlabels (1, 2, 3, 4, 5, 6, 7);
+
+ penstroke z1e
+ -- z2e;
+
+ fill z3l
+ -- z2l{z2 - z1}
+ .. z3r{right}
+ .. z4r
+ .. z5r
+ .. z6r
+ .. simple_serif (z7r, z7l, 80)
+ .. {left}z6l
+ .. z5l
+ .. z4l
+ .. {left}cycle;
+fet_endchar;
+
+fet_endgroup ("scripts");