% ebbraces.mf
% [= exbraces.mf, changed by Walter Schmidt, see (CMBR)]
%
% (c) Copyright 1995, 1996, 1997 J"org Knappen
% (c) Copyright 1990, 1992 Norbert Schwarz
%
% This file is part of the EC Bright fonts version 1.0 Patchlevel 3
%
%
% Please read the files 00readme.txt, 00inst.txt, 00error.txt, and
% copyrite.txt for further information
%
% Content:
%
% braces and some special characters
%
version_check(1,0);  % |version_check| was introduced in dc1.3

ecchar "Circumflex (hat)";
beginchar(oct"136",11u#,min(asc_height#,2x_height#),0);
if serifs: italcorr .5[x_height#,h#]*slant+.5hair#-1.75u#;
 adjust_fit(0,0);
 pickup crisp.nib; pos2(.5[vair,curve],90); top y2r=.75[x_height,h]; x2=.5w;
 x1=w-x3=good.x 2.25u; y1=y3=.25[x_height,y2];
 pos1(hair,angle(z2-z1)+90); pos3(hair,angle(z3-z2)+90);
 filldraw stroke z1e--z2e--z3e;  % diagonals
else: italcorr 2/3[x_height#,h#]*slant-.5stem#+.5vair#-.75u#;
 adjust_fit(0,0);
 pickup fine.nib; pos1(vair,0); pos3(vair,0); x1=w-x3;
 pos2(stem,0); top y2=2/3[x_height,h]; x2=.5w; bot y1=bot y3=vround x_height-eps;
 lft x1l=hround(rt x2r-3.25u-.5vair);
 z0=whatever[z1r,z2r]=whatever[z2l,z3l];
 y4l=y4r=y2; x4l=good.x .2[x2l,x2]; x4r=w-x4l;
 filldraw z4l--z1l--z1r--z0--z3l--z3r--z4r--cycle; fi  % diagonals
penlabels(0,1,2,3,4); endchar;



ecchar "Tilde (squiggle)";
beginchar(oct"176",11u#,min(asc_height#,
                          10/7x_height#+.5dot_size#),0);
italcorr h#*slant-u#;
adjust_fit(0,0);
if serifs: numeric theta; theta=angle(1/6(6u-vair),1/4(h-x_height));
 pickup crisp.nib; numeric mid_width; mid_width=.4[vair,stem];
 pos1(vair,theta+90); pos2(vair,theta+90);
 pos3(vair,theta+90); pos4(vair,theta+90);
 z2-z1=z4-z3=(mid_width-crisp)*dir theta;
 lft x1r=w-rt x4l=hround 1.5u; top y4r=h;
 bot y1l=vround(bot y1l+min(2/3[x_height,h],y3l-.25vair)-top y1r);
 pair delta; ypart delta=3(y3l-y1l); delta=whatever*dir theta;
 filldraw z1l..controls(z1l+delta)and(z3l-delta)..z3l..z4l
  --z4r..controls(z4r-delta)and(z2r+delta)..z2r..z1r--cycle;  % stroke
else: pickup fine.nib; pos1(vair,180); pos2(vair,90);
 pos3(.5[vair,slab],90); pos4(vair,90); pos5(vair,180);
 lft x1r=w-rt x5l=hround 1.5u; x2-x1=x3-x2=x4-x3=x5-x4;
 bot y1=bot y4l=vround(.75[x_height,h]-vair);
 top y2r=top y5=h; y3=.5[y2,y4];
 filldraw stroke z1e{up}...z2e{right}..z3e..{right}z4e...{up}z5e; fi % stroke
penlabels(1,2,3,4,5); endchar;

ecchar "Compound word mark";
beginchar(oct"027",0,x_height#,0);
zero_width;
endchar;

ecchar "Left parenthesis";
beginchar("(",7u# if monospace: -u# fi,body_height#,paren_depth#);
italcorr body_height#*slant-.5u#;
adjust_fit(0,0); pickup fine.nib;
pos1(vair,0); pos2(.75[hair,stem],0); pos3(vair,0);
rt x1r=rt x3r=hround(w-u); lft x2l=hround(x1-4u if monospace: +4/3u fi);
top y1=h; y2=.5[y1,y3]=math_axis;
filldraw stroke z1e{3(x2e-x1e),y2-y1}...z2e
 ...{3(x3e-x2e),y3-y2}z3e;  % arc
penlabels(1,2,3); endchar;

ecchar "Right parenthesis";
beginchar(")",7u# if monospace: -u# fi,body_height#,paren_depth#);
italcorr math_axis#*slant-.5u#;
adjust_fit(0,0); pickup fine.nib;
pos1(vair,0); pos2(.75[hair,stem],0); pos3(vair,0);
lft x1l=lft x3l=hround u; rt x2r=hround(x1+4u if monospace: -4/3u fi);
top y1=h; y2=.5[y1,y3]=math_axis;
filldraw stroke z1e{3(x2e-x1e),y2-y1}...z2e
 ...{3(x3e-x2e),y3-y2}z3e;  % arc
penlabels(1,2,3); endchar;


ecchar "Less than sign";% (CMBR)
compute_spread(5/4sym_height#,3/2sym_height#);
beginchar("<",11u#,v_center(spread#+rule_thickness#));
italcorr h#*slant-u#;
adjust_fit(0,0); pickup extra_rule.nib;
lft x2=hround 1.5u-eps; x1=x3=w-x2;
y1-y3=spread; y2=.5[y1,y3]=math_axis;
draw z1--z2--z3;  % diagonals
labels(1,2,3); endchar;

ecchar "Vertical line";
beginchar(oct"174",5u#,body_height#,paren_depth#);
italcorr body_height#*slant+.5rule_thickness#-2u#;
adjust_fit(0,0); pickup rule.nib;
x1=x2=good.x .5w; top y1=h+eps; bot y2=-d-eps;
draw z1--z2;  % stem
labels(1,2); endchar;


ecchar "Greater than sign";% (CMBR)
compute_spread(5/4sym_height#,3/2sym_height#);
beginchar(">",11u#,v_center(spread#+rule_thickness#));
italcorr math_axis#*slant-u#;
adjust_fit(0,0); pickup extra_rule.nib;
rt x2=hround(w-1.5u)+eps; x1=x3=w-x2;
y1-y3=spread; y2=.5[y1,y3]=math_axis;
draw z1--z2--z3;  % diagonals
labels(1,2,3); endchar;

ecchar "Left bracket";
numeric wd#; wd#=max(5u#,4.5u#+.5if hefty:stem# else:rule_thickness# fi);
beginchar("[",wd#,body_height#,paren_depth#);
italcorr body_height#*slant;
adjust_fit(0,0);
numeric top_thickness,side_thickness;
% if hefty:
 top_thickness=vair;
 side_thickness=max(crisp.breadth,stem-stem_corr);
% else: top_thickness=side_thickness=rule_thickness; fi;
pickup crisp.nib; pos1(side_thickness,0); pos2(side_thickness,0);
top y1=h; bot y2=-d; lft x1l=lft x2l=hround(2.5u-.5side_thickness)-1-eps;
filldraw stroke z1e--z2e;  % stem
pos3(top_thickness,90); pos4(top_thickness,90);
pos5(top_thickness,90); pos6(top_thickness,90);
x3=x5=x1l; rt x4=rt x6=ceiling(w-.4u)+eps; y3r=y4r=y1; y5l=y6l=y2;
filldraw stroke z3e--z4e;  % upper bar
filldraw stroke z5e--z6e;  % lower bar
penlabels(1,2,3,4,5,6); endchar;

ecchar "Right bracket";
numeric wd#; wd#=max(5u#,4.5u#+.5if hefty:stem# else:rule_thickness# fi);
beginchar("]",wd#,body_height#,paren_depth#);
italcorr body_height#*slant-2u#+.5if hefty:stem# else:rule_thickness# fi;
adjust_fit(0,0);
numeric top_thickness,side_thickness;
%if hefty:
  top_thickness=vair;
 side_thickness=max(crisp.breadth,stem-stem_corr);
% else: top_thickness=side_thickness=rule_thickness; fi;
pickup crisp.nib; pos1(side_thickness,0); pos2(side_thickness,0);
top y1=h; bot y2=-d; rt x1r=rt x2r=hround(w-2.5u+.5side_thickness)+1+eps;
filldraw stroke z1e--z2e;  % stem
pos3(top_thickness,90); pos4(top_thickness,90);
pos5(top_thickness,90); pos6(top_thickness,90);
x3=x5=x1r; lft x4=lft x6=floor .4u-eps; y3r=y4r=y1; y5l=y6l=y2;
filldraw stroke z3e--z4e;  % upper bar
filldraw stroke z5e--z6e;  % lower bar
penlabels(1,2,3,4,5,6); endchar;


ecchar "Reverse slash (backslash)";
beginchar(oct"134",9u#,body_height#,paren_depth#);
adjust_fit(0,0); pickup extra_rule.nib;
lft x1=hround u-eps; top y1=h+eps;
rt x2=hround(w-u)+eps; bot y2=-d-eps;
draw z1--z2;  % diagonal
labels(1,2); endchar;

ecchar "Left curly brace";
beginchar(oct"173",9u#,body_height#,paren_depth#);
italcorr body_height#*slant+.5vair#-u#;
adjust_fit(0,0); pickup fine.nib;
forsuffixes $=1,1',4,4',7,7': pos$(vair,0); endfor
forsuffixes $=2,3,5,6: pos$(stem,0); endfor
x2=x3=x5=x6; x1=x1'=x7=x7'=w-x4=w-x4';
lft x4l=hround(1.5u-.5vair); lft x2l=hround(.5w-.5stem);
top y1=h; bot y7=-d; .5[y4,y4']=.5[y1,y7]=.5[y2,y6]=.5[y3,y5];
y1-y2=y3-y4=(y1-y4)/4; y1-y1'=y4-y4'=y7'-y7=vair-fine;
filldraw z1l{left}...z2l---z3l...{left}z4l
 --z4'l{right}...z5l---z6l...{right}z7l
 --z7r--z7'r{left}...z6r---z5r...{left}.5[z4r,z4'r]{right}
 ...z3r---z2r...{right}z1'r--z1r--cycle;  % stroke
penlabels(1,2,3,4,5,6,7); endchar;

ecchar "Right curly brace";
beginchar(oct"175",9u#,body_height#,paren_depth#);
italcorr math_axis#*slant+.5vair#-u#;
adjust_fit(0,0); pickup fine.nib;
forsuffixes $=1,1',4,4',7,7': pos$(vair,0); endfor
forsuffixes $=2,3,5,6: pos$(stem,0); endfor
x2=x3=x5=x6; x1=x1'=x7=x7'=w-x4=w-x4';
rt x4r=hround(w-1.5u+.5vair); rt x2r=hround(.5w+.5stem);
top y1=h; bot y7=-d; .5[y4,y4']=.5[y1,y7]=.5[y2,y6]=.5[y3,y5];
y1-y2=y3-y4=(y1-y4)/4; y1-y1'=y4-y4'=y7'-y7=vair-fine;
filldraw z1r{right}...z2r---z3r...{right}z4r
 --z4'r{left}...z5r---z6r...{left}z7r
 --z7l--z7'l{right}...z6l---z5l...{right}.5[z4l,z4'l]{left}
 ...z3l---z2l...{left}z1'l--z1l--cycle;  % stroke
penlabels(1,2,3,4,5,6,7); endchar;




ecchar "Underbar";
compute_spread((5/8+.45)*x_height#,(3/4+.55)*x_height#);
beginchar(oct"137",14u#,0,spread#-math_axis#+.5rule_thickness#);
adjust_fit(0,0); pickup rule.nib;
lft x1=hround 1.5u-eps; x2=w-x1; bot y1=bot y2=-d;
draw z1--z2;  % bar
labels(1,2); endchar;

iff not monospace:
ecchar "Hyphenchar";
beginchar(oct"177",3u#,x_height#,0);
italcorr .5x_height#*slant-.5u#;
adjust_fit(0,0);
numeric thickness; thickness=if hefty:bar else:.75[hair,stem] fi;
pickup crisp.nib; pos1(thickness,90); pos2(thickness,90);
top y1r=top y2r=vround(.5h+.5thickness); rt x2=hround(2w-u)+eps;
lft x1=hround .2u-eps;
filldraw stroke z1e--z2e;  % bar
penlabels(1,2); endchar;

iff monospace:
ecchar "Hyphenchar";
beginchar(oct"177",3u#,x_height#,0);
italcorr .5x_height#*slant-.5u#;
adjust_fit(0,0);
numeric thickness; thickness=if hefty:bar else:.75[hair,stem] fi;
pickup crisp.nib; pos1(thickness,90); pos2(thickness,90);
top y1r=top y2r=vround(.5h+.5thickness); rt x2=hround(w-u)+eps;
x2=w-x1;
filldraw stroke z1e--z2e;  % bar
penlabels(1,2); endchar;

iff hefty: % Sans or typewriter
ecchar "Blank-space sign";
beginchar(oct"040",9u#,x_height#,.5desc_depth#);
italcorr bar_height#*slant-.25u#;
adjust_fit(0,0);
numeric thin_vair#; thin_vair#=.7vair#;
define_whole_blacker_pixels(thin_vair);
h:=bar_height;
forsuffixes $=1,2,3,4: penpos$(thin_vair,0); endfor
penpos0(thin_vair,90); x0=.5w; y0l=vround(-d-.5thin_vair);
x1=x2; x3=x4=w-x1; lft x1l=hround .75u;
y1=y4=h; y2=y3=y0;
fill z1l---z2l...(x2,y0l)---(x3,y0l)...z3r---z4r
 ..z4l---(x3l,y0r)--(x2r,y0r)---z1r..cycle;  % the stroke
penlabels(0,1,2,3,4); endchar;

iff not hefty: % Other than the above mentioned
ecchar "Blank-space sign"; % jk
beginchar(oct"040",9u#,x_height#,.5desc_depth#);
italcorr bar_height#*slant-.25u#;
adjust_fit(0,0);
numeric shaved_stem; shaved_stem=hround .9[vair,.85cap_stem];
if shaved_stem<crisp.breadth: shaved_stem:=crisp.breadth; fi
pickup crisp.nib;
pos1(shaved_stem,-90); pos2(hair,0);
bot y1r=-d; x1=.5w; rt x2r=hround(w-.75u); y2=good.y(y1l+.5beak)+eps;
arm(1,2,a,beak_darkness,2beak_jut);  % lower right arm and beak
pos3(hair,180); x3=w-x2; y3=y2;
arm(1,3,b,beak_darkness,-2beak_jut);  % lower left arm and beak
math_fit(0,.5ic#);
penlabels(1,2,3); endchar;

endinput;
