% source file of the Feta (defintively not an abbreviation for Font-En-Tja)
% music font
%
-% (c) 1997 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+% (c) 1997--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
% Jan Nieuwenhuizen <janneke@gnu.org>
%
y_mirror_char;
fet_endchar;
+def draw_short_fermata =
+ save fat_factor, thinness, dot_radius;
+ set_char_box(staff_space#, staff_space#, 0, 2.2 staff_space#);
+ dot_radius# = 8/3*stafflinethickness#;
+ define_pixels(dot_radius)
+
+ fat_factor = .11;
+ thinness = 1.5 stafflinethickness;
+
+ pickup pencircle scaled thinness;
+ rt x2 = w;
+ lft x5 = -b;
+ bot y5 = 0;
+ top y3 = h;
+ y1 = y2 = y5;
+
+ x3 = 0;
+ z1 - z4 = whatever * (charwd, -charht);
+ z4 = fat_factor [z3, z5];
+
+ filldraw z1 -- z2 -- z3 -- z4 -- cycle;
+ draw z3 .. z5;
+
+ pickup pencircle scaled 2dot_radius;
+ x1 - 2x6 = x2;
+ bot y6 = -d;
+ drawdot z6;
+enddef;
+
+fet_beginchar("short fermata up", "ushortfermata", "ushortfermata")
+ draw_short_fermata;
+fet_endchar;
+
+fet_beginchar("short fermata down", "dshortfermata", "dshortfermata")
+ draw_short_fermata;
+ xy_mirror_char;
+fet_endchar;
+
+def draw_long_fermata =
+ save stemthick, beamheight, dot_radius, wd;
+ define_pixels(wd, dot_radius)
+
+ wd# = 2.5 staff_space#;
+ stemthick = 1.5 stafflinethickness;
+ beamheight = 4 stafflinethickness;
+ dot_radius# = 8/3*stafflinethickness#;
+ set_char_box(wd#/2, wd#/2, 0, 3/2 staff_space#);
+
+ draw_rounded_block((-b, h-beamheight), (w, h), blot_diameter);
+ draw_rounded_block((-b, -d),(-b+stemthick, h-stemthick), stemthick);
+ addto currentpicture also currentpicture xscaled -1;
+
+ pickup pencircle scaled 2dot_radius;
+ x4 = 0;
+ bot y4 = -d;
+ drawdot z4;
+enddef;
+
+fet_beginchar("long fermata up", "ulongfermata", "ulongfermata")
+ draw_long_fermata;
+fet_endchar;
+
+fet_beginchar("long fermata down", "dlongfermata", "dlongfermata")
+ draw_long_fermata;
+ y_mirror_char;
+fet_endchar;
+
+def draw_very_long_fermata =
+ save ibeamheight, obeamheight;
+ save ihwd, ohwd, iht, oht; % inner/outer half_width/height
+ save stemthick, dot_radius;
+ define_pixels(ihwd, ohwd, iht, oht, dot_radius)
+
+ ihwd# = 1.0 staff_space#;
+ ohwd# = 1.5 staff_space#;
+ iht# = 0.9 staff_space#;
+ oht# = 1.6 staff_space#;
+ stemthick = 1.5 stafflinethickness;
+ ibeamheight = 3 stafflinethickness;
+ obeamheight = 5 stafflinethickness;
+ dot_radius# = 8/3*stafflinethickness#;
+ set_char_box(ohwd#, ohwd#, 0, oht#);
+
+ draw_rounded_block((-ohwd, oht-obeamheight), (ohwd, oht), blot_diameter);
+ draw_rounded_block((-ohwd, 0),(-ohwd+stemthick, ohwd-stemthick), stemthick);
+ draw_rounded_block((-ihwd, iht-ibeamheight), (ihwd, iht), blot_diameter);
+ draw_rounded_block((-ihwd, 0),(-ihwd+stemthick, ihwd-stemthick), stemthick);
+ addto currentpicture also currentpicture xscaled -1;
+
+ pickup pencircle scaled 2dot_radius;
+ x4 = 0;
+ bot y4 = -d;
+ drawdot z4;
+enddef;
+
+fet_beginchar("very long fermata up", "uverylongfermata", "uverylongfermata")
+ draw_very_long_fermata;
+fet_endchar;
+
+fet_beginchar("very long fermata down", "dverylongfermata", "dverylongfermata")
+ draw_very_long_fermata;
+ y_mirror_char;
+fet_endchar;
+
%
% Thumbs are used in cello music.
% TODO : thumbs should look like the finger-font and should be placed in
labels(4);
fet_endchar;
-% Hmm, changed 1.5 to 1.4 to avoid problems with "random" placement of
-% the dots because of quantization effects for almost integer values. /MB
-
-
-%
-% Hmm. Should not meddle with darkness of font. Check out the
-% correct value for radius. Maybe we'd better change padding --hwn
-%
fet_beginchar("staccato dot", "staccato", "staccato")
save radius;
- radius# = 1.4 stafflinethickness#;
+ radius# = 0.20 * staff_space#;
define_whole_pixels(radius);
pickup pencircle scaled 2 radius;
drawdot (0,0);
draw_staccatissimo;
fet_endchar;
-%
-% FIXEM: scale labels too.
-%
fet_beginchar("staccatissimo/martellato down", "dstaccatissimo", "dstaccatissimo")
draw_staccatissimo;
y_mirror_char;
fet_beginchar("portato/single tenuto", "tenuto", "tenuto")
save thick;
- thick# = 1.4 stafflinethickness#;
+ thick# = 1.6 stafflinethickness#;
define_whole_pixels(thick);
set_char_box(.6 staff_space#, .6 staff_space#, thick#/2,thick#/2);
draw_rounded_block((-b,-thick/2),(w,thick/2),thick);
fet_endchar;
-
-%
-% Portato by Heikki Junes <heikki.junes@hut.fi>
-%
-
def draw_portato =
save thick, radius;
thick# = 1.4 stafflinethickness#;
% The down marcato char (not very much used).
% Contrary to what some MF/TeX `gurus' believe
% it is *point*-symmetric with the "up" version
+%
fet_beginchar("marcato down", "dmarcato", "dmarcato")
draw_marcato;
xy_mirror_char;
addto currentpicture also currentpicture rotated 90;
fet_endchar;
+
%
-% FIXME: blotting
+% A vee with tapered insides to prevent visual blotting
%
-fet_beginchar("Upbow", "upbow", "upbow")
- save ht, wd, thick;
- thick = 1.4 stafflinethickness;
- wd# = 1.3 staff_space#;
- ht# = 1.6 wd#;
+def draw_vee (expr width, height, thickness) =
+begingroup
+ save diminish;
-
- set_char_box(wd#/2, wd#/2, 0, ht#);
- pickup pencircle scaled thick;
+ diminish = 0.75;
+ pickup pencircle scaled thickness;
+
x1 = 0;
bot y1 = 0;
rt x2 = w;
top y2 = h;
+ z3 = 0.6 [z2, z1];
+ penpos3(thickness, 0);
+ penpos4(thickness * diminish, 0);
+ x4r = thickness/2;
+ y4 = thickness/2;
labels(1,2);
- draw z2 -- z1 -- (z2 xscaled -1);
+ penlabels(3,4);
+
+ draw z1;
+ draw z3 -- z2;
+ penstroke z3e .. z4e;
+ addto currentpicture also currentpicture xscaled -1;
+endgroup;
+enddef;
+
+fet_beginchar("Upbow", "upbow", "upbow")
+ save ht, wd, thick, diminish;
+
+ thick = 1.4 stafflinethickness;
+ wd# = 1.3 staff_space#;
+ ht# = 1.6 wd#;
+ set_char_box(wd#/2, wd#/2, 0, ht#);
+ draw_vee (wd, ht, thick);
fet_endchar;
ascender_extra# = 1/2 ex#;
ascender# = ascender_extra# + ex#;
ex# = 1.4 staff_space#;
- kerning# = .550 ex#;
+ kerning# = .60 ex#;
start_nib_angle = 20;
- bulb_size = 0.55;
+ bulb_size = 0.70;
define_pixels(ex, ascender_extra, ascender, kerning);
t_overshoot = 0.03 ex;
fatness = 12/40 ex;
- t_fatness = 0.780 fatness;
- t_width = 1.8 t_fatness;
- r_fatness = 0.75 fatness;
- uitschieter = 0.43 ex;
+ t_fatness = 0.78 fatness;
+ t_width = 1.9 t_fatness;
+ r_fatness = 0.78 fatness;
+ uitschieter = 0.48 ex;
hair_thick = blot_diameter;
-
+ r_flare = 0.45 r_fatness;
+ r_width = 2 r_fatness + 0.25 kerning;
slant = .2;
+
% slant = .0;
local_copy(transform)(currenttransform);
currenttransform := currenttransform slanted slant shifted (- staff_space, 0) ;
y1 = ascender;
- x1l = 0;
- x1r = t_fatness;
+
+ % try to position in such a way that the center is the visual
+ % center
+
+ x1l = 0.2 staff_space;
+ x1r - x1l = t_fatness;
penpos1(start_nib_wid, start_nib_angle);
z2 = (x1, 7/18 ex);
penpos2(start_nib_wid, start_nib_angle);
- z3l = (0.5 t_width, - t_overshoot);
+ z3l = (x2l + 0.5 t_width, - t_overshoot);
- z4l = (t_width, 0.23 ex);
+ z4l = (x2l + t_width, 0.23 ex);
penpos4(whatever, 200);
x4l - x4r = hair_thick;
save t_p, krul_p;
path t_p, krul_p, r_p;
- z5 = (t_fatness/2, 2/3 ex);
+ z5 = (x2l + t_fatness/2, 2/3 ex);
% penpos5(hair_thick, );
- t_p := simple_serif (z1r, z1l, -40) -- z2l {down}
+ t_p := z1r{dir (angle(z1l-z1r) + 30)} .. z1l{-dir (angle(z1r-z1l) - 45)}
+ -- z2l {down}
.. tension (1 + .5 slant)
.. z3l{right}
pickup pencircle scaled hair_thick;
- lft x6 = - uitschieter;
+ lft x6 = x2l - uitschieter;
y6 = y5 ; % - 1/20 ex;
z7 = z5 + whatever*dir krul_ang;
set_char_box(.85 staff_space# , .85 staff_space#, 0,ascender#);
- penpos11(1/4 r_fatness, -20);
+ penpos11(1/4 r_fatness, -4);
z11r = z9r;
- z13 = (x9 + 1.9 r_fatness, y11 - stafflinethickness );
- penpos13(0.45 r_fatness, 170);
+ z13l = (x9l + r_width, y11 - stafflinethickness );
+ penpos13(r_flare, 180);
z15 = z13r - (bulb_size * r_fatness,0);
z14 = 0.5 [z13l, z15] - (0,bulb_size* r_fatness);
z16 = 0.5 [z13l, z15] + (0,bulb_size* r_fatness);
- fill z11r{dir 70} .. tension 0.94 .. z13r{down} -- z15{down}
- .. tension 0.97 .. z13l{up}
- .. z11l{dir 250} -- cycle;
+ fill z11r{up} .. tension 0.94 .. z13r{down} -- z15{down}
+ .. tension 1.0 .. z13l{up}
+ .. z11l{down} -- cycle;
- fill z15{up} .. tension 1.1 .. z13l{down} .. z14 .. cycle;
+ fill z15{up} .. tension 1.06 .. z13l{down} .. z14 .. cycle;
set_char_box(wd#, wd#, 0, ht#);
-
- pickup pencircle scaled thickness;
- lft x1 = -b;
- bot y1 = 0;
- x2 =0;
- top y2 = h;
- z3 = z1 xscaled -1;
-
-
- draw z1 -- z2 -- z3;
-
+ draw_vee (wd, ht, thickness);
enddef;
fet_beginchar("left toe", "upedaltoe", "upedaltoe")
fet_endchar;
+fet_beginchar("Varied Coda", "varcoda", "varcoda")
+ save thin, thick, codawidth, codaheight;
+ thin# = 1.2 stafflinethickness#;
+ thick# = 3.5 stafflinethickness#;
+ codawidth# = 2/3 staff_space#;
+ codaheight# = 1 staff_space#;
+ define_pixels(thin, thick, codawidth, codaheight);
+
+ set_char_box(codawidth#+thick#, codawidth#+thick#,
+ codaheight#+thick#, codaheight#+thick#);
+
+ x1 = -codawidth;
+ y1 = y2 - thin;
+ x2 = 0;
+ y2 = codaheight;
+ draw_rounded_block(z1, z2, thick);
+
+ x3 = x1;
+ y3 = -blot_diameter;
+ x4 = x1 + thick;
+ y4 = y2;
+ draw_rounded_block(z3, z4, thick);
+
+ addto currentpicture also currentpicture xscaled -1;
+ addto currentpicture also currentpicture yscaled -1;
+
+ draw_gridline((0,-h),(0,h),thin);
+ draw_gridline((-w,0),(w,0),thin);
+fet_endchar;
+
def draw_comma =
save alpha, thick, thin, ht;
alpha:=35;
xy_mirror_char;
fet_endchar;
+def draw_varcomma =
+ save thick, thin, ht, wd, alpha;
+ alpha:=35;
+ thin# = 1.2 stafflinethickness#;
+ thick# = 3 stafflinethickness#;
+ ht# = .6 staff_space#;
+ wd# = .25 staff_space#;
+ define_pixels(thin, thick, ht, alpha);
+ set_char_box(wd#, wd#, ht#, ht#);
+ z1 = (-b, -d);
+ z2 = (w, h);
+ draw_brush(z1, thin, z2, thick);
+enddef;
+
+fet_beginchar("Right Varied Comma","rvarcomma","rvarcomma");
+ draw_varcomma;
+fet_endchar;
+
+fet_beginchar("Left Varied Comma","lvarcomma","lvarcomma");
+ draw_varcomma;
+ xy_mirror_char;
+fet_endchar;
+
thick#:=1/24designsize;
define_blacker_pixels(thick);
% Extendable Trill symbol.
% Not yet used
% Rename me to Trill, rename Trill to Tr?
-fet_beginchar("Trill-element","trill-element","trill-element");
+fet_beginchar("Trill-element","trill-element","trillelement");
save height, overshoot;
height# = staff_space#;
width# = 0.8height#;
% Hmm
input feta-slag;
+% railroad tracks.
+%
+% I actually have no clue how they should look, so we use a slightly curvy
+% and tapered shape.
+%
+fet_beginchar("Caesura", "caesura", "caesura");
+ save slant, space_between, clearance;
+ save alpha, p;
+ save botthick, topthick;
+ save krom ;
+
+ path p;
+
+ botthick = 1.5 stafflinethickness;
+ topthick = 2.5 stafflinethickness;
+ pickup pencircle scaled botthick;
+
+
+ slant = 3.5 ;
+ space_between# = 0.6 staff_space#;
+ clearance# = 0.2 staff_space#;
+ height# = 1.2 staff_space#;
+
+ set_char_box(0, 2.0 staff_space#, staff_space# - clearance#, height#);
+ define_pixels (space_between, clearance, height);
+
+ bot y1 = -d;
+ top y2 = h;
+
+ lft x1 = 0;
+ x2 = (y2 - y1) / slant;
+
+ krom = 10;
+
+ alpha = angle (z2 - z1);
+ penpos1 (botthick, alpha - krom);
+ penpos3 (botthick, alpha - krom + 90);
+
+ penpos2 (topthick, alpha + krom );
+ penpos4 (topthick, alpha + krom + 90);
+ z3 = z1; z4 = z2;
+ penlabels (1,2,3,4);
+
+ p := z3r{(z1r - z1l)} .. z4r{z2r-z2l} .. z2r{z4l-z4r} .. z4l{z2l-z2r} .. z3l{z1l-z1r} .. z1l{z3r-z3l} .. cycle;
+ fill p;
+ fill p shifted (space_between , 0);
+
+fet_endchar;
fet_endgroup("scripts");