% cbpunct.mf
% Copyright (C) 1997,1998,1999 Claudio Beccari
% version 2.2 1998/03/19
%
% Most of  these  glyphs  were  designed  by  Silvio  Levy;  CB modified and
% "corrected" most of them in order to be valid for all family, series, and
% shapes; he added also the per  mill and the euro signs, plus two invisible
% characters.
%
%%% Punctuation marks

cmchar "Open quotes (eisagwgik'a)";
beginchar("{",9u#,x_height#,0);
adjust_fit(0,0); 
pickup fine.nib; 
numeric centro, alto;
centro=if monospace: vair else: stem fi; 
alto=vair;
pos0(alto,0); pos1(centro,0); pos2(alto,0);
pos3(alto,0); pos4(centro,0); pos5(alto,0);
top y0=h+o; bot y2=-o; 
y0=y3; 
y1=y4=.5[y0,y2]; 
y2=y5;
lft x1l =u;
rt x3r = w - u;
lft x4l- rt x1r=lft x3l - rt x0r = centro + .7fine; 
x0=x2; 
x3=x5;
filldraw stroke z0e--z1e--z2e;
filldraw stroke z3e--z4e--z5e;
penlabels(0,1,2,3,4,5); 
endchar;
     
cmchar "Close quotes (eisagwgik'a)";
beginchar("}",9u#,x_height#,0);
adjust_fit(0,0); 
pickup fine.nib; 
numeric centro, alto;
centro=if monospace: vair else: stem fi; 
alto=vair;
pos0(alto,0); pos1(centro,0); pos2(alto,0);
pos3(alto,0); pos4(centro,0); pos5(alto,0);
top y0=h+o; bot y2=-o; 
y0=y3; 
y1=y4=.5[y0,y2]; 
y2=y5;
lft x0l =u;
rt x4r = w - u;
lft x4l- rt x1r=lft x3l - rt x0r = centro + .7fine; 
x0=x2; 
x3=x5;
filldraw stroke z0e--z1e--z2e;
filldraw stroke z3e--z4e--z5e;
penlabels(0,1,2,3,4,5); 
endchar;


     
cmchar "Exclamation point";
beginchar("!",5u#+width_adj#,asc_height#,0);
italcorr asc_height#*slant-2u#-.5width_adj#+.5dot_size#;
adjust_fit(0,0);
pickup tiny.nib; pos3(dot_size,0); pos4(dot_size,90);
lft x3l=hround(.5w-.5dot_size); bot y4l=0; z3=z4; dot(3,4);  % dot
numeric bot_width;
bot_width=if hefty:max(hround .8dot_size,fine.breadth) else: hair fi;
pickup fine.nib; pos1(dot_size,0); pos2(bot_width,0);
x1=x2=x3; bot y2=.25[top y4r,x_height]+1;
if square_dots: top y1=h;
 filldraw stroke z1e--z2e;  % stem
else: top z0=(x1,h+o); y1+.5dot_size=h+o;
 filldraw z1r...z0...z1l---z2l--z2r---cycle; fi  % stem and bulb
penlabels(0,1,2,3,4); endchar;
     
cmchar "Per cent sign";
beginchar("%",9u#+max(6u#,2fudge*(hair#+stem#)),
  body_height#,body_height#-asc_height#);
italcorr if hefty: .4asc_height#*slant-.5u# else: h#*slant-u# fi;
adjust_fit(0,0); pickup fine.nib;
numeric left_curve,right_curve;
left_curve=hround 5/6[fudged.hair,fudged.stem];
right_curve=max(fine.breadth,hround(fudged.hair if hefty:-2stem_corr fi));
pos1(vair,90); pos2(left_curve,180); pos3(vair,270); pos4(right_curve,360);
top y1r=h; lft x2r=hround u; rt x4r=hround(.5w-1.5u);
bot y3r=floor(if monospace: .7 else: .5 fi\\ asc_height);
x1=x3=.5[x2,x4]; y2=y4=.5[y1,y3];
filldraw stroke pulled_super_arc.e(1,2)(superpull)
 & pulled_super_arc.e(2,3)(superpull);  % left half of upper bowl
filldraw stroke super_arc.e(3,4) & super_arc.e(4,1); % right half of upper bowl
pos5(vair,90); pos6(left_curve,180); pos7(vair,270); pos8(right_curve,360);
bot y7r=-d; rt x8r=hround(w-u); lft x6r=hround(.5w+1.5u);
top y5r=vround(if monospace: .3 else: .5 fi\\ asc_height);
x5=x7=.5[x6,x8]; y6=y8=.5[y5,y7];
filldraw stroke pulled_super_arc.e(5,6)(superpull)
 & pulled_super_arc.e(6,7)(superpull);  % left half of lower bowl
filldraw stroke super_arc.e(7,8) & super_arc.e(8,5); % right half of lower bowl
pickup rule.nib; top y9=h; bot y10=-d;
if hefty: x9=good.x(x5-eps); x10=good.x(x1+eps);
 draw z9--z10;  % diagonal
else: rt x9=hround(w-2.5u); lft x10=hround 2.5u; draw z9--z10;  % diagonal
 pickup fine.nib; pos9(rule_thickness,angle(z9-z10)+90);
 pos11(vair,angle(z1r-z4r)-90); pos12(vair,angle(z9-z10)+90);
 path p; p=super_arc.r(1,4); z11r=point 2/3 of p; z12r=z9r;
 filldraw stroke z11e{direction 2/3 of p}...{z9-z10}z12e; fi  % link
penlabels(1,2,3,4,5,6,7,8,9,10,11,12); endchar;


cmchar"Euro";
beginchar(24,12u#,body_height#,0);
adjust_fit(0,0);
italcorr slant*body_height#-.5u#;
pickup fine.nib;
numeric raggio; raggio=.5*(min(w,h)-stem);
numeric spess,diagon; 
pair za, zb, zc, zd;
x0=7/12w=xpart zd; y0=if monospace: 1.2* fi raggio+.5stem;
zb=z0+raggio*dir(45); xpart zc=x0-raggio; ypart zc=0=ypart zd; za=.9[zc,zd];
diagon=angle(zb-za);
spess=.5[hair,stem]; if 2spess+fine > raggio: spess:=.8spess fi; 
pos1(spess,diagon); pos2(spess,diagon); pos3(spess,diagon); pos4(spess,diagon);
pos9(stem,180);  pos10(stem,90); pos11(stem,diagon);
pos12(stem,-90); pos13(stem,-90);
zc:= whatever[zb,za]; ypart zc=y0;
z1-z3 = whatever*up; 
z2-z4=whatever*dir(diagon); .5[z2,z4]=zc;
lft x1l=0;
x11r=x13r; x12=x10;
y2l-y4r=.5[if serifs:hair else: fine fi,stem]; y2=y1; y3=y4;
x9=x0-raggio;
y0=y9=.5[y12,y10]=.5[y11,y13];
z11=z0+raggio*dir(45); 
z10=z0+if monospace: 1.2* fi raggio*dir(90);
%bot y12r=-o; 
%
filldraw stroke z1e--z2e; % upper stroke
filldraw stroke z3e--z4e; % lower stroke
filldraw stroke z11e..{left}z10e..z9e..z12e{right}..z13e; % arc
numeric raggio,spess,diagon;
pair za, zb, zc, zd;
penlabels(0,1,2,3,4,9,10,11,12,13);
endchar;



cmchar "Per mill sign"; 
beginchar(25,15u#+max(6u#,2fudge*(hair#+stem#)),
  body_height#,body_height#-asc_height#);
italcorr .4asc_height#*slant-.5u#;
adjust_fit(0,0); pickup fine.nib;
numeric left_curve,right_curve;
left_curve=hround 5/6[fudged.hair,fudged.stem];
right_curve=max(fine.breadth,hround(fudged.hair if hefty:-2stem_corr fi));
pos1(vair,90); pos2(left_curve,180); pos3(vair,270); pos4(right_curve,360);
top y1r=h; lft x2r=hround u; rt x4r=hround(.5(w-6u)-1.5u);
bot y3r=floor(if monospace: .7 else: .5 fi asc_height);
x1=x3=.5[x2,x4]; y2=y4=.5[y1,y3];
fill top z1r{left}...lft z2r...bot z3r{right}...rt z4r...cycle; 
unfill bot z1l{left}...rt z2l...top z3l{right}...lft z4l...cycle;
picture p_zero; p_zero=currentpicture;
numeric x_dev; x_dev:=(d+bot y3r)*slant;
addto currentpicture also p_zero shifted (8u-x_dev,-d-bot y3r);
addto currentpicture also p_zero shifted (14u-x_dev,-d-bot y3r);
picture p_zero; numeric x_dev;
%
%
pickup rule.nib; top y5=h; bot y6=-d;
if hefty: 
 x5=good.x(x1+8u -eps); x6=good.x(x1+eps);
 draw z5--z6;  % diagonal
else: 
 rt x5=hround(w-8.5u); lft x6=hround 2.5u; draw z5--z6;  % diagonal
 numeric deviat; deviat:=60; pickup fine.nib; 
 pos5(rule_thickness,angle(z5-z6)+deviat);
 path p[]; p1= z1r{right}...{down}z4r; z9=point 1/3 of p1; 
 p2= z1l{right}...{down}z4l; z10=point 1/3 of p2; z7=.5[z9,z10];
 pos7(max(length(z9-z10),currentbreadth+eps),angle(z9-z10)); 
 pos8(vair,angle(z5-z6)+deviat); z8r=z5r; 
 filldraw stroke z7e{direction 1/3 of p1}...{z5-z6}z8e; % link
 numeric deviat; path p[]; 
fi  
penlabels(1,2,3,4,5,6,7,8); endchar;


     
     
def dims = 5u#,asc_height#,0 enddef;
def ital = 0 enddef;
def fit_params = 0,0 enddef;
     
def gen_letter=
x1-.5dot_size=hround(.5w-.5dot_size); y1+.5dot_size=h;
if monospace: comma(1,a,dot_size,.28u,vround 1.5comma_depth);  % large comma
else: comma(1,a,dot_size,.25u,comma_depth); fi  % comma with increased jut
enddef;
     
cmchar "Apostrophe";
beginchar(oct"035",dims);
this_letter; penlabels(1); endchar;
     
picture savedpicture;
     
cmchar "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;
     
cmchar "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;
     
cmchar "Asterisk";
beginchar("*",9u#,
  if low_asterisk:math_axis#+.5x_height# else: body_height# fi,0);
italcorr h#*slant-.75u#;
adjust_fit(0,0);
numeric ast_flare; ast_flare=hround .7[thin_join,stem];
x0=.5w; y0=h-.5x_height;
for d=-150 step 60 until 150: z[d]=z0+.5dir d xscaled 7.5u yscaled x_height;
 numeric theta; theta=angle(z[d]-z0);
 fill z0+.5(0,-thin_join)rotated theta
  ---z[d]+.5(-ast_flare,-ast_flare)rotated theta
  ..z[d]..z[d]+.5(-ast_flare,ast_flare)rotated theta
  ---z0+.5(0,thin_join)rotated theta--cycle; endfor  % diagonal at angle |d|
labels(0,[-150],[-90],[-30],30,90,150); endchar;
     
cmchar "Plus sign";
beginarithchar("+"); pickup rule.nib;
x1=x2=good.x .5w; top y1=h+eps; .5[y1,y2]=math_axis;
lft x3=hround u-eps; x4=w-x3; y3=y4=math_axis;
draw z1--z2;  % stem
draw z3--z4;  % crossbar
labels(1,2,3,4); endchar;
     
cmchar "Comma";
numeric dot_diam#; dot_diam#=if monospace: 5/4 fi\\ dot_size#;
define_whole_blacker_pixels(dot_diam);
beginchar(",",5u#,dot_diam#,comma_depth#);
adjust_fit(0,0);
x1-.5dot_diam=hround(.5w-.5dot_diam); y1-.5dot_diam=0;
comma(1,a,dot_diam,.2u,comma_depth);  % dot and tail
penlabels(1); endchar;
     
cmchar "Period";
numeric dot_diam#; dot_diam#=if monospace: 5/4 fi\\ dot_size#;
define_whole_blacker_pixels(dot_diam);
beginchar(".",5u#,dot_diam#,0);
adjust_fit(0,0); pickup fine.nib;
pos1(dot_diam,0); pos2(dot_diam,90);
lft x1l=hround(.5w-.5dot_diam); bot y2l=0; z1=z2; dot(1,2);  % dot
penlabels(1,2); endchar;
     
cmchar "Virgule (slash)";
beginchar("/",9u#,body_height#,paren_depth#);
italcorr body_height#*slant-.5u#;
adjust_fit(0,0); pickup rule.nib;
rt x1=hround(w-u)+eps; top y1=h+eps;
lft x2=hround u-eps; bot y2=-d-eps;
draw z1--z2;  % diagonal
penlabels(1,2); endchar;
     
cmchar "Colon";
numeric dot_diam#; dot_diam#=if monospace: 5/4 fi\\ dot_size#;
define_whole_blacker_pixels(dot_diam);
beginchar(":",5u#,x_height#,0);
italcorr x_height#*slant+.5dot_diam#-2u#;
adjust_fit(0,0); pickup fine.nib;
pos1(dot_diam,0); pos2(dot_diam,90);
lft x1l=hround(.5w-.5dot_diam); top y2r=h; z1=z2; dot(1,2);  % upper dot
pos3(dot_diam,0); pos4(dot_diam,90);
x3=x1; bot y4l=0; z3=z4; dot(3,4);  % lower dot
penlabels(1,2,3,4); endchar;
     
cmchar "'Anw tele'ia";
numeric dot_diam#; dot_diam#=if monospace: 5/4 fi\\ dot_size#;
define_whole_blacker_pixels(dot_diam);
beginchar(";",5u#,x_height#,0);
italcorr x_height#*slant+.5dot_diam#-2u#;
adjust_fit(0,0); pickup fine.nib;
pos1(dot_diam,0); pos2(dot_diam,90);
lft x1l=hround(.5w-.5dot_diam); top y2r=h; z1=z2; dot(1,2);  % upper dot
penlabels(1,2); endchar;
     
cmchar "Question mark";
numeric dot_diam#; dot_diam#=if monospace: 5/4 fi\\ dot_size#;
define_whole_blacker_pixels(dot_diam);
beginchar("?",5u#,x_height#,comma_depth#);
italcorr x_height#*slant+.5dot_diam#-2u#;
adjust_fit(0,0); pickup fine.nib;
pos1(dot_diam,0); pos2(dot_diam,90);
lft x1l=hround(.5w-.5dot_diam); top y2r=h; z1=z2; dot(1,2);  % upper dot
x3-.5dot_diam=hround(.5w-.5dot_diam); y3-.5dot_diam=0;
comma(3,a,dot_diam,.05u,comma_depth);  % lower dot and tail
penlabels(1,2,3); endchar;
     
cmchar "Equals sign";
compute_spread(.45x_height#,.55x_height#);
beginchar("=",14u#,v_center(spread#+rule_thickness#));
italcorr h#*slant-.5u#;
adjust_fit(0,0); pickup rule.nib;
lft x1=hround u-eps; x3=x1; x2=x4=w-x1;
y1=y2; y3=y4; y1-y3=spread; .5[y1,y3]=math_axis;
draw z1--z2;  % upper bar
draw z3--z4;  % lower bar
labels(1,2,3,4); endchar;
     
cmchar "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-2stem_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;
     
cmchar "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-2stem_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;
     
cmchar "Reverse apostrophe";
beginchar(oct"034",5u#,asc_height#,0);
italcorr asc_height#*slant+.5dot_size#-2u#;
adjust_fit(0,0);
x1-.5dot_size=hround(.5w-.5dot_size); y1+.5dot_size=h-comma_depth;
if monospace: ammoc(1,a,dot_size,.28u,vround 1.5comma_depth);  % large ammoc
else: ammoc(1,a,dot_size,.25u,comma_depth); fi  % normal ammoc
penlabels(1); endchar;
     
cmchar "Hyphen";
beginchar("-",6u#,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;
if monospace: x2=w-x1 else: lft x1=hround .2u-eps fi;
filldraw stroke z1e--z2e;  % bar
penlabels(1,2); endchar;
     
cmchar "En dash";
beginchar(oct"000",9u#,x_height#,0);
italcorr .61803x_height#*slant+.5u#;
adjust_fit(0,0);
pickup crisp.nib; pos1(vair,90); pos2(vair,90);
top y1r=top y2r=vround(.61803h+.5vair); lft x1=-eps; rt x2=w+eps;
filldraw stroke z1e--z2e;  % bar
penlabels(1,2); endchar;
     
cmchar "Em dash";
beginchar(oct"177",18u#,x_height#,0);
italcorr .61803x_height#*slant+.5u#;
adjust_fit(letter_fit#,letter_fit#);
pickup crisp.nib; pos1(vair,90); pos2(vair,90);
top y1r=top y2r=vround(.61803h+.5vair); lft x1=-eps; rt x2=w+eps;
filldraw stroke z1e--z2e;  % bar
penlabels(1,2); endchar;

cmchar "void char - compound word marker";
beginchar("v",eps*u#,x_height#,0);
%adjust_fit(0,0); 
%charwd:=0; r:=l-shrink_fit;
endchar;

cmchar "null char";
beginchar(159,eps*u#,0,0); % hexadecimal "9F
%adjust_fit(0,0); 
%charwd:=0; r:=l-shrink_fit;
endchar;


endinput;
