% This is  ITALFGH.MF
% Version 1.0a 
% Date 8-SEP-1991
% 
% (c) 1991 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:
%
% f (straight f), g (you can choose between two glyphs by the means of
% |variant_g:=true| or |false|. |true| is default.), h
%
% And the following on demand, i. e. if their code is known:
%
% long_f, g_dot, ipa_gamma, crossed_h
%
% Higher versions of this file might include more characters.

cmchar "Italic letter straight f";   % from cm (f)
beginchar("f",max(1.5u#,stem#)+max(3.5u#,2flare#),asc_height#,desc_depth#);
italcorr asc_height#*slant+.75u#;
adjust_fit(if monospace:u#,u# else: 0,0 fi); pickup fine.nib;
numeric theta; z88=(.5w-.5u,h); z89=(.5w+.5u,0); theta=angle(z88-z89);
pos0(flare,0); pos1(hair,0); pos2(vair,90);
pos3(.5[hair,stem],180); pos4(stem,theta+90);
pos5(stem,theta-90); 
rt x1r=hround(w+.25u);  x2=.6[x1,x4];
top y2r=h+oo;
y4=.25[x_height,h]; bot y5=-d-oo;
z4=whatever[z88,z89]; z5=whatever[z88,z89];
x3=.8[x2+x4-x88,x88];  y3=.8[y4,y2];  y0+.5vair=.5[x_height,h];
bulb(2,1,0);   % bulb
filldraw stroke z2e{left}...z3e...{z89-z88}z4e;  % upper arc
filldraw z4r--z5l--z5r--z4l--cycle;  % stem
pickup crisp.nib; pos20(bar,90); pos21(bar,90);
top y20r=top y21r=x_height;
lft x20=lft x4r-.5stem-u; rt x21=rt x4l+.5stem+1.5u;
filldraw stroke z20e--z21e;  %  crossbar
math_fit(desc_depth#*slant+u#,x_height#*slant);
penlabels(0,1,2,3,4,5,20,21,88,89); endchar;


iff known long_f:
cmchar "Italic letter long f";   % from cm (f)
beginchar(long_f,max(1.5u#,stem#)+max(3.5u#,2flare#),asc_height#,desc_depth#);
italcorr asc_height#*slant+.75u#;
adjust_fit(if monospace:u#,u# else: 0,0 fi); pickup fine.nib;
numeric theta; z88=(.5w-.5u,h); z89=(.5w+.5u,-d); theta=angle(z88-z89);
pos0(flare,0); pos1(hair,0); pos2(vair,90);
pos3(.5[hair,stem],180); pos4(stem,theta+90);
pos5(stem,theta-90); pos6(.5[hair,stem],0);
pos7(vair,-90); pos8(hair,-180); pos9(flare,-180);
rt x1r=hround(w+.25u); lft x8r=hround-.35u; x2=.6[x1,x4]; x7=.6[x8,x5];
y9-.5flare=vround -.85d; y2-y0=y9-y7; top y2r=h+oo; bot y7r=-d-oo;
y4=.25[x_height,h]; y5=.5[-d,y4];
z4=whatever[z88,z89]; z5=whatever[z88,z89];
x3=.8[x2+x4-x88,x88]; x6=.8[x7+x5-x89,x89]; y3=.8[y4,y2]; y6=.8[y5,y7];
bulb(2,1,0); bulb(7,8,9);  % bulbs
filldraw stroke z2e{left}...z3e...{z89-z88}z4e;  % upper arc
filldraw z4r--z5l--z5r--z4l--cycle;  % stem
filldraw stroke z5e{z89-z88}...z6e...{left}z7e;  % lower arc
pickup crisp.nib; pos20(bar,90); pos21(bar,90);
top y20r=top y21r=x_height;
lft x20=lft x4r-.5stem-u; rt x21=rt x4l+.5stem+1.5u;
filldraw stroke z20e--z21e;  %  crossbar
math_fit(desc_depth#*slant+u#,x_height#*slant);
penlabels(0,1,2,3,4,5,6,7,8,9,20,21,88,89); endchar;

iff variant_g:
cmchar "Italic letter g";
beginchar("g",8u#,x_height#,desc_depth#);
italcorr x_height#*slant+.5stem#-u#;
adjust_fit(0,0); pickup fine.nib;
pos0(hair,0); pos1(vair,90); pos2(curve,180); pos3(vair,270);
x0=x4; x1=x3=.5[x0,x2]; lft x2r=hround(1.5u-.5curve);
x4+.5stem=hround(w-1.5u+.5stem);
top y1r=h+oo; bot y3r=0; y0=y2=.5[y1,y3];
filldraw stroke super_arc.e(0,1) & pulled_arc.e(1,2)
 & pulled_arc.e(2,3) & super_arc.e(3,0);  % bowl
pos4(stem,0); y4+.5stem=vround .98h;
pos5(stem,0); x5=x4; y5=-1/3d;
pos6(vair,-90); pos7(hair,-180); pos8(flare,-180);
bot y6r=-d-oo; y8-.5flare=vround -.9d;
lft x8r=hround(2u-.5flare); x6=x1; bulb(6,7,8);  % bulb
filldraw circ_stroke z4e---z5e...{left}z6e;  % stem and arc
picture savedpicture;
savedpicture:=currentpicture;
math_fit(-min(.3x_height#*slant+.5curve#-u#,1.5u#-desc_depth#*slant),
 ic#-1/3x_height#*slant); penlabels(0,1,2,3,4,5,6,7,8); endchar;

iff known g_dot and variant_g: 
cmchar "Variant letter g with dot";
numeric dot_diam#; dot_diam#=max(dot_size#,cap_curve#);
beginchar(g_dot,10u#+serif_fit#,min(asc_height#,10/7x_height#+.5dot_diam#),
  desc_depth#);
italcorr x_height#*slant-serif_fit#+.5stem#-2u# if serifs:+.5u# fi;
adjust_fit(0,serif_fit# if serifs: -.5u# fi);
define_whole_blacker_pixels(dot_diam);
currentpicture:=savedpicture;
pickup tiny.nib;
pos88(dot_diam,0); pos99(dot_diam,90);
x88=x99=good.x(.5w); top y99r=h+1;
if bot y99l-x_height+oo<slab: y99l:=min(y99r-eps,x_height+oo+tiny+slab);fi
y88=.5[y99l,y99r]; dot(88,99);  % dot
penlabels(88,99);endchar;    

savedpicture:=nullpicture;

iff not variant_g:
cmchar "The letter g";      % cmr g mit italic-Parametern -- nur zum Spass
beginchar("g",9u#,x_height#,desc_depth#);
italcorr x_height#*slant+.25u#;
adjust_fit(0,0);
numeric light_vair,light_curve,loop_top,loop_side;
light_vair=Vround(.5[thin_join,vair]+vair_corr);
light_curve=max(fine.breadth,hround(curve-3stem_corr));
loop_top=Vround .77[vair,fudged.stem];
loop_side=hround .64[vair,fudged.stem];
pickup fine.nib; pos1(light_vair,90);
pos2(light_curve,180); pos3(light_vair,270);
pos4(light_curve,360); pos11(loop_top,90);
y11r=good.y(y11r+.15bar_height-y11); x1=x3=.5[x2,x4]; y2=y4=.5[y1,y3];
lft x2r=hround(1.75u-.5light_curve); rt x4r=hround(w-2.75u+.5light_curve);
top y1r=h+oo; y3r=good.y(y3r+.27[top y11r,bot y1l]-y3);
filldraw stroke pulled_arc.e(1,2) & pulled_arc.e(2,3);  % left half of bowl
filldraw stroke pulled_arc.e(3,4) & pulled_arc.e(4,1);  % right half of bowl
x0=superness[x1r,x4r]; y0=superness[y4r,y1r];  % NE point on the super bowl
x8'=superness[x3r,x2r]; y8'=superness[y2r,y3r];  % SW point on the super bowl
x8''=superness[x3,x2]; y8''=superness[y2,y3];
pos0(thin_join,angle(z0-z8')+90);
pos8(thin_join,angle(z0-z8')-90); z8=.618[z8',z8''];
if serifs: pos5(vair,90);
 pos6(hair,0); pos7(.5[hair,flare],0); x5=.75[x0,x6]; top y5r=h+o;
 rt x6r=hround(w-.25u); y6+(.5[hair,flare])/2=.95[bar_height,h]+oo;
 filldraw stroke z0e..{right}z5e; bulb(5,6,7);  % ear
else: pos5(vair',100); top y5r=h+oo;
 rt x5l=hround(w-.25u); y5l:=good.y y5l;
 filldraw z0l{z5-z0}..z5l--z5r{left}..{curl 1}z0r--cycle; fi  % ear
pos10(loop_top,90); x10=x8+.75u; y10=y11;
pos12(loop_side,0); pos13(light_vair,-90);
pos14(loop_side,-180); pos10'(.5[thin_join,vair],-270);
rt x12r=hround max(w-1.25u+.5loop_side,w-.5u); y12=y14=.5[y11,y13];
x11=x13=max(.5w,x10+eps); bot y13r=-d-oo-1; x14=w-x12; z10'l=z10l;
filldraw stroke z8e{z8-z0}..z10e---z11e;  % link
filldraw stroke {{interim superness:=hein_super; super_arc.e(11,12)}}
 & super_arc.e(12,13) & super_arc.e(13,14) & super_arc.e(14,10');  % loop
picture savedpicture;
savedpicture:=currentpicture;
penlabels(0,1,2,3,4,5,6,7,8,10,11,12,13,14); labels(8',8''); endchar;

iff known g_dot and not variant_g: 
cmchar "The letter g with dot";
numeric dot_diam#; dot_diam#=max(dot_size#,cap_curve#);
beginchar(g_dot,9u#,min(asc_height#,10/7x_height#+.5dot_diam#),desc_depth#);
italcorr x_height#*slant+.25u#;
adjust_fit(0,0);                                              
define_whole_blacker_pixels(dot_diam);
currentpicture:=savedpicture;
pickup tiny.nib;
pos88(dot_diam,0); pos99(dot_diam,90);
x88=x99=good.x(.5w); top y99r=h+1;
if bot y99l-x_height+oo<slab: y99l:=min(y99r-eps,x_height+oo+tiny+slab);fi
y88=.5[y99l,y99r]; dot(88,99);  % dot
penlabels(88,99);endchar;    

savedpicture:=nullpicture;


  iff known ipa_gamma:
  cmchar"Italic letter ipa gamma";      % jk
  beginchar(ipa_gamma,7u#,x_height#,desc_depth#);
  italcorr x_height#*slant;
  adjust_fit(0,0);
  pickup fine.nib;
  x0=0; x2=x3+.25u; pos3(stem,-180); lft x3r=hround(2.5u-.5stem);
  hook_in(0,1,2)(skewed);   % opening hook
  pos2'(stem,-180);  pos5(hair,0); pos6(hair,0); pos4(vair,-270);
  z2'=z2; bot y3=-2/5d; bot y4l=-d-o; bot y5=-1/4d; 
  lft x5l=0; x4=.45[x5r,x3r]; 
  y6=.57h; rt x6r=hround(w-.5u);
  filldraw stroke z2'e{-u,-x_height}...z3e...{left}z4e...{up}z5e...{up}z6e;  
   % stem, bowl and diagonal
  v_bulb(6,7);  %closing bulb
  math_fit(-2/3x_height#*slant+.5hair#+.5u#,2/3ic#);
  penlabels(0,1,2,3,4,5,6,7);
  endchar;

cmchar "Italic letter h";
beginchar("h",9u#,asc_height#,0);
italcorr 1/3x_height#*slant+.5hair#+.5u#;
adjust_fit(0,0); pickup tiny.nib;
pos1(stem,0); pos2(stem,0); x1=x2;
lft x1l=hround(1.5u-.5stem); top y1=h; y2-.5stem=-oo;
filldraw circ_stroke z2e--z1e;  % left stem
sloped_serif.l(1,2,a,1/3,jut,serif_drop);  % serif
pickup fine.nib; x4+.5stem=hround(w-2.5u+.5stem);
x5=x4-.25u; ital_arch(2,3,4);  % arch
x7=w; hook_out(5,6,7)(skewed);  % closing hook
filldraw stroke z4e{down}..{-u,-x_height}z5e;  % right stem
math_fit(0,ic#); penlabels(1,2,3,4,5,6,7); endchar;


iff known crossed_h:
cmchar "Italic letter crossed h";
beginchar(crossed_h,9u#,asc_height#,0);
italcorr 1/3x_height#*slant+.5hair#+.5u#;
adjust_fit(0,0); pickup tiny.nib;
pos1(stem,0); pos2(stem,0); x1=x2;
lft x1l=hround(1.5u-.5stem); top y1=h; y2-.5stem=-oo;
filldraw circ_stroke z2e--z1e;  % left stem
sloped_serif.l(1,2,a,1/3,jut,serif_drop);  % serif
pickup fine.nib; x4+.5stem=hround(w-2.5u+.5stem);
x5=x4-.25u; ital_arch(2,3,4);  % arch
x7=w; hook_out(5,6,7)(skewed);  % closing hook
filldraw stroke z4e{down}..{-u,-x_height}z5e;  % right stem
pickup crisp.nib; pos15(bar,90); pos16(bar,90);
top y15r=.52[x_height,h]=top y16r;
lft x15=.75[x2,x4]; lft x16=hround(.10u); 
filldraw stroke z15e--z16e;    % crossbar
math_fit(0,ic#); penlabels(1,2,3,4,5,6,7,15,16); endchar;

endinput;
