+
+ t3 = find_envelope_cusp (reverse ellipse,
+ subpath (2, 4 - epsilon) of paths2,
+ 1/256) + 2;
+ if t3 < 2:
+ t3 := 3;
+ t4 := 3;
+ else:
+ t4 = find_envelope_cusp (ellipse,
+ subpath (1 + epsilon, 3)
+ of reverse paths2,
+ 1/256) + 1;
+ t4 := length paths2 - t4;
+ fi;
+
+ fill subpath (times1 + s / 4, times13) of sub_outlines1
+ -- subpath (times31, infinity) of sub_outlines3
+ & subpath (0, times42) of sub_outlines4
+ -- subpath (times24, infinity) of sub_outlines2
+ & subpath (0, times34) of sub_outlines3
+ -- subpath (times43, times4 - s / 4) of sub_outlines4
+ -- cycle;
+ unfill subpath (times12, infinity) of sub_outlines1
+ & subpath (0, times21) of sub_outlines2
+ -- cycle;
+ fill subpath (times4 + s / 4, infinity) of sub_outlines4
+ & subpath (0, times1 - s / 4) of sub_outlines1
+ -- cycle;
+
+
+ % we approximate `draw paths2'
+ for i = 1 step s until (length paths2 - s):
+ dirs[i + 20] := direction (i - 1) of paths2;
+ endfor;
+
+ sub_outlines21 := get_subpath (ellipse, -dirs21, dirs21, z21)
+ for i = (1 + s) step s until (length paths2 - s):
+ .. get_subpoint (ellipse, dirs[i + 20],
+ point (i - 1) of paths2)
+ endfor
+ .. get_subpath (ellipse, up, z26 - z25, z25);
+ sub_outlines22 := get_subpath (ellipse, z26 - z25, z25 - z26, z26)
+ -- get_subpoint (ellipse, z25 - z26, z25);
+ sub_outlines23 := get_subpoint (ellipse, down, z25)
+ for i = (length paths2 - s) step -s until (t4 + 1):
+ .. get_subpoint (ellipse, -dirs[i + 20],
+ point (i - 1) of paths2)
+ endfor
+ .. get_subpoint (ellipse, -direction t4 of paths2,
+ point t4 of paths2);
+ sub_outlines24 := get_subpoint (ellipse, -direction t3 of paths2,
+ point t3 of paths2)
+ for i = (floor (t3 / s) * s + 1) step -s until (t2 + 1):
+ .. get_subpoint (ellipse, -dirs[i + 20],
+ point (i - 1) of paths2)
+ endfor
+ .. get_subpoint (ellipse, -direction t2 of paths2,
+ point t2 of paths2);
+ sub_outlines25 := get_subpoint (ellipse, -direction t1 of paths2,
+ point t1 of paths2)
+ for i = (floor (t1 / s) * s + 1) step -s until (1 + s):
+ .. get_subpoint (ellipse, -dirs[i + 20],
+ point (i - 1) of paths2)
+ endfor;
+
+ (times2223, times2322) = sub_outlines22 intersectiontimes sub_outlines23;
+ (times2324, times2423) = sub_outlines23 intersectiontimes sub_outlines24;
+ (times2425, times2524) = sub_outlines24 intersectiontimes sub_outlines25;
+
+ fill sub_outlines21
+ -- subpath (0, times2223) of sub_outlines22
+ -- subpath (times2322, times2324) of sub_outlines23
+ -- subpath (times2423, times2425) of sub_outlines24
+ -- subpath (times2524, infinity) of sub_outlines25
+ .. cycle;
+
+ labels (1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
+ labels (21, 22, 23, 24, 25, 26);
+enddef;
+
+
+fet_beginchar ("petrucci g clef", "petrucci.g");
+ draw_staff_if_debugging (-1, 3);
+ draw_petrucci_g_clef ((0, 0), 1.0);
+fet_endchar;
+
+
+fet_beginchar ("petrucci g clef", "petrucci.g_change");
+ draw_petrucci_g_clef ((0, 0), .8);
+fet_endchar;
+
+
+def draw_mensural_g_clef (expr exact_center, reduction) =
+ % TODO: Rewrite me. The former mensural g clef looked ugly, and the
+ % code was removed when it broke for small font sizes after some
+ % global changes in the font. Currently, the character is mapped to
+ % a copy of the petrucci g clef (which, after all, *is* a mensural g
+ % clef, but not the one that we have in mind here). -- jr
+ %
+ % Possible sources of inspiration for this clef include: Francisco
+ % Guerrero, "Lib. 1. Missarum" (1566), in: MGG, volume 3, col. 858
+ % ("Ducis"); Stefano Fabri, "Quam speciosa veteranis" (1611), in:
+ % MGG, volume 3, col. 1698 ("Fabri"); Philippus Dulichius,
+ % "Fasciculus novus ..." (1598), in: MGG, volume 3, col. 919
+ % ("Dulichius"), fig. 1; Noe Faignient, "Ic sal de Heer myn God
+ % gebenedye" (1568), in: MGG, volume 3, col. 1735 ("Faignient").
+enddef;
+
+
+%
+% FIXME: This clef is preliminarily mapped to the petrucci g clef
+% until the code for the mensural g clef will be rewritten.
+%
+fet_beginchar ("mensural g clef", "mensural.g");
+ draw_staff_if_debugging (-1, 3);
+ draw_petrucci_g_clef ((0, 0), 1.0);