%
% source file of the Feta (not the Font-En-Tja) music font
%
-% (c) 1997--2003 Jan Nieuwenhuizen <janneke@gnu.org>
+% (c) 1997--2004 Jan Nieuwenhuizen <janneke@gnu.org>
fet_begingroup("rests");
begingroup
-thick#:=1/16designsize;
-define_blacker_pixels(thick);
-
-rthin:=1/8*staff_space;
-% rthick:=2rthin;
-rthick:=2thick+rthin;
-
-def shift_pic (expr pone, ptwo) =
- currentpicture:=currentpicture shifted (round(pone),round(ptwo))
-enddef;
-
-% stuff for 8th,16th etc rests
-%
-save stem, ball_crook_stem, ball_crook_balldiam, flare;
-
-% stem#:=1/8*staff_space#;
-stem# = 1/5staff_space#;
-% flare# = 2/3staff_space#;
-flare# = 2/3staff_space# - 1/8stafflinethickness#;
-
-define_pixels(stem,flare);
-
-ball_crook_stem = stem;
-ball_crook_balldiam =flare;
-
save block_rest_y, block_rest_x;
-
save breve_rest_y, breve_rest_x;
breve_rest_y# = staff_space#;
% draw_staff (-2, 2, 0.0);
save alpha, yshift, height;
alpha:=-50;
+
+
+ thick# := 1/4 staff_space#;
+ define_blacker_pixels(thick);
+
+ rthin := 1.25 linethickness;
+ rthick := 2 thick+rthin;
+
+
+
yshift# = -1.25 staff_space#;
height# = 2.8125 staff_space#;
+
define_pixels (yshift, height);
save xcenter;
xcenter = -0.1 staff_space;
-yshift#,
yshift# + height#);
- save ne,nw,se,sw; pair ne,nw,se,sw;
+ save ne,nw, se, sw; pair ne, nw, se, sw;
se=dir alpha; nw=dir (alpha+180);
ne=dir (alpha+90); sw=dir (alpha-90);
- penpos1(rthin,alpha+90);
- penpos2(5/4rthick,alpha);
- penpos4(5/4rthick,alpha);
- penpos5(rthin,alpha+90);
- penpos3(3/4rthick,alpha);
-% penpos6(5/8rthick,alpha);
- penpos6(2/3rthick,alpha);
- penpos7(1/2rthin,alpha+90);
+ penpos1(rthin, alpha+90);
+ penpos2(5/4rthick, alpha);
+ penpos4(5/4rthick, alpha);
+ penpos5(rthin, alpha+90);
+ penpos3(3/4rthick, alpha);
+% penpos6(5/8rthick, alpha);
+ penpos6(2/3rthick, alpha);
+ penpos7(1/2rthin, alpha+90);
z10=z2l+1/2rthin*sw;
% z11=z4l+1/2rthin*sw;
y1r = h;
x1l=xcenter + 1/3staff_space;
z2r=z1+staff_space*se;
- z3=1/2[z2,z4];
+ z3=1/2[z2, z4];
x4= xcenter + 3/8staff_space;
y4= 0;
z5=z4l+1.3staff_space*se;
fill z1l{se}..{se}z10..z3l..z11{se}..{se}z5l..z5r{nw}..{nw}z12..z3r..z13{nw}..{nw}z1r.. cycle;
fill z5r{nw}..tension1.4..z6l..tension1.4..{se}z7l..z7r{nw}..tension1.4..z6r..tension1.4..{se}z5l..cycle;
- penlabels(1,2,3,4,5,6,7);
- penlabels(10,11,12,13);
+ penlabels(1, 2, 3, 4, 5, 6, 7);
+ penlabels(10, 11, 12, 13);
-% 3/4 staff_space# + yshift#,
-% 18/5staff_space# + yshift#)
-
- fet_endchar;
+fet_endchar;
def rest_crook(expr a, w) =
balled_crook(a, w, ball_crook_balldiam, ball_crook_stem)
%
%
+save bulb_diam, thin, thick;
+
+bulb_diam# := 0.64 staff_space#;
+thin# := 1.4 linethickness# - 0.02 staff_space#;
+thick# := 2.2 linethickness#;
+crook_thin := 0.5 linethickness + 0.08 staff_space;
+
+lower_brush := 1.5 linethickness;
+
+define_pixels ( bulb_diam, thin, thick);
+
+%
+% PAT is a compact way to pass the brush shape to the routine.
+%
def draw_rest_bulb(expr ycenter, ycut, pat, stretch) =
begingroup;
z3 = z10+bulb_diam/2.15*dir(-72) ;
-
-
- x4 = x10+bulb_diam*.62 ;
- y4 := ceiling (y10 - 2 stafflinethickness + crook_thin);
-
- z5 = z10 + up*bulb_diam/2 + right*stafflinethickness/3;
+ z5 = z10 + up*bulb_diam/2 + right*linethickness/3;
-
- z7 = 0.5 [z4, z5] + (0.45 stafflinethickness,0.4 stafflinethickness);
+ z7 = 0.5 [z4, z5] + crook_thin * (0.45 ,0.4 ) / 1.3;
x8 = x10-0.4bulb_diam;
- y8 = y10 + 0.25 stafflinethickness;
+ y8 = y10 + 0.25 linethickness;
z6 = whatever [z1l, z2l];
- z6 = z3+whatever * dir(12);
+ z6 = z3 + whatever * dir(12);
+
+ z4 = z3 + whatever * (z6-z3)
+ + 1.1 crook_thin *(unitvector (z6 -z3) rotated 90);
+ x4 = x10+bulb_diam*.62 ;
+ y4 := ceiling (y4);
(pt,whatever) = pat intersectiontimes ((0,ycut)--(w,ycut));
.. z5{left} .. z8 .. z3{right}
.. {curl 0.2} z6 {right} .. tension 10 .. {left} point pt of pat -- cycle;
- labels(3, 4, 5, 6, 7, 8, 9, 10);
+ labels(3, 4, 5, 6, 7, 8, 9, 10, 11);
endgroup;
enddef;
def draw_eighth_rest =
- save width, bulb_diam, thin, thick;
- save ycenter, crook_thick, crook_thin;
- save crook_dir, lower_brush, pat;
+ save width;
+ save ycenter;
+ save crook_dir, pat;
pair crook_dir;
path pat;
width# := 1.0 staff_space#;
- bulb_diam# := 0.64 staff_space#;
- thin# := 1.2 stafflinethickness#;
- thick# := 2.2 stafflinethickness#;
- crook_thick# := 1.8 stafflinethickness#;
- crook_thin := 1.3 stafflinethickness;
-
- lower_brush := 1.5 stafflinethickness;
- define_pixels (width, bulb_diam, thin, thick, crook_thick);
+ define_pixels (width);
set_char_box (0, width#,
- 1.0 staff_space# + 0.5 stafflinethickness#, 0.5 staff_space# + bulb_diam#/2);
+ 1.0 staff_space# + 0.5 linethickness#, 0.5 staff_space# + bulb_diam#/2);
penpos1 (thick, 0);
penpos2 (thin, 10);
y2 = h - lower_brush;
x2r = width;
z2 = z1 + whatever*dir(72);
- z9 = z2 + 0.5 stafflinethickness * dir (angle(z2 - z1)- 10);
+ z9 = z2 + 0.5 linethickness * dir (angle(z2 - z1)- 10);
pat = z1l --- z2l .. z9 .. z2r --- simple_serif (z1r, z1l, -40) .. cycle;
fill pat;
- draw_rest_bulb(0.5 staff_space , y2r , pat , 1.0);
+ draw_rest_bulb (0.5 staff_space , y2r , pat , 1.0);
penlabels (1, 2);
labels(9);
%
fet_beginchar("16th rest","4","sixteenthrest");
- save width, bulb_diam, thin, thick;
- save ycenter, crook_thick, crook_thin;
- save crook_dir, lower_brush, pat;
+ save width;
+ save ycenter;
+ save crook_dir, pat;
pair crook_dir;
path pat;
width# := 1.2 staff_space#;
- bulb_diam# := 0.64 staff_space#;
- thin# := 1.2 stafflinethickness#;
- thick# := 2.2 stafflinethickness#;
- crook_thick# := 1.8 stafflinethickness#;
- crook_thin := 1.3 stafflinethickness;
- lower_brush := 1.5 stafflinethickness;
-
- define_pixels (width, bulb_diam, thin, thick, crook_thick);
+ define_pixels (width);
set_char_box (0, width#,
- 2.0 staff_space# + 0.5 stafflinethickness#, 0.5 staff_space# + bulb_diam#/2);
+ 2.0 staff_space# + 0.5 linethickness#, 0.5 staff_space# + bulb_diam#/2);
penpos1 (thick, 0);
penpos2 (thin, 10);
y2 = h - lower_brush;
x2r = width;
z2 = z1 + whatever*dir(74);
- z9 = z2 + 0.5 stafflinethickness * dir (angle(z2 - z1)- 10);
+ z9 = z2 + 0.5 linethickness * dir (angle(z2 - z1)- 10);
pat = z1l --- z2l .. z9 .. z2r --- simple_serif (z1r, z1l, -40) .. cycle;
fill pat;
fet_endchar;
fet_beginchar("32th rest","5","thirtysecondrest");
- save width, bulb_diam, thin, thick;
- save ycenter, crook_thick, crook_thin;
- save crook_dir, lower_brush, pat;
+ save width;
+ save ycenter;
+ save crook_dir, pat;
pair crook_dir;
path pat;
width# := 1.3 staff_space#;
- bulb_diam# := 0.64 staff_space#;
- thin# := 1.2 stafflinethickness#;
- thick# := 2.2 stafflinethickness#;
- crook_thick# := 1.8 stafflinethickness#;
- crook_thin := 1.3 stafflinethickness;
-
- lower_brush := 1.5 stafflinethickness;
- define_pixels (width, bulb_diam, thin, thick, crook_thick);
+ define_pixels (width);
set_char_box (0, width#,
- 2.0 staff_space# + 0.5 stafflinethickness#, 1.5 staff_space# + bulb_diam#/2);
+ 2.0 staff_space# + 0.5 linethickness#, 1.5 staff_space# + bulb_diam#/2);
penpos1 (thick, 0);
penpos2 (thin, 10);
y2 = h - lower_brush;
x2r = width;
z2 = z1 + whatever*dir(76);
- z9 = z2 + 0.5 stafflinethickness * dir (angle(z2 - z1)- 10);
+ z9 = z2 + 0.5 linethickness * dir (angle(z2 - z1)- 10);
pat = z1l --- z2l .. z9 .. z2r --- simple_serif (z1r, z1l, -40) .. cycle;
fill pat;
fet_endchar;
fet_beginchar("64th rest","6","sixtyfourthrest");
- save width, bulb_diam, thin, thick;
- save ycenter, crook_thick, crook_thin;
- save crook_dir, lower_brush, pat;
+ save width;
+ save ycenter;
+ save crook_dir, pat;
pair crook_dir;
path pat;
width# := 1.4 staff_space#;
- bulb_diam# := 0.64 staff_space#;
- thin# := 1.2 stafflinethickness#;
- thick# := 2.2 stafflinethickness#;
- crook_thick# := 1.8 stafflinethickness#;
- crook_thin := 1.3 stafflinethickness;
- lower_brush := 1.5 stafflinethickness;
-
- define_pixels (width, bulb_diam, thin, thick, crook_thick);
+ define_pixels (width);
set_char_box (0, width#,
- 3.0 staff_space# + 0.5 stafflinethickness#, 1.5 staff_space# + bulb_diam#/2);
+ 3.0 staff_space# + 0.5 linethickness#, 1.5 staff_space# + bulb_diam#/2);
penpos1 (thick, 0);
penpos2 (thin, 10);
y2 = h - lower_brush;
x2r = width;
z2 = z1 + whatever*dir(78);
- z9 = z2 + 0.5 stafflinethickness * dir (angle(z2 - z1)- 10);
+ z9 = z2 + 0.5 linethickness * dir (angle(z2 - z1)- 10);
pat = z1l --- z2l .. z9 .. z2r --- simple_serif (z1r, z1l, -40) .. cycle;
fill pat;
fet_endchar;
fet_beginchar("128th rest","7","hundredtwentyeighthrest");
- save width, bulb_diam, thin, thick;
- save ycenter, crook_thick, crook_thin;
- save crook_dir, lower_brush, pat;
+ save width;
+ save ycenter;
+ save crook_dir, pat;
pair crook_dir;
path pat;
width# = 1.5 staff_space#;
- bulb_diam# := 0.64 staff_space#;
- thin# := 1.2 stafflinethickness#;
- thick# := 2.2 stafflinethickness#;
- crook_thick# := 1.8 stafflinethickness#;
- crook_thin := 1.3 stafflinethickness;
-
- lower_brush := 1.5 stafflinethickness;
- define_pixels (width, bulb_diam, thin, thick, crook_thick);
+ define_pixels (width);
set_char_box (0, width#,
- 3.0 staff_space# + 0.5 stafflinethickness#, 2.5 staff_space# + bulb_diam#/2);
+ 3.0 staff_space# + 0.5 linethickness#, 2.5 staff_space# + bulb_diam#/2);
penpos1 (thick, 0);
penpos2 (thin, 10);
y2 = h - lower_brush;
x2r = width;
z2 = z1 + whatever*dir(80);
- z9 = z2 + 0.5 stafflinethickness * dir (angle(z2 - z1)- 10);
+ z9 = z2 + 0.5 linethickness * dir (angle(z2 - z1)- 10);
pat = z1l --- z2l .. z9 .. z2r --- simple_serif (z1r, z1l, -40) .. cycle;
fill pat;