% This is  LOWERPQR.MF
% Version 1.1a 
% Date 13-MAR-1992
% 
% (c) 1991, 1992 by J"org Knappen. See fc.rme for copying conditions
% This file is part of the fc-package 
% See fc.rme for more information
%
% J"org Knappen
% Institut f"ur Kernphysik
% Postfach 39 80
% D-W 6500 Mainz
% knappen@vkpmzd.kph.uni-mainz.de

% Contents:
%
% The following characters are generated without condition:
%
% p, q, r
%
% And the following on demand, i. e. if their code is known:
%
% hooktop_p
%
% Higher versions of this file might include more characters.

cmchar "The letter p";
beginchar("p",10u#+serif_fit#,x_height#,desc_depth#);
italcorr .5x_height#*slant+min(.5curve#-.85u#,-.1u#);
adjust_fit(serif_fit#,0);
pickup tiny.nib; pos1(stem',0); pos2(stem,0);
pos0'(stem',0); pos0(stem,0); z0l=z0'l; x0'=x1; x0=x2;
lft x1l=hround(2.5u-.5stem'); top y1=h if serifs: +min(oo,serif_drop) fi;
numeric edge; edge=rt x2r;
pickup fine.nib; pos3(if hefty:thin_join else: hair fi,180);
pos4(vair',90); pos5(curve,0); pos6(vair,-90); penpos7(x3l-x3r,-180);
rt x3l=max(rt x3l-(lft x3r-tiny.lft x2l), 1/3[rt x2,edge]);
y3=1/8[bar_height,x_height];
x4l=w-.5(w-serif_fit)+.5u; top y4r=x_height+oo;
rt x5r=hround min(w-1.35u+.5curve,w-.6u); y5=.5x_height;
x6l=x4l-.2u; bot y6r=-oo;
x7=x3; y7=min(y3,y6+y4-y3+.6vair);
(x,y4r)=whatever[z3l,z4l]; x4r:=min(x,.5[x5r,x4]);
(x',y6r)=whatever[z7l,z6l]; x6r:=min(x',.5[x5r,x6]);
filldraw stroke z3e{up}...{right}z4e&super_arc.e(4,5)
 &super_arc.e(5,6)&z6e{left}...{up}z7e;  % bowl
y0=ypart(((edge,h)--(edge,0))intersectionpoint(z3l{up}...{right}z4l));
pickup tiny.nib; bot y2=-d;
filldraw stroke z1e--z0'e--z0e--z2e;  % stem
pickup crisp.nib; pos8(hair,0); pos7'(stem,0);
z7'=z2; x8l=x7'l; bot y8=0;
filldraw stroke z7'e--z8e;  % point
if serifs: sloped_serif.l(1,0',a,1/3,jut,serif_drop);  % upper serif
 dish_serif(2,0,b,1/3,jut,c,1/3,jut); fi  % lower serif
picture savedpicture; savedpicture:=currentpicture;
penlabels(0,1,2,3,4,5,6,7,8); endchar;

iff known hooktop_p:
cmchar "The letter hooktop p"; % jk
beginchar(hooktop_p,10u#+serif_fit#,asc_height#,desc_depth#);
italcorr asc_height#*slant;
adjust_fit(serif_fit#,0);
currentpicture:=savedpicture;
%if serifs:
pickup tiny.nib;
pos0(stem,180); pos1(stem,180); pos2(vair,90); 
pos3(hair,0); pos4(flare,0);
x0=x1=hround w-.5(w-serif_fit)+.5u; y1=.8h; y0=x_height; 
x2=.4[x1,x3]; top y2r=h+oo;
rt x3r=hround(w-.7u); y4=.85h;
filldraw z2r{left}...{down}z1r--z0r--z0l--z1l{up}...{right}z2l--cycle;
bulb(2,3,4);
%else:
%fi                 
penlabels(0,1,2,3,4); endchar;

savedpicture:=nullpicture;


cmchar "The letter q";
beginchar("q",10u#+serif_fit#,x_height#,desc_depth#);
italcorr x_height#*slant-serif_fit#+.5stem#-2u# if serifs:+.5u# fi;
adjust_fit(0,serif_fit# if serifs: -.5u# fi);
pickup tiny.nib; pos1(stem',0); pos2(stem,0);
pos0'(stem',0); pos0(stem,0); z0r=z0'r; x0'=x1; x0=x2;
rt x1r=hround(w-2.5u+.5stem');
numeric edge; edge=lft x2l;
pickup fine.nib; pos3(if hefty:thin_join else: hair fi,0);
pos4(vair',90); pos5(curve,180); pos6(vair,270); penpos7(x3r-x3l,360);
lft x3l=min(lft x3l-(rt x3r-tiny.rt x2r),2/3[lft x2,edge]); y3=bar_height;
x4l=.5(w-serif_fit)-.3u; top y4r=x_height+oo;
lft x5r=hround max(1.35u-.5curve,.6u); y5=.5x_height;
x6l=x4l-.2u; bot y6r=-oo; y7=min(y3,y6+y4-y3+.6vair);
lft x7l=min(lft x7l-(rt x7r-tiny.rt x2r),1/3[lft x2,edge]);
(x,y4r)=whatever[z3l,z4l]; x4r:=max(x,.5[x5r,x4]);
(x',y6r)=whatever[z7l,z6l]; x6r:=max(x',.5[x5r,x6]);
filldraw stroke z3e{up}...{left}z4e&super_arc.e(4,5)
 &super_arc.e(5,6)&z6e{right}...{up}z7e;  % bowl
y1=ypart(((edge,h)--(edge,0))intersectionpoint(z3l{up}...{left}z4l));
y0=ypart(((edge,h)--(edge,0))intersectionpoint(z6l{right}...{up}z7l));
pickup tiny.nib; bot y2=-d;
filldraw stroke z1e--z0'e--z0e--z2e;  % stem
pickup crisp.nib;
pos8(hround(hair-stem_corr),0); pos7'(stem',0);
z7'=z1; x8r=x7'r; top y8=h+oo;
filldraw stroke z7'e--z8e;  % point
if serifs: dish_serif(2,0,b,1/3,jut,c,1/3,jut); fi  % lower serif
penlabels(0,1,2,3,4,5,6,7,8); endchar;

cmchar "The letter r";
numeric r_flare#; r_flare#=.75[if serifs: stem# else: vair# fi,flare#];
define_whole_blacker_pixels(r_flare);
beginchar("r",if serifs:max(7u#,5.5u#+r_flare#) else:6.5u# fi,x_height#,0);
italcorr x_height#*slant if not serifs: +.25u# fi;
adjust_fit(serif_fit#,0);
pickup fine.nib; top y4r=h+oo;
if serifs: pos4(vair,90); pos5(hair,0);
 x4=w-max(1.75u,.25u+r_flare);
 rt x5r=hround(w-.5u+.5); y5+.5r_flare=.9[bar_height,h]+oo;
 pos6(r_flare,0); bulb(4,5,6);  % bulb
else: pos4(r_flare,90); rt x4=hround(w-.25u); fi
pos3(thin_join,180); rt x3l=hround(2.5u-.5stem')+stem'; top y3=bar_height;
filldraw stroke z3e{up}...{right}z4e;  % arc
pickup tiny.nib; pos0(stem',0); pos2(stem',0);
pos1(hround(stem-3stem_corr),0); top y1=h+min(oo,serif_drop);
pos0'(hround(stem-3stem_corr),0); y0=y0'=y3; x1l=x0l=x0'l=x2l;
lft x1l=hround(2.5u-.5stem'); bot y2=0;
filldraw stroke z1e--z0'e--z0e--z2e;  % stem
if serifs: sloped_serif.l(1,0',a,1/3,jut,serif_drop);  % upper serif
 dish_serif(2,0,b,1/3,jut,c,1/3,1.25jut); fi  % lower serif
penlabels(1,2,3,4,5,6); endchar;

endinput;
