cmchar "Uppercase koppa";
beginchar(Koppa,11u#,cap_height#,0);
italcorr .5cap_height#*slant-.5u#;
adjust_fit(0,0);
numeric shaved_stem,light_curve;
shaved_stem=cap_stem-hround 2stem_corr;
light_curve=cap_curve-hround stem_corr;
pickup tiny.nib; pos1(shaved_stem,0); pos2(shaved_stem,0);
lft x1l=lft x2l=hround(.5w-.5cap_stem); y1=y5; bot y2=0;
penpos3(vair,90); penpos5(vair,-90);
penpos4(light_curve,180); penpos6(light_curve,0);
x4r=hround u; x6r=w-x4r; x3=x5=.5w;
y3r=vround(h+o); y4=y6=.5[y3,y5];
y5r=vround(.30h if serifs:+slab fi);
penstroke pulled_arc.e(3,4) & pulled_arc.e(4,5)
 & pulled_arc.e(5,6) & pulled_arc.e(6,3) & cycle;  % bowl
if serifs: dish_serif(2,1,c,1/3,1.25cap_jut,d,1/3,1.25cap_jut); fi
filldraw stroke z1e--z2e; % stem
math_fit(-.5cap_height#*slant-.5u#,ic#); penlabels(1,2,3,4,5,6); endchar;

def dims = 9.5u#,x_height#,desc_depth# enddef;
def ital = 0 enddef;
def fit_params = 0,0 enddef;

% Elements borrowed from phi and tail of eta
def gen_letter =
  pickup fine.nib;
  lft x4r=w-rt x8r=hround .75u; y4r=y8r=.5h;
  x6r=.5[x4r,x8r]; bot y6r=-oo;
  numeric tilt; tilt:=min(2*otilt,.5);
  filldraw stroke gr_arc.e(6,7,8)(vair,stem,tilt) ; 
%  filldraw stroke gr_arc.e(4,5,6)(vair,.4[vair,stem],tilt) ; 
  filldraw stroke gr_arc.e(4,5,6)(vair,stem,tilt) ; 
  top y2r = h + o; x2r=x6r;
%  filldraw stroke gr_arc.e(2,3,4)(vair,.4[vair,stem],tilt) ; 
% Can't remember why I lightened up the northwest side of this.
% It doesn't seem like a good idea now.
  filldraw stroke gr_arc.e(2,3,4)(vair,stem,tilt) ; 
  filldraw stroke gr_arc.e(8,1,2)(vair,stem,tilt) ; 
  pos10(stem,180); pos11(.4[vair,stem],180); % Thicken a bit at join
  y10-.5stem=-d-o; y11=y6; x10=x11=x6;
  filldraw circ_stroke z10e..z11e{up};
enddef;

cmchar "Lowercase koppa";
beginchar(koppa,dims);
this_letter; penlabels(1,2,3,4,5,6,7,8,9,10,11,12,20,21); endchar;

picture savedpicture; % erase it

