% MSA symbols, bright style [1996/07/02 v1.0 (WaS)]

numeric circ_w#; %
circ_w#=2u#+body_height#+max(paren_depth#,desc_depth#);

cmchar "Yen symbol";
% Change (jk): Use correct pen for horizontal bars
compute_spread(.45x_height#, .55x_height#); 
beginchar(oct"125",13u#,cap_height#,0); %% adapted from "Y" 
italcorr cap_height#*slant+.45u#; 
adjust_fit(cap_serif_fit#,cap_serif_fit#); numeric 
left_stem,right_stem,outer_jut,dy,alpha; 
left_stem=cap_stem-stem_corr; right_stem=min(cap_hair if 
hefty:-2stem_corr fi,left_stem); outer_jut=.75cap_jut; 
x1l=w-x4r=l+letter_fit+outer_jut+.05u; 
x2l=x5l=hround(.5w-.5left_stem); x3r=x5r; y1=y4=h; 
y2=y3=y5=.4h; dy=y1-y2; alpha=((x2l-x1l)++dy)/dy; 
penpos1(alpha*left_stem,0); penpos2(alpha*left_stem,0); 
penpos3(alpha*right_stem,0); penpos4(alpha*right_stem,0); 
penpos5(left_stem,0); penpos6(left_stem,0); x5=x6; y6=0; 
z0=whatever[z1r,z2r]=whatever[z3l,z4l]; if 
y0>y2+cap_notch_cut: y0:=y2+cap_notch_cut; 
  fill z0+.5right{up}...{z4-z3}diag_end(3l,4l,1,1,4r,3r)--z5r 
--diag_end(5r,6r,1,1,6l,5l)--z5l--diag_end(2l,1l,1,1,1r,2r){z2-z1} 
    ...{down}z0+.5left--cycle; % diagonals and stem 
else: fill z0--diag_end(0,4l,1,1,4r,3r)--z5r 
    --diag_end(5r,6r,1,1,6l,5l)--z5l 
    --diag_end(2l,1l,1,1,1r,0)--cycle; fi % diagonals & stem 
if serifs: numeric inner_jut; pickup tiny.nib; 
 prime_points_inside(1,2); prime_points_inside(4,3); 
prime_points_inside(6,5); 
 if rt x1'r+cap_jut+.5u+1<=lft x4'l-cap_jut: 
inner_jut=cap_jut; 
 else: rt x1'r+inner_jut+.5u+1=lft x4'l-inner_jut; fi 
 dish_serif(1',2,a,1/3,outer_jut,b,1/2,inner_jut); % upper left serif  
 dish_serif(4',3,c,.6,inner_jut,d,1/2,outer_jut)(dark); % upper right serif 
 dish_serif(6',5,e,1/3,cap_jut,f,1/3,cap_jut); fi % lower serif 
pickup pencircle scaled min(hair,vair);
x7=x9=x1l; x8=x10=x4r; y9=y10; 
top y7=bar_height; y7=y8; draw z7--z8; 
y9-y7=spread; draw z9--z10; % crossing bars
penlabels(0,1,2,3,4,5,6,1',2',3',4',5',6',7,8,9,10); endchar;  

% the next characters have been taken from Joerg Knappen's TC fonts:

cmchar"Registered";
beginchar(oct"162",circ_w#,body_height#,max(paren_depth#,desc_depth#));
autorounded;
adjust_fit(if monospace:-3u#,-3u# else: 0,0 fi); pickup rule.nib;
if .5w <> good.x .5w: change_width; fi
lft x6=hround u; x2=w-x6; top y8=h+o; bot y4=-d-o;
circle_points; draw_circle;  % circle
labels(1,2,3,4,5,6,7,8); 
clearxy; autorounding:=0;
numeric hh,ll,rr; hh=vround .7cap_height; ll=hround(.5w-6u);
rr=hround(.5w+6u);
pickup tiny.nib; pos1(cap_stem',0); pos2(cap_stem',0);
lft x1l=lft x2l=ll+hround max(2u,3u-.5cap_stem'); top y1=hh; bot y2=0;
filldraw stroke z1e--z2e; % stem
penpos3(cap_band,90); penpos4(cap_band,90);
penpos5(cap_curve if hefty:-3stem_corr fi,0);
penpos6(vair,-90); penpos7(vair,-90);
z3r=top z1; y4=y3; y5=.5[y4l,y6l]; y6=y7;
x7=x2; y7l=vround(.5hh+.5vair); x4=x6;
if serifs: x4=.5w-.5u; x5r=hround(rr-2.25u);
else: x4=.5w+.5u; x5r=hround(rr-u); fi
x4l:=x6l:=x4-.125cap_curve;
fill stroke z3e..pulled_arc.e(4,5) & pulled_arc.e(5,6)..z7e;  % lobe
if serifs: pos6'(vair,-90); pos0(cap_stem,180);
 pos8(cap_curve,180); pos9(vair,-90); pos10(hair,0);
 z6'=z6; lft x0r=lft x8r=hround(x5-2/3u-.5cap_curve);
 y8=1/3[y2,y7]; y0=3/5[y2,y7]; x9=.5[x8l,x10r];
 bot y9r=-o; rt x10r=hround(rr-.25u); y10=1/3[y2,y7];
 filldraw stroke z6'e{right}..z0e---z8e....z9e{right}..z10e{up};  % tail
 nodish_serif(1,2,a,1/3,cap_jut,b,1/3,.5cap_jut);  % upper serif
 dish_serif(2,1,c,1/3,cap_jut,d,1/3,cap_jut);  % lower serif
else: penpos8(cap_stem-2stem_corr,0); penpos9(cap_stem,0);
 x8=x6+.5u; y8=y6; x9r=hround(rr-.5u); y9=0;
 fill z8l--diag_end(8l,9l,.5,1,9r,8r)--z8r--cycle; fi  % tail
penlabels(0,1,2,3,4,5,6,7,8,9,10); endchar;

cmchar"circledS";
beginchar(oct"163",circ_w#,body_height#,max(paren_depth#,desc_depth#));
autorounded;
adjust_fit(if monospace:-3u#,-3u# else: 0,0 fi); pickup rule.nib;
if .5w <> good.x .5w: change_width; fi
lft x6=hround u; x2=w-x6; top y8=h+o; bot y4=-d-o;
circle_points; draw_circle;  % circle
labels(1,2,3,4,5,6,7,8); 
clearxy; autorounding:=0;
numeric hh,ll,rr; hh=vround .7cap_height; ll=hround(.5w-5u);
rr=hround(.5w+5u);
numeric theta; theta=90-angle(50u,hh); slope:=-hh/50u;  % angle at middle
numeric s_slab; s_slab=vround .2[slab,cap_stem];
numeric ess'; ess'=max(fine.breadth,cap_ess);
pickup fine.nib; pos2(max(fine.breadth,s_slab-vround vair_corr),-90);
pos0(ess',theta); pos7(s_slab,-90);
x2+x7=2x0=w; x7-x2=0; top y2l=hh+o; bot y7r=-o;
y0=.52hh; lft x3l=ll+hround u; rt x6r=hround(rr-u);
x3r-x3l=x6r-x6l=hround .5[s_slab,ess']-fine;
ellipse_set(2l,3l,4l,0l); ellipse_set(2r,3r,4r,0r); y3=y3r;
ellipse_set(7l,6l,5l,0l); ellipse_set(7r,6r,5r,0r); y6=y6r;
filldraw stroke super_arc.e(2,3) & z3e{down}
 ..z4e---z5e..z6e{down} & super_arc.e(6,7);  % main stroke
pos1(1.2flare,-100); pos8(1.2flare,-100);
 x1l=good.x(x1l+rr-1.75u-rt x1); lft x8r=ll+hround .8u;
 top y1l=vround .93hh+o; bot y8r=vround .1hh-o;
 filldraw stroke term.e(2,1,right,.9,4);  % upper arc and terminal
 filldraw stroke term.e(7,8,left,1,4); % lower arc and terminal
math_fit(0,.5ic#); penlabels(0,1,1',2,3,4,5,6,7,8,8',9,10); endchar;

