% File gmtr.mf
% Copyright 2001 Claudio Beccari
% version 1.0 (2001/03/24)
% Metric symbols and other special signs for greek critical editions
%
def m_width=.6[hair,stem] enddef;
def separator=max(1,vround(1/10x_height)) enddef;
dot_diam#=dot_size#;dot_diam=dot_size;

cmchar "English Opening quotes";
beginchar(oct"20",3u#+max(2u#,dot_diam#),asc_height#,0);
italcorr asc_height#*slant-.1u#;
adjust_fit(.5u#,.5u#);
x2+.5dot_diam=hround(w-.6u+.5dot_diam); y1+.5dot_diam=h-comma_depth;
x1=w-x2; y2=y1;
ammoc(1,a,dot_diam,.25u,comma_depth); % left dot and tail
ammoc(2,b,dot_diam,.25u,comma_depth); % right dot and tail
penlabels(1,2);currentbreadth:=0; 
 endchar;


cmchar "English Closing quotes";
beginchar(oct"021",3u#+max(2u#,dot_diam#),asc_height#,0);
italcorr asc_height#*slant+dot_diam#-4.1u#;
adjust_fit(.5u#,.5u#);
x1+.5dot_diam=hround(.6u+.5dot_diam); y2+.5dot_diam=h;
x2=w-x1; y2=y1;
comma(1,a,dot_diam,.25u,comma_depth); % left dot and tail
comma(2,b,dot_diam,.25u,comma_depth); % right dot and tail
penlabels(1,2);currentbreadth:=0; 
 endchar;

cmchar "German opening comma";
beginchar(oct"015",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);currentbreadth:=0; 
 endchar;


cmchar "Reversed comma";
beginchar(oct"016",5u#,dot_diam#,comma_depth#);
adjust_fit(0,0);
x1-.5dot_diam=hround(.5w-.5dot_diam); y1+.5dot_diam=h-d;
pickup fine.nib; pos1(dot_size,-90);
pos21(vair,90); pos22(vair,180); pos23(vair,-135);
  z21r=z1r; rt x22r=hround(x1+.5dot_size+u/4)+2eps; x23=x1-.5u;
  y22=1/3[y21,y23]; top y23r=vround(h);
  filldraw z1r{right}...z1l{left}...cycle; % dot
  filldraw stroke z21e{right}...z22e{up}...z23e;  % tail
penlabels(1,21,22,23); 
currentbreadth:=0; 
endchar;




cmchar "German closing comma";
beginchar(oct"023",5u#,asc_height#,0);
italcorr asc_height#*slant+.5dot_diam#-2u#;
adjust_fit(0,0);
x1-.5dot_diam=hround(.5w-.5dot_diam); y1+.5dot_diam=h-comma_depth;
if monospace: ammoc(1,a,dot_diam,.28u,vround 1.5comma_depth);  % large ammoc
else: ammoc(1,a,dot_diam,.25u,comma_depth); fi  % normal ammoc
penlabels(1); currentbreadth:=0; 
endchar;


cmchar "German Opening quotes";
beginchar(oct"022",3u#+max(2u#,dot_diam#),dot_diam#,comma_depth#);
italcorr asc_height#*slant+dot_diam#-4.1u#;
adjust_fit(.5u#,.5u#);
x2+.5dot_diam=hround(w-.6u+.5dot_diam); y2-.5dot_diam=0;
x1=w-x2; y2=y1;
comma(1,a,dot_diam,.25u,comma_depth); % left dot and tail
comma(2,b,dot_diam,.25u,comma_depth); % right dot and tail
penlabels(1,2); endchar;

currentbreadth:=0;


cmchar "corona";
beginchar(20,12u#,x_height#,0);
adjust_fit(0,0);
pos1(.7[hair,stem],180);
pos2(.7[hair,stem],90);
z1=z2;
bot y2l=-oo;lft x1r=.75u;
pos3(.7[hair,stem],0);
pos4(.7[hair,stem],90);
z3=z4;
y4=y2; rt x3r=w-lft x1r;
pos5(stem,90);
pos6(stem,90);pos7(stem,0);
z6=z7; x6=w/2; bot y6l=bot y2l;
z5=z6+whatever*(z6r-z6l); top y5r= (rt x3r-lft x1r+.7[hair,stem])/2; 
filldraw z7r...z6r...z7l...z6l...cycle;
filldraw double_circ_stroke z1e..z5e..z3e;
penlabels(1,2,3,4,5,6,7,8);
currentbreadth:=0; 
endchar;

cmchar "corona inversa";
beginchar(21,12u#,x_height#,0);
pos1(.7[hair,stem],180);
pos2(.7[hair,stem],90);
z1=z2;
lft x1r=.75u;
pos3(.7[hair,stem],0);
pos4(.7[hair,stem],90);
z3=z4;
y4=y2; rt x3r=w-lft x1r;
top y2r=(rt x3r-lft x1r+.7[hair,stem])/2;
pos5(stem,-90); x5=x6=w/2; bot y5r=-oo;
pos6(stem,90);pos7(stem,0);
z6=z7;top y6r=top y2r;
filldraw z7r...z6r...z7l...z6l...cycle;
filldraw double_circ_stroke z1e..z5e..z3e;
penlabels(1,2,3,4,5,6,7,8);
currentbreadth:=0; 
endchar;

cmchar "longa";
beginchar("l",12u#,x_height#,0);
adjust_fit(0,0)
pos1(stem,90); pos2(stem,90);
bot y1l=-oo=bot y2l; lft x1-stem/2=.75u; rt x2=w-x1;
filldraw double_circ_stroke z1e--z2e;
penlabels(1,2);
currentbreadth:=0; 
endchar;

cmchar "brevis";
beginchar("b",12u#,x_height#,0);
adjust_fit(0,0)
pos1(.7[hair,stem],180);
pos2(.7[hair,stem],90);
z1=z2;
lft x1r=.75u;
pos3(.7[hair,stem],0);
pos4(.7[hair,stem],90);
z3=z4;
y4=y2; rt x3r=w-lft x1r;
top y2r=(rt x3r-lft x1r+ .7[hair,stem])/2;
pos5(stem,-90); x5=w/2; bot y5r=-oo;
filldraw double_circ_stroke z1e..z5e..z3e;
penlabels(1,2,3,4,5);
currentbreadth:=0; 
endchar;

cmchar "dupla brevis";
beginchar("c",12u#,x_height#,0);
adjust_fit(0,10.5u#-.5[hair#,stem#]);
pos1(.7[hair,stem],180);
pos2(.7[hair,stem],90);
z1=z2;
lft x1r=.75u;
pos3(.7[hair,stem],0);
pos4(.7[hair,stem],90);
z3=z4;
y4=y2; rt x3r=w-lft x1r;
top y2r=(rt x3r-lft x1r+ .7[hair,stem])/2;
pos5(stem,-90); x5=w/2; bot y5r=-oo;
filldraw double_circ_stroke z1e..z5e..z3e;
picture savedpicture;
savedpicture:=currentpicture;
currentpicture:= currentpicture+savedpicture shifted (10.5u-.5[hair,stem],0);
penlabels(1,2,3,4,5,6);
currentbreadth:=0; 
endchar;

cmchar "brevis sublineata";
beginchar("d",12u#,x_height#,0);
adjust_fit(0,0)
pos1(.7[hair,stem],180);
pos2(.7[hair,stem],90);
z1=z2;
lft x1r=.75u;
pos3(.7[hair,stem],0);
pos4(.7[hair,stem],90);
z3=z4;
y4=y2; rt x3r=w-lft x1r;
top y2r=(rt x3r-lft x1r+ .7[hair,stem])/2;
pos5(stem,-90); x5=w/2; bot y5r=-oo;
filldraw double_circ_stroke z1e..z5e..z3e;
currentpicture:=currentpicture shifted(0,2stem);
pos11(stem,90); pos12(stem,90);
bot y11l=-oo=bot y12l; lft x11-stem/2=.75u; rt x12=w-x11;
filldraw double_circ_stroke z11e--z12e;
penlabels(1,2,3,4,5,11,12);
currentbreadth:=0; 
endchar;

cmchar "longa dupla brevis";
beginchar("e",12u#,x_height#,0);
adjust_fit(0,10.35u#-.5[hair#,stem#]);
pos1(.7[hair,stem],180);
pos2(.7[hair,stem],90);
z1=z2;
lft x1r=.75u;
pos3(.7[hair,stem],0);
pos4(.7[hair,stem],90);
z3=z4;
y4=y2; rt x3r=w-lft x1r;
top y2r=(rt x3r-lft x1r+ .7[hair,stem])/2;
pos5(stem,-90); x5=w/2; bot y5r=-oo;
filldraw double_circ_stroke z1e..z5e..z3e;
picture savedpicture;
savedpicture:=currentpicture;
currentpicture:= currentpicture+savedpicture shifted (10.35u-.5[hair,stem],0);
currentpicture:=currentpicture shifted(0,2stem);
pos11(stem,90); pos12(stem,90);
bot y11l=-oo=bot y12l; lft x11-stem/2=.75u; rt x12=w-x11+10.35u-.5[hair,stem];
filldraw double_circ_stroke z11e--z12e;
penlabels(1,2,3,4,5,6);
currentbreadth:=0; 
endchar;


cmchar "apicata longa dupla brevis";
beginchar("f",12u#,x_height#,0);
adjust_fit(0,14.5u#-.5[hair#,stem#]);
pos1(.7[hair,stem],180);
pos2(.7[hair,stem],90);
z1=z2;
lft x1r=.75u;
pos3(.7[hair,stem],0);
pos4(.7[hair,stem],90);
z3=z4;
y4=y2; rt x3r=w-lft x1r;
top y2r=(rt x3r-lft x1r+ .7[hair,stem])/2;
pos5(stem,-90); x5=w/2; bot y5r=-oo;
filldraw double_circ_stroke z1e..z5e..z3e;
picture savedpicture;
savedpicture:=currentpicture;
currentpicture:= currentpicture+savedpicture shifted (14.5u-.5[hair,stem],0);
pos21(.5[hair,stem],0); pos22(.5[hair,stem],0);
bot y21=-oo+hair/2;
bot y22r=x_height-2stem;
x21=x22=.5[x3,x1+14.5u-.5[hair,stem]];
filldraw double_circ_stroke z21e--z22e;
currentpicture:=currentpicture shifted(0,2stem);
pos11(stem,90); pos12(stem,90);
bot y11l=-oo=bot y12l; lft x11-stem/2=.75u; rt x12=w-x11+14.5u-.5[hair,stem];
filldraw double_circ_stroke z11e--z12e;
penlabels(1,2,3,4,5,6,11,12,21,22);
currentbreadth:=0; 
endchar;



cmchar"Longa sublineata breve";
beginchar(oct"153",12u#,x_height#,desc_depth#);
adjust_fit(0,0);
pos1(stem,90); pos2(stem,90);
bot y1l=-oo=bot y2l; lft x1-stem/2=.75u; rt x2=w-x1;
filldraw double_circ_stroke z1e--z2e;
pos3(.7[hair,stem],180);
pos4(.7[hair,stem],90);
z3=z4;
top y4r=-separator;lft x3r=.75u;
pos5(.7[hair,stem],0);
pos6(.7[hair,stem],90);
z5=z6;
y6=y4; rt x5r=w-lft x3r;
pos7(stem,-90); x7=w/2; top y7l=-d;
filldraw double_circ_stroke z3e...z7e...z5e;
penlabels(1,2,3,4,5,6,7);
currentbreadth:=0; 
endchar;


cmchar "brevis superlineata";
beginchar("i",12u#,x_height#,0);
adjust_fit(0,0)
pos1(.7[hair,stem],180);
pos2(.7[hair,stem],90);
z1=z2;
lft x1r=.75u;
pos3(.7[hair,stem],0);
pos4(.7[hair,stem],90);
z3=z4;
y4=y2; rt x3r=w-lft x1r;
top y2r=(rt x3r-lft x1r+ .7[hair,stem])/2;
pos5(stem,-90); x5=w/2; bot y5r=-oo;
pos6(stem,90); pos7(stem,90);
x6=x1r+stem/2;x5=.5[x6,x7]; y6=y7=y1+2stem;
filldraw double_circ_stroke z1e..z5e..z3e;
filldraw double_circ_stroke z6e--z7e;
penlabels(1,2,3,4,5,6,7);
currentbreadth:=0; 
endchar;

cmchar "dupla brevis superlineata";
beginchar("j",12u#,bar_height#+2stem#,0);
adjust_fit(0,9.5u#)
pos1(.7[hair,stem],180);
pos2(.7[hair,stem],90);
z1=z2;
lft x1r=.75u;
pos3(.7[hair,stem],0);
pos4(.7[hair,stem],90);
z3=z4;
y4=y2; rt x3r=w-lft x1r;
top y2r=(rt x3r-lft x1r+ .7[hair,stem])/2;
pos5(stem,-90); x5=w/2; bot y5r=-oo;
pos6(stem,90); pos7(stem,90);
x6=x1r+stem/2;x4=.5[x6,x7]; y6=y7=y1+2stem;
filldraw double_circ_stroke z1e..z5e..z3e;
addto currentpicture also currentpicture shifted (z3-z1);
filldraw double_circ_stroke z6e--z7e;
penlabels(1,2,3,4,5,6,7);
currentbreadth:=0; 
endchar;


cmchar "anceps";
beginchar("X",9.5u#,x_height#,0);
adjust_fit(0,0);
numeric Xstem; Xstem=m_width;
pos1(Xstem,135);pos2(Xstem,135);
pos3(Xstem,45); pos4(Xstem,45);
z0=.5[z1,z2]=.5[z3,z4];
bot y1l=oo; lft x1r=u;
y3=y1;x1+x3=w;
z0=z1+whatever*dir(45)=z3+whatever*dir(135);
filldraw double_circ_stroke z1e--z2e;
filldraw double_circ_stroke z3e--z4e;
penlabels(0,1,2,3,4);
currentbreadth:=0; 
endchar;

cmchar "anceps superlineata";
beginchar("Y",9.5u#,asc_height#,0);
adjust_fit(0,0);
numeric Xstem; Xstem=m_width;
pos1(Xstem,135);pos2(Xstem,135);
pos3(Xstem,45); pos4(Xstem,45);
z0=.5[z1,z2]=.5[z3,z4];
bot y1l=oo; lft x1r=u;
y3=y1;x1+x3=w;
z0=z1+whatever*dir(45)=z3+whatever*dir(135);
filldraw double_circ_stroke z1e--z2e;
filldraw double_circ_stroke z3e--z4e;
pos5(Xstem,90); pos6(Xstem,90);
x5=x4; x6=x2; y5l=y6l=y4r+stem;
filldraw double_circ_stroke z5e--z6e;
penlabels(0,1,2,3,4,5,6);
currentbreadth:=0; 
endchar;

cmchar "anceps dupla breve supersignata";
beginchar("Z",9.5u#,asc_height#,0);
adjust_fit(0,0);
numeric Xstem; Xstem=m_width;
pos1(Xstem,135);pos2(Xstem,135);
pos3(Xstem,45); pos4(Xstem,45);
z0=.5[z1,z2]=.5[z3,z4];
bot y1l=oo; lft x1r=u;
y3=y1;x1+x3=w;
z0=z1+whatever*dir(45)=z3+whatever*dir(135);
filldraw double_circ_stroke z1e--z2e;
filldraw double_circ_stroke z3e--z4e;
pos5(Xstem,0); pos6(Xstem,90); pos7(Xstem,180);
pos8(Xstem,0); pos9(Xstem,90); pos10(Xstem,180);
y5=y7=top y4r+.4(y4-y1)+Xstem/2; bot y6l=top y4r+Xstem/2;
x5l=x4l; x7=x0; x6=.5[x5,x7];
z8=z7=.5[z5,z10]; x0=.5[x6,x9]; y9=y6;
filldraw double_circ_stroke z5e{down}...z6e...{up}z7e;
filldraw double_circ_stroke z8e{down}...z9e...{up}z10e;
penlabels(0,1,2,3,4,5,6,7,8,9,10);
currentbreadth:=0; 
endchar;



cmchar"catalepsis";
beginchar("g", 10u#,0,desc_depth#);
adjust_fit(0,0);
pair za,zb; za=(w/2,0)-(0,-d);zb=za xscaled-1;
numeric cat_width;cat_width=.6[hair,stem];
pos1(cat_width,angle(za)+90);pos2(cat_width,angle(za)+90);
pos3(cat_width,angle(zb)-90);pos4(cat_width,angle(zb)-90);
lft x1r=.75u; rt x4r=w-lft x1r;
bot y1l=-d-oo; bot y4l=bot y1l;
z2=z3;x2=w/2;top y2r=h+oo;
filldraw double_circ_stroke z1e--z2e; filldraw double_circ_stroke z3e--z4e;
penlabels(1,2,3,4);
currentbreadth:=0; 
endchar;


cmchar "ipercatalepsis";
beginchar("h",8u#,asc_height#,0);
adjust_fit(0,0);
numeric ic_w,arm; ic_w=.6[hair,stem];arm=(3/4w-ic_w)/2;
z0=(w/2,h-arm);
pos1(ic_w,90); pos2(ic_w,90);
y0=y1=y2; x1=x0-arm; x0=.5[x1,x2];
pos3(ic_w,0); pos4(ic_w,0);
x3=x4=x0;y0=.5[y3,y4]; y4=y0+arm;
filldraw double_circ_stroke z1e--z2e; 
filldraw double_circ_stroke z3e--z4e; 
penlabels(0,1,2,3,4,5,6);
currentbreadth:=0; 
endchar;


cmchar "sinafia";
beginchar("s",6u#,asc_height#,0);
adjust_fit(.5u#,.5u#);
numeric sin_width,raggio; 
sin_width=.6[hair,stem];
pos1(sin_width,0); pos2(sin_width,90);pos3(sin_width,180);
pos4(sin_width,270);pos5(sin_width,0);
top y2r=h+00;top y4l=x_height-oo; raggio=(y2-y4)/2; z0=(w/2,.5[y2,y4]);
z5=z1=z0+(raggio,0); x2=x0=x4; z0=.5[z1,z3];
pos6(sin_width,0); pos7(sin_width,0);
z6=z4; x7=x6; y7=-oo-sin_width/2;
filldraw stroke z1e{up}...z2e...z3e...z4e...{up}z5e;
filldraw circ_stroke z7e--z6e;
penlabels(0,1,2,3,4,5,6,7);
currentbreadth:=0; 
endchar;


cmchar "uncinata clausa";
beginchar(">",8u#,asc_height#,desc_depth#);
adjust_fit(0,0);
numeric q_w,angolo; q_w=.5[hair,stem];angolo=55;
pos1(q_w,0); x1r=w-.75u; y1r=.5[h,-d];
pos2(q_w,90-angolo);
z2=z1+whatever*dir(-angolo);x2l=.75u;
pos3(q_w,-90+angolo); z3=z1+whatever*dir(angolo); x3l=x2l;
filldraw stroke z2e--z1e--z3e;
penlabels(1,2,3,4);
currentbreadth:=0; 
endchar;


cmchar "uncinata aperta";
beginchar("<",8u#,asc_height#,desc_depth#);
adjust_fit(0,0);
numeric q_w,angolo; q_w=.5[hair,stem];angolo=55;
pos1(q_w,180); x1r=.75u; y1r=.5[h,-d];
pos2(q_w,angolo+90);
z2=z1+whatever*dir(angolo);x2l=w-.75u;
pos3(q_w,-90-angolo); z3=z1+whatever*dir(-angolo); x3l=x2l;
filldraw stroke z2e--z1e--z3e;
penlabels(1,2,3,4);
currentbreadth:=0; 
endchar;



cmchar "quadra aperta";
beginchar("[",6u#,asc_height#,desc_depth#);
adjust_fit(0,0);
numeric q_w; q_w=.6u;
z1=.5[z1r,z1l]; z1l=z1r-(0,q_w);
z2=.5[z2r,z2l]; z2l=(x2r+q_w,y2r-q_w);
z3=.5[z3r,z3l]; z3l=(x3r+q_w,y3r+q_w); 
z4=.5[z4r,z4l]; z4l=z4r+(0,q_w);
x1=x4=w-.75u; x2r=x3r=.75u;
y1=y2=1.05h;y3r=y4r=-d;
filldraw stroke z1e--z2e--z3e--z4e;
penlabels(1,2,3,4);
currentbreadth:=0; 
endchar;


cmchar "quadra clausa";
beginchar("]",6u#,asc_height#,desc_depth#);
adjust_fit(0,0);
numeric q_w; q_w=.6u;
z1=.5[z1r,z1l]; z1l=z1r-(0,q_w);
z2=.5[z2r,z2l]; z2l=z2r-(q_w,q_w);
z3=.5[z3r,z3l]; z3l=z3r+(-q_w,q_w); 
z4=.5[z4r,z4l]; z4l=z4r+(0,q_w);
x1=x4=.75u; x2r=x3r=w-.75u;
y1=y2=1.05h;y3r=y4r=-d;
filldraw stroke z1e--z2e--z3e--z4e;
penlabels(1,2,3,4);
currentbreadth:=0; 
endchar;


cmchar "media quadra aperta inferior";
beginchar("!",4u#,bar_height#,desc_depth#+.6stem#);
adjust_fit(0,0);
numeric q_w; q_w=.4[hair,stem];
pos2(q_w,180);
z3=.5[z3r,z3l]; z3l=(x2l,y4l);
pos4(q_w,-90);
x4=4.5u+x2r; x2=x3=.65w;
y2=h;y3r=y4r=-d; 
filldraw stroke z2e--z3e--z4e;
penlabels(1,2,3,4);
currentbreadth:=0; 
endchar;

cmchar "media quadra aperta superior";
beginchar("?",4u#,asc_height#+.75stem#,0);
adjust_fit(0,0);
numeric q_w; q_w=.4[hair,stem];
pos2(q_w,180);
z3=.5[z3r,z3l]; z3l=(x2l,y4l);
pos4(q_w,90);
x4=4.25u+x2; x2=x3=.65w;
y2=bar_height;y3=y4=h;
filldraw stroke z2e--z3e--z4e;
penlabels(1,2,3,4);
currentbreadth:=0; 
endchar;


cmchar "media quadra clausa inferior";
beginchar(":",4u#,bar_height#,desc_depth#+.6stem#);
adjust_fit(0,0);
numeric q_w; q_w=.4[hair,stem];
pos2(q_w,0);
z3=.5[z3r,z3l]; z3l=(x2l,y4l);
pos4(q_w,-90);
x4=-4.5u+x2r; x2=x3=.65w;
y2=h;y3r=y4r=-d;
filldraw stroke z2e--z3e--z4e;
penlabels(1,2,3,4);
currentbreadth:=0; 
endchar;

cmchar "media quadra clausa superior";
beginchar(";",4u#,asc_height#+.75stem#,0);
adjust_fit(0,0);
numeric q_w; q_w=.4[hair,stem];
pos2(q_w,0);
z3=.5[z3r,z3l]; z3l=(x2l,y4l);
pos4(q_w,90);
x4=-4.5u+x2r; x2=x3=.65w;
y2=bar_height;y3=y4=h;
filldraw stroke z2e--z3e--z4e;
penlabels(1,2,3,4);
currentbreadth:=0; 
endchar;


cmchar "Finis Carmen";
beginchar("F", asc_height#+desc_depth#+1.5u#,asc_height#,desc_depth#);
adjust_fit(0,0);
numeric raggio; raggio=(h+d)/2-m_width/2;
z0=(w/2,.5[h,-d]);
pos1(m_width,0);pos2(m_width,90);pos3(m_width,180);pos4(m_width,270);pos5(m_width,360);
z0=.5[z1,z3]=.5[z2,z4]=.5[z6,z7]=.5[z8,z9]; z1=z5;
z1=z0+(raggio,0); z2=z0+(0,raggio);
pos6(m_width,135);pos7(m_width,135);
z6=z0+(raggio,0)rotated45;
pos8(m_width,45);pos9(m_width,45);
z8=z0+(raggio,0)rotated-45;
filldraw stroke z1e...z2e...z3e...z4e...z5e;
filldraw stroke z6e--z7e;
filldraw stroke z8e--z9e;
penlabels(0,1,2,3,4,5,6,7,8,9);
currentbreadth:=0; 
endchar;


cmchar "circumflexus latinus";
beginchar("^",8u#,0,desc_depth#);
adjust_fit(0,0);
numeric chair; chair=.5[hair,stem];
numeric angolo; angolo=angle((w/2,0)-(0,-d));
pos1(chair,angolo+90);
pos2(chair/(cosd angolo),90);
pos3(chair,90-angolo);
x2=w/2=.5[x1r,x3r]; top y2r=h; bot y1l=y3l=-d;
lft x1r=.5u;
filldraw double_circ_stroke z1e--z2e--z3e;
penlabels(1,2,3);
currentbreadth:=0; 
endchar;


cmchar "Left parenthesis";
beginchar("(",7u# if monospace: -u# fi,body_height#,paren_depth#);
italcorr body_height#*slant-.5u#;
adjust_fit(u#,-u#); 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); currentbreadth:=0;
currentbreadth:=0; 
endchar;

cmchar "Right parenthesis";
beginchar(")",7u# if monospace: -u# fi,body_height#,paren_depth#);
italcorr math_axis#*slant-.5u#;
adjust_fit(0,-u#); 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);currentbreadth:=0;
currentbreadth:=0; 
endchar;

currentbreadth:=0;

cmchar "Crux";
beginchar(oct"171",8u#,asc_height#,desc_depth#);
adjust_fit(0,0); 
numeric bstem; bstem=1.3stem;
pos1(bstem,0); pos2(thin_join,0); pos3(1.2bstem,0); pos4(hair,0); pos7(hair,0);
pos5(bstem,90); pos2'(thin_join,90); pos6(bstem,90); z2'=z2;
x1=x2=x3=x4=x7; x1-.5stem=hround(.5w-.5stem); center_on(x1);
x5-.5stem=hround u; x6=w-x5;
y1+.5stem=h+oo; y2=y5=y6; y3=.57y2; bot y4=-d+hair;
y5+.5stem=floor(x_height+.5stem);y3=.5[y2,y7];
filldraw circ_stroke z1e{down}..z2e{down}..z3e; % upper stem
filldraw circ_stroke z4e--z7e{up}..z3e;%          lower stem
filldraw circ_stroke z5e{right}..{right}z2'e;  % left bulb
filldraw circ_stroke z6e{left}..{left}z2'e;  % right bulb
penlabels(1,2,3,4,5,6,7); currentbreadth:=0; 
endchar;



% minimum distance between vowel and accent
def separator=max(1,vround(x_height/10)) enddef;

def grave(expr center) =
numeric acc_sgn,acc_displ; acc_displ:=center;
  acc_sgn:=+1;
generate_grave;
enddef;

def acute(expr center) =
numeric acc_sgn,acc_displ; acc_displ:=center;
  acc_sgn:=-1;
generate_grave;
enddef;

% The next definition draws both the grave (as its name suggests) and the
% acute accents, the difference being the value of acc_sgn, where
% acc_sgn=+1 tilts the accent to the left (grave)
% acc_sgn=-1 tilts the accent to the right (acute)
% acc_sgn=0 does not tilt the accent (monotoniko)

vardef generate_grave=
  numeric accent_tilt, alto, basso; accent_tilt:=30;
  alto:=h;  basso:=vround .8[h,x_height];
  1/3[x22,x21]=acc_displ;
  accent_tilt:= acc_sgn*(accent_tilt+angle(alto-basso,.5currentbreadth));
  pos22(max(stem/5,currentbreadth+eps),accent_tilt); pos21(stem,accent_tilt);
  bot y22=basso; top y21+.5stem=alto;
  z21-z22=whatever*dir(90+accent_tilt);
  filldraw circ_stroke z21e--z22e;  % diagonal
penlabels(21,22);
currentbreadth:=0;
enddef;


cmchar "Left apex";
beginchar("`",4u#,acc_ht#,0);
adjust_fit(0,0);
numeric center;
numeric acc_sgn; acc_sgn:=+1;
grave(2/3w);
currentbreadth:=0; 
endchar;

cmchar "Right apex";
beginchar("'",4u#,acc_ht#,0);
adjust_fit(0,0);
numeric center;
numeric acc_sgn; acc_sgn:=-1;
acute(2/3w);
currentbreadth:=0; 
endchar;


cmchar "Hyatus";
beginchar("H",6u#,asc_height#,0);
adjust_fit(0,0);
numeric Hstem, Hd; Hstem=.5stem; Hd=.37h;
pos1(Hstem,0);pos2(Hstem,0);pos3(Hstem,0);pos4(Hstem,0);pos5(Hstem,90);pos6(Hstem,90);
top y1=top y3=h; bot y2=bot y4=Hd; y5=y6=.55[bot y2, top y1];
lft x1l = lft x2l = x5= w-rt x3r=w-rt x4r= w-x6= .75u;
filldraw stroke z1e--z2e;
filldraw stroke z3e--z4e;
filldraw stroke z5e--z6e;
currentpicture:=currentpicture shifted (0,.5bar_height);
penlabels(1,2,3,4,5,6);
currentbreadth:=0; 
endchar;


cmchar "Ring";
beginchar(oct"032",4u#,0,desc_depth#);
adjust_fit(0,0);
numeric raggio,rw ; raggio=(d/2-separator); rw=.25[fine,stem];
pickup pencircle  scaled rw;
z0=(w/2,-separator-raggio-rw);
.5[z1,z2]=z0;z1=z0+(0,1.05raggio);
draw z1...z2...cycle; 
penlabels(0,1,2,3,4,5);
currentbreadth:=0; 
endchar;


cmchar "Dot";
beginchar(oct"033",3u#,0,desc_depth#);
adjust_fit(0,0);
numeric raggio,rw ; raggio=stem; rw=.3stem;  
z0=(w/2,-separator-raggio);
pos1(rw,0); pos2(rw,90 );pos3(rw,180); pos4(rw,-90 ); 
z1r-z0=(raggio,0); z2r-z0=(0,raggio); 
z0=.5[z1,z3]=.5[z2,z4];
filldraw  z1r...z2r...z3r...z4r...cycle;
penlabels(0,1,2,3,4,5);
currentbreadth:=0; 
endchar;


cmchar"Hemiobelion";
beginchar("A",7.5u#,x_height#,0);
adjust_fit(0,0);
z0=(w/2+.75u,h/2);
numeric raggio; raggio=h/2-m_width/2;
pos1(m_width,60); pos2(m_width,-60); pos3(m_width,180);
z1=z0+raggio*dir(60); z2=z0+raggio*dir(-60); z3=z0-(raggio,0);
filldraw double_circ_stroke z1e...z3e...z2e;
penlabels(0,1,2,3);
currentbreadth:=0; 
endchar;

cmchar"Tetartemorion";
beginchar("B",7.5u#,x_height#,0);
adjust_fit(0,0);
z0=(w/2-.75u,h/2);
numeric raggio; raggio=h/2-m_width/2;
pos1(m_width,120); pos2(m_width,-120); pos3(m_width,0);
z1=z0+raggio*dir(120); z2=z0+raggio*dir(-120); z3=z0+(raggio,0);
filldraw double_circ_stroke z1e...z3e...z2e;
penlabels(0,1,2,3);
currentbreadth:=0; 
endchar;

cmchar"Stater";
beginchar("C",8u#,asc_height#,0);
adjust_fit(0,0);
z0=(w/2,h/2)=.5[z1,z4]=.5[z2,z3]; z.a=dir(-10); z.b=dir(40);
pos2(m_width,angle(z.a)-90);pos3(m_width,angle(z.a)-90);
pos22(m_width,angle(z.b)+90);pos33(m_width,angle(z.b)+90);
z22=z2;z33=z3;
z2=z0+whatever*z.a; x22r=.75u=x4r; 
pos1(m_width,angle(z.b)+90);pos4(m_width,angle(z.b)+90);
z4=z3+whatever*z.b; 
filldraw double_circ_stroke z1e--z22e;
filldraw double_circ_stroke z2e--z3e;
filldraw double_circ_stroke z33e--z4e;
penlabels(0,1,2,3,4,5,6,7,22,33);
currentbreadth:=0; 
endchar;

cmchar"Dracma";
beginchar("D",10u#,cap_height#,0);
adjust_fit(0,0);
pos1(m_width,0);pos2(m_width,0);pos3(m_width,90);pos4(m_width,90);
x1l=.75u=x2l=w-x4; y1=0;y2=h;
filldraw stroke z1e--z2e;
y3=y4=h/2; x3=x1; 
filldraw stroke z3e--z4e;
penlabels(1,2,3,4,5);
currentbreadth:=0; 
endchar;

cmchar"Denarius";
beginchar("E",14u#,asc_height#,0);
adjust_fit(0,0);
z0=(w/2,h/2)=.5[z1,z4]=.5[z2,z5]=.5[z3,z6];
numeric raggio; raggio=max(w/2,h/(2cosd45))-m_width/2;
z1=z0+raggio*dir(45); z2=z0+raggio*dir(135); z3=z0+whatever*dir(180); x3=x2;
pos1(m_width,angle(z1-z0)+90);
pos2(m_width,angle(z2-z0)+90);
pos3(m_width,angle(z3-z0)+90);
pos4(m_width,angle(z1-z0)+90);
pos5(m_width,angle(z2-z0)+90);
pos6(m_width,angle(z3-z0)+90);
filldraw double_circ_stroke z1e--z4e;
filldraw double_circ_stroke z2e--z5e;
filldraw double_circ_stroke z3e--z6e;
penlabels(0,1,2,3,4,5,6,7,8);
currentbreadth:=0; 
endchar;


cmchar"Etos";
beginchar("G",11.75u#,x_height#,0);
adjust_fit(0,0);
pos1(m_width,0); pos2(m_width,0); pos3(m_width,90); pos4(m_width,90);
z2=z3; x1l=x2l=.75u; y1=1.25h; y3l=y4l=0; x4-x3=y1-y2;
filldraw double_circ_stroke z1e--z2e;
filldraw double_circ_stroke z3e--z4e;
penlabels(1,2,3,4);
currentbreadth:=0; 
endchar;

cmchar"slopingzeugma";
beginchar(oct"170",17u#,asc_height#,0);
adjust_fit(0,0);
z1r=(.75u,.8[x_height,h]);
z3r=(w-x1r,x_height);
numeric angolo; angolo=angle((z3r-z1r));
y2r=h;z2r=(w/2,x_height)+whatever*dir(90-2angolo);
pos1(m_width,135+angolo);
pos2(stem,90); 
pos3(m_width,45+angolo); 
filldraw double_circ_stroke z1e..z2e{right}..z3e;
currentpicture:=currentpicture shifted (0,(h-x_height)/2);
penlabels(0,1,2,3,4,5);
endchar;

cmchar"raisingzeugma";
beginchar(oct"172",17u#,asc_height#,0);
adjust_fit(0,0);
z1r=(.75u,x_height);
z3r=(w-x1r,.8[x_height,h]);
numeric angolo; angolo=angle((z3r-z1r));
y2r=h;z2r=(w/2,x_height)+whatever*dir(90-2angolo);
pos1(m_width,135+angolo);
pos2(stem,90); 
pos3(m_width,45+angolo); 
filldraw double_circ_stroke z1e..z2e{right}..z3e;
currentpicture:=currentpicture shifted (0,(h-x_height)/2);
penlabels(0,1,2,3,4,5);
endchar;



cmchar"Base eolica 2";
beginchar(oct"111",14u#,x_height#,0);
adjust_fit(0,0);
pickup pencircle scaled m_width;
.5[z0,z1]=(w/2,h/2); y0=h/2; x1-x0=w/2;
numeric raggio; raggio=(x1-x0)/2-m_width;
z0=.5[z2,z3];z1=.5[z4,z5];
z2=z0+(0,raggio);z4=z1+(0,raggio);
draw z2{right}...z3{left}...cycle;
draw z4{right}...z5{left}...cycle;
penlabels(0,1,2,3,4,5,6,7,8);
currentbreadth:=o;
endchar;

cmchar"Base eolica 3";
beginchar(oct"112",21u#,x_height#,0);
adjust_fit(0,0);
pickup pencircle scaled m_width;
z10=(3.5u,h/2); z11=z10+(7u,0); z12=z11+(7u,0);
numeric raggio; raggio=(x11-x10)/2-m_width;
z10=.5[z2,z3];z11=.5[z4,z5];z12=.5[z6,z7];
z2=z10+(0,raggio);z4=z11+(0,raggio);z6=z12+(0,raggio);
draw z2{right}...z3{left}...cycle;
draw z4{right}...z5{left}...cycle;
draw z6{right}...z7{left}...cycle;
penlabels(0,1,2,3,4,5,6,7,8,10,11,12);
currentbreadth:=o;
endchar;

cmchar"Base eolica 4";
beginchar(oct"113",28u#,x_height#,0);
adjust_fit(0,0);
pickup pencircle scaled m_width;
z10=(3.5u,h/2); z11=z10+(7u,0); z12=z11+(7u,0);z13=z12+(7u,0);
numeric raggio; raggio=(x11-x10)/2-m_width;
z10=.5[z2,z3];z11=.5[z4,z5];z12=.5[z6,z7];z13=.5[z8,z9];
z2=z10+(0,raggio);z4=z11+(0,raggio);z6=z12+(0,raggio);z8=z13+(0,raggio);
draw z2{right}...z3{left}...cycle;
draw z4{right}...z5{left}...cycle;
draw z6{right}...z7{left}...cycle;
draw z8{right}...z9{left}...cycle;
penlabels(0,1,2,3,4,5,6,7,8,9,10,11,12,13);
currentbreadth:=o;
endchar;

ligtable oct"111": oct"111"=:oct"112";
ligtable oct"112": oct"111"=:oct"113";


endinput;
