+def draw_tenor_extension (expr reduction) =
+ save reduced_ss, thick, thin, upper_stroke, ne_beam_dir, nw_dist;
+ path upper_stroke;
+ pair ne_beam_dir, nw_dist;
+
+ reduced_ss# = staff_space# * reduction;
+ define_pixels (reduced_ss);
+
+ thin := hround (0.17 reduced_ss);
+ thick := hround (0.51 reduced_ss);
+
+ % the slanted left edge should protrude the g clef by a
+ % fixed amount relative to the width of the g clef:
+ x1'' = x6'' - 1.8 reduced_ss - 0.5 staff_space = 0.62 reduced_ss * reduction;
+ x8'' = x1'' - 2 thin;
+ x2'' = x3'' = x4'' = x6'' - thin;
+ x5'' = x6'';
+ x7'' = x6'' - 1/3 thin;
+ % the thick part of the c clef should be placed in the
+ % center of the forth staff space
+ y1'' = y2'' = 2.5 staff_space + thick/2;
+ y7'' = y8'' = y6'' - 1/3 thin = y1'' - thick;
+ y5'' = y3'' = y2'' + reduced_ss;
+ y4'' = 4.5 reduced_ss;
+
+ upper_stroke := z2''
+ -- new_bulb (z3'', 90, z4'', z5'', 270,
+ 0.35 reduced_ss, 0.22 reduced_ss, thin, 1, -1)
+ -- z6''{down} .. z7''{left};
+
+ % z1'' and z8'' are helper points that are responsible for
+ % hiding the lower left slant in the g clef's stroke
+ % z9'' and z10'' are computed to obtain nice rounded corners
+
+ pickup pencircle scaled 2/3 thin;
+ lft x9'' = x1'';
+ lft x10'' = x8'';
+
+ top y9'' = y1'';
+ bot y10'' = y8'';
+
+ ne_beam_dir = unitvector (z9'' - z10'');
+ nw_dist = (ne_beam_dir rotated 90) * 1/3 thin;
+
+ fill (z9''+nw_dist){ne_beam_dir}
+ ... top z9''{right}
+ -- upper_stroke
+ -- bot z10''{left}
+ ... (z10''+nw_dist){ne_beam_dir}
+ -- cycle;
+
+ % the slanted edge of the lower hook must not be visible, so it is
+ % shifted accordingly in x direction;
+ z1''' = z1'' shifted (staff_space - 0.9 reduced_ss, - staff_space);
+ z8''' = z8'' shifted (staff_space - 0.9 reduced_ss, - staff_space);
+
+ % the visible c clef parts should be symmetrical to the forth staff line
+ fill z1'''
+ -- reverse upper_stroke yscaled -1 shifted (0, 4 staff_space)
+ -- z8''' -- cycle;
+
+ penlabels (1''',2'',3'',4'',5'',6'',7'',8''',9'',10'');
+
+ draw_staff_if_debugging (-1, 3);
+enddef;
+
+fet_beginchar ("Tenor G clef", "tenorG");
+ draw_gclef (1.0, 0, 0.75);
+ draw_tenor_extension (1.0);
+fet_endchar;
+
+
+fet_beginchar ("Tenor G clef", "tenorG_change");
+ draw_gclef (0.8, 0, 0.75);
+ draw_tenor_extension (0.8);
+fet_endchar;