% This is FCILIG.MF  
% Version 1.1
% Date 17-NOV-1994
% 
% (c) Copyright 1991, 1994 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-55099 Mainz
% knappen@vkpmzd.kph.uni-mainz.de

% Contents:
%
% The following ligatures are generated without condition:
%
% ff, fi, fl, ffi, ffl (all using straight f)
%
% And the following on demand, i. e. if their code is known:
%
% fj_lig, t_esh_lig
%
% Higher versions of this file might include more ligatures.

cmchar "Italic ligature ff";  % from cm (ff)
beginchar(oct"033",5u#+max(1.5u#,stem#)+max(3.5u#,2flare#)+2letter_fit#,
 asc_height#,desc_depth#);
italcorr asc_height#*slant+.75u#;
adjust_fit(0,0); pickup fine.nib;
z98-z88=z99-z89=z14-z4=z15-z5=(4.8u+2letter_fit,0);
.5[x88,x99]=.5w-.1u; x89-x88=u; y98=h; y99=-d;
numeric theta; 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(.5w+1.25u);  x2=.5[x1,x4];
top y2r=h+oo; bot y5=-d-oo;
y4=.25[x_height,h]; 
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);   % left bulb
filldraw stroke z2e{left}...z3e...{z89-z88}z4e;  % upper middle arc
filldraw z4r--z5l--z5r--z4l--cycle;  % left stem
pos10(flare,0); pos11(hair,0); pos12(vair,90);
pos13(.5[hair,stem],180); pos14(stem,theta+90);
pos15(stem,theta-90); 
x12=.6[x11,x14];
x13=.8[x12+x14-x98,x98];
rt x11r=hround(w+.25u);
y0=y10; y2=y12; y3=y13; 
bulb(12,11,10);  % right bulb
filldraw stroke z12e{left}...z13e...{z99-z98}z14e;  % upper right arc
filldraw z14r--z15l--z15r--z14l--cycle;  % right 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 x14l+.5stem+1.5u;
filldraw stroke z20e--z21e;  %  crossbar
penlabels(0,1,2,3,4,5,10,11,12,13,14,15,20,21,88,89,98,99); endchar;

