% source file of the Feta (defintively not an abbreviation for Font-En-Tja)
% music font
%
-% (c) 1997--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
+% (c) 1997--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
% Jan Nieuwenhuizen <janneke@gnu.org>
%
pickup pencircle scaled dot_size;
x1 - 2 x6 = x2;
+ x6 := vround (x6);
bot y6 = -d;
drawdot z6;
pickup pencircle scaled vround (0.5 rthin);
bot z10 = (0.5 w, 0);
- lft z11 = (-0.3 w, 0.8 h);
- rt z12 = (1.3 w, 0.8 h);
+ lft z11 = (0.5 w - hround (0.8 w), 0.8 h);
+ rt z12 = (0.5 w + hround (0.8 w), 0.8 h);
before_left := z1l
-- z6{z6 - z1l}
input feta-slag;
-% railroad tracks.
%
-% I actually have no clue how they should look, so we use a slightly curvy
-% and tapered shape.
+% Railroad tracks. We define two variants of these -- both as slightly
+% tapered, comma-shaped curves and as two straight parallel slashes.
%
-fet_beginchar ("Caesura", "caesura");
+fet_beginchar ("Curved caesura", "caesura.curved");
save slant, space_between, clearance;
save alpha, pat;
save botthick, topthick;
fet_endchar;
+fet_beginchar ("Straight caesura", "caesura.straight");
+ save slant, space_between, clearance;
+ save thick, ne, pat;
+ path pat;
+ pair ne;
+
+ slant = 2.0;
+ thick = 2.88 linethickness;
+
+ space_between# = 0.56 staff_space#;
+ clearance# = 0.2 staff_space#;
+
+ set_char_box (0, 2.0 staff_space#,
+ staff_space# - clearance#, 1.2 staff_space#);
+ define_whole_pixels (space_between);
+
+ x1 = 0;
+ x2 = x1 + thick;
+ y1 = y2 = -d;
+
+ x3 = x4 + thick;
+ x4 = x1 + (h + d) / slant;
+ y3 = y4 = h;
+
+ ne = unitvector (z4 - z1);
+
+ z1a = z1 + blot_diameter * ne;
+ z1b = z1 + blot_diameter * right;
+ z2a = z2 + blot_diameter * ne;
+ z2b = z2 + blot_diameter * left;
+
+ z3a = z3 - blot_diameter * ne;
+ z3b = z3 + blot_diameter * left;
+ z4a = z4 - blot_diameter * ne;
+ z4b = z4 + blot_diameter * right;
+
+ pat = z1a{-ne}
+ .. {right}z1b
+ -- z2b{right}
+ .. {ne}z2a
+ -- z3a{ne}
+ .. {left}z3b
+ -- z4b{left}
+ .. {-ne}z4a
+ -- cycle;
+
+ fill pat;
+ fill pat shifted (space_between, 0);
+
+ labels(range 1 thru 4);
+ labels(1a, 1b, 2a, 2b, 3a, 3b, 4a, 4b);
+fet_endchar;
+
+
+fet_beginchar ("snap pizzicato (Bartok pizzicato)", "snappizzicato");
+ save height, width, thickness, superness;
+
+ height# = 4/15 staffsize#;
+ width# = height#;
+ thickness# = 1.3 linethickness#;
+ define_pixels (height, width);
+ define_whole_blacker_pixels (thickness);
+
+ set_char_box (width# / 2, width# / 2, height# / 2, height# * 3 / 4);
+
+ penpos1 (thickness, 90);
+ penpos2 (thickness, 180);
+ penpos3 (thickness, 270);
+ penpos4 (thickness, 0);
+
+ x1 = 0;
+ y1r = height / 2;
+ x3 = x1;
+ y3r = -y1r;
+ x4r = width / 2;
+ y4 = 0;
+ x2r = -x4r;
+ y2 = y4;
+
+ penlabels (1, 2, 3, 4);
+
+ % mf doesn't handle pixel dropouts in outline objects, so we use
+ % `draw' if not called by mpost
+ if known miterlimit:
+ penstroke z1e
+ .. z2e
+ .. z3e
+ .. z4e
+ .. cycle;
+ else:
+ pickup pencircle scaled thickness;
+ draw z1
+ .. z2
+ .. z3
+ .. z4
+ .. cycle;
+ fi;
+
+ z5 = (0, 0);
+ z6 = (x5, 1.5 y1r);
+
+ draw_gridline (z5, z6, thickness);
+
+ labels (5, 6);
+fet_endchar;
+
fet_endgroup ("scripts");