cmchar "Italic ligature fi"; % from cm (fi)
beginchar(oct"034",6.5u#+.5max(1.5u#,stem#)+.5max(3.5u#,2flare#)
 +2letter_fit#,asc_height#,desc_depth#);
italcorr max(asc_height#*slant+.5stem#-2u#,1/3x_height#*slant+.5hair#+.5u#);
adjust_fit(0,0); pickup fine.nib;
.5[x88,x89]=.5(w-4u-2letter_fit); x89-x88=u; y88=h; y89=-d;
numeric theta; 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);
pos11(stem,0); rt x11r=hround(w-2.5u+.5stem);
x12=x11; x14=w; hook_out(12,13,14);  % closing hook
x1r=x11r; x2=.5[x1,x4];
bot y5=-d-oo;
y0+.5flare=vround(.85[x_height,h]); top y2r=h+oo;
y4=.25[x_height,h];
z4=whatever[z88,z89]; z5=whatever[z88,z89];
x3=.8[x2+x4-x88,x88]; y3=.8[y4,y2];
bulb(2,1,0); % bulb
filldraw stroke z2e{left}...z3e...{z89-z88}z4e;  % upper arc
filldraw z4r--z5l--z5r--z4l--cycle;  % left stem
top y11=x_height; filldraw stroke z11e--z12e;  % right stem
pickup crisp.nib; pos20(bar,90); pos21(bar,90);
top y20r=top y21r=x_height;
lft x20=lft x4r-.5stem-u; x21=x11;
filldraw stroke z20e--z21e;  %  crossbar
penlabels(0,1,2,3,4,5,10,11,12,13,14,20,21,88,89); endchar;

cmchar "Italic ligature fl"; % from cm (fi)
beginchar(oct"035",7u#+.5max(1.5u#,stem#)+.5max(3.5u#,2flare#)
 +2letter_fit#,asc_height#,desc_depth#);
italcorr max(asc_height#*slant+.5stem#-2u#,1/3x_height#*slant+.5hair#+.5u#);
adjust_fit(0,0); pickup fine.nib;
.5[x88,x89]=.5(w-4.5u-2letter_fit); x89-x88=u; y88=h; y89=-d;
numeric theta; 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); 
pos11(stem,0); rt x11r=hround(w-2.5u+.5stem); rt x1r=lft x11l;
x12=x11; x14=w; hook_out(12,13,14);  % closing hook
x2=.5[x1,x4];
top y2r=h+oo; bot y5=-d-oo;
y4=.25[x_height,h];
z4=whatever[z88,z89]; z5=whatever[z88,z89];
x3=.8[x2+x4-x88,x88]; y3=.8[y4,y2]; y6=.8[y5,y7]; 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;  % left stem
top y11=h; filldraw stroke z11e--z12e;  % right stem
pickup crisp.nib; pos20(bar,90); pos21(bar,90);
top y20r=top y21r=x_height;
lft x20=lft x4r-.5stem-u; x21=x11;
filldraw stroke z20e--z21e;  %  crossbar
penlabels(0,1,2,3,4,5,10,11,12,13,14,20,21,88,89); endchar;

cmchar "Italic ligature ffi"; % from cm (ffi)
beginchar(oct"036",11.75u#+.5max(1.5u#,stem#)+.5max(3.5u#,2flare#)
 +4letter_fit#,asc_height#,desc_depth#);
italcorr max(asc_height#*slant+.5stem#-2u#,1/3x_height#*slant+.5hair#+.5u#);
adjust_fit(0,0); pickup fine.nib;
z98-z88=z99-z89=z14-z4=z15-z5=(5u+2letter_fit,0);
numeric theta,mid_f;
mid_f=.5[x88,x99]=.5(w-4.25u-2letter_fit); x89-x88=u;
y98=h; y99=-d; theta=angle(z88-z89);
pos21(stem,0); rt x21r=hround(w-2.5u+.5stem);
x22=x21; x24=w; hook_out(22,23,24);  % closing hook
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(mid_f+1.75u);
x2=.5[x1,x4];
top y2r=h+oo; bot y5=-d-oo;
y4=.25[x_height,h];
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);  % left bulb
filldraw stroke z2e{left}...z3e...{z89-z88}z4e;  % upper middle arc
filldraw z4r--z5l--z5r--z4l--cycle;  % left stem
pos10(flare,0); pos11(hair,0); pos12(vair,90);
pos13(.5[hair,stem],180); pos14(stem,theta+90);
pos15(stem,theta-90);
x11r=x21r; x12=.5[x11,x14];
x13=.8[x12+x14-x98,x98];
y10+.5flare=vround .85[x_height,h];
y2=y12; y3=y13;
bulb(12,11,10); % right bulb
filldraw stroke z12e{left}...z13e...{z99-z98}z14e;  % upper right arc
filldraw z14r--z15l--z15r--z14l--cycle;  % middle stem
top y21=x_height; filldraw stroke z21e--z22e;  % right stem
pickup crisp.nib; pos30(bar,90); pos31(bar,90);
top y30r=top y31r=x_height;
lft x30=lft x4r-.5stem-u; x31=x21;
filldraw stroke z30e--z31e;  %  crossbar
penlabels(0,1,2,3,4,5,10,11,12,13,14,15,
 20,21,22,23,24,30,31,88,89,98,99); endchar;

cmchar "Italic ligature ffl"; % from cm (ffl)
beginchar(oct"037",12u#+.5max(1.5u#,stem#)+.5max(3.5u#,2flare#)
 +4letter_fit#,asc_height#,desc_depth#);
italcorr max(asc_height#*slant+.5stem#-2u#,1/3x_height#*slant+.5hair#+.5u#);
adjust_fit(0,0); pickup fine.nib;
z98-z88=z99-z89=z14-z4=z15-z5=(5u+2letter_fit,0);
numeric theta,mid_f;
mid_f=.5[x88,x99]=.5(w-4.5u-2letter_fit); x89-x88=u;
y98=h; y99=-d; theta=angle(z88-z89);
pos21(stem,0); rt x21r=hround(w-2.5u+.5stem);
x22=x21; x24=w; hook_out(22,23,24);  % closing hook
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(mid_f+1.25u);
x2=.5[x1,x4];
top y2r=h+oo; bot y5=-d-oo; y0+.5vair=.5[x_height,h];
y4=.25[x_height,h];
z4=whatever[z88,z89]; z5=whatever[z88,z89];
x3=.8[x2+x4-x88,x88]; y3=.8[y4,y2];
bulb(2,1,0);  % left bulb
filldraw stroke z2e{left}...z3e...{z89-z88}z4e;  % upper middle arc
filldraw z4r--z5l--z5r--z4l--cycle;  % left stem
pos10(flare,0); pos11(hair,0); pos12(vair,90);
pos13(.5[hair,stem],180); pos14(stem,theta+90);
pos15(stem,theta-90);
rt x11r=lft x21l;
x12=.5[x11,x14];
x13=.8[x12+x14-x98,x98];
y0=y10; y2=y12; y3=y13;
bulb(12,11,10); % right bulb
filldraw stroke z12e{left}...z13e...{z99-z98}z14e;  % upper right arc
filldraw z14r--z15l--z15r--z14l--cycle;  % middle stem
top y21=h; filldraw stroke z21e--z22e;  % right stem
pickup crisp.nib; pos30(bar,90); pos31(bar,90);
top y30r=top y31r=x_height;
lft x30=lft x4r-.5stem-u; x31=x21;
filldraw stroke z30e--z31e;  %  crossbar
penlabels(0,1,2,3,4,5,10,11,12,13,14,15,
 20,21,22,23,24,30,31,88,89,98,99); endchar;

cmchar "Italic ligature fj"; % jk
beginchar(fj_lig,6.5u#+.5max(1.5u#,stem#)+.5max(3.5u#,2flare#)
 +2letter_fit#,asc_height#,desc_depth#);
italcorr max(asc_height#*slant+.5stem#-2u#,1/3x_height#*slant+.5hair#+.5u#);
adjust_fit(0,0); pickup fine.nib;
.5[x88,x89]=.5(w-4u-2letter_fit); x89-x88=u; y88=h; y89=-d;
numeric theta; 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);
pos12(stem,0);
pos13(stem,0); lft x13l=hround(w-2u-.5stem);
pos14(vair,-90); pos15(hair,-180); pos16(flare,-180);
x12=x13; 
x1r=x13r; x2=.5[x1,x4];
bot y5=-d-oo;
y0+.5flare=vround(.85[x_height,h]); top y2r=h+oo;
y4=.25[x_height,h];
z4=whatever[z88,z89]; z5=whatever[z88,z89];
x3=.8[x2+x4-x88,x88]; y3=.8[y4,y2];
bulb(2,1,0); % left bulb
filldraw stroke z2e{left}...z3e...{z89-z88}z4e;  % upper arc
filldraw z4r--z5l--z5r--z4l--cycle;  % left stem
top y12=x_height; bot y13=-1/3d; bot y14r=-d-oo; y16-.5flare=-vround.9d;
x14=2/3[x13,x4]; lft x15r=lft x15r+x14-x15l-eps;
filldraw stroke z12e--z13e...{left}z14e;  % right stem and arc
bulb(14,15,16);  % right bulb
pickup crisp.nib; pos20(bar,90); pos21(bar,90);
top y20r=top y21r=x_height;
lft x20=lft x4r-.5stem-u; x21=x13;
filldraw stroke z20e--z21e;  %  crossbar
penlabels(0,1,2,3,4,5,12,13,14,15,16,20,21,88,89); endchar;

iff known t_esh_lig:
cmchar "The ligature t-esh";                  % from wsuipa
beginchar(t_esh_lig,10u#+max(u#,.5stem#),
 min(asc_height#,if hefty:9/7 else:10/7 fi\\ x_height#),desc_depth#);
italcorr x_height#*slant if serifs: -.9u# else: -.4u# fi;
adjust_fit(0,if serifs: 0 else: -.5u# fi);
numeric shaved_stem; shaved_stem=hround(stem if hefty:-\\2stem_corr fi);
pickup fine.nib; pos2(shaved_stem,180);pos3(shaved_stem,180);
lft x2r=lft x3r=hround(2.5u-.5shaved_stem);
y2=y8; y3=max(.5bar_height,2vair);
pickup crisp.nib; pos8(bar,90);
rt x8=hround(2/3w-.3u); top y8r=x_height; lft x7=hround 1/3u; y7l=y8l;
pos7(vair,90); pos1(hair,0);
rt x1r=fine.rt x2l; top y1=h;
filldraw z1l{down}...{left}z7r--z7l--z8l--z8r
  --(x1r,y8r)--z1r--cycle;  % upper terminal and crossbar
pickup fine.nib; interim superness:=more_super;
pos4(vair',-90); bot y4r=-oo; rt x5r=hround(2/3w-.5u);
pos5(hair,0); y5=y3; x4l=.5[x3l,x5l];
(x,y4r)=whatever[z4l,z5l]; x4r:=max(x,.5[x3r,x4]);
filldraw stroke z2e..super_arc.e(3,4)...{up}z5e;  % stem and hook
pickup crisp.nib; pos6(hair,0); pos5'(hair,0);
x6l=x5=x5'; top y6=max(vround .75bar_height,top y5); y5=y5';
filldraw stroke z5'e--z6e;  % terminal
pickup fine.nib; pos21(shaved_stem,0); pos22(shaved_stem,0);
lft x21l=x5; x21=x22; top y21=.8h; bot y22=0;
filldraw stroke z21e--z22e;  % stem
%top
pos10(vair,-90); x10=.5[x21,x11l]; top y10l=h+o+1;
pos11(hair,0); rt x11l=hround(w-.4u); y11=.84h;
pos12(flare,0);
pos10'(vair,90); z10'=z10;
bulb(10',11,12);  % bulb
filldraw stroke pulled_super_arc.e(21,10)(.4superpull); % arc and stem
%tail
numeric dot_diam#; dot_diam#=max(dot_size#,cap_curve#);
define_whole_blacker_pixels(dot_diam);
 pickup tiny.nib; pos15(vair,-90); pos16(hair,-180); pos17(flare,-180);
 x15=.5[x16r,x22]; bot y15r=-d+oo; y16-.5flare=-.85d;
 z16r=z17r; x17r=hround(x3+.1u); 
 x15r:=max(x,.5[x16r,x15]);
 filldraw stroke pulled_super_arc.e(22,15)(.4superpull);
 bulb(15,16,17); % arc and bulb
penlabels(1,2,3,4,5,6,7,8,10,11,12,15,16,17,21,22); endchar;


endinput;
