% This is ITALXYZ.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:
%
% x, y, z (y has a sharp shape, not rounded as in cmti)
%
% And the following on demand, i. e. if their code is known:
%
% hooktop_y, zhe (ezh)
%
% Higher versions of this file might include more characters.
         
cmchar "Italic letter x";
beginchar("x",6.5u#+max(1.5u#,flare#),x_height#,0);
italcorr max(1/3x_height#*slant+.5hair#+.5u#,x_height#*slant+.25u#);
adjust_fit(0,0); pickup fine.nib;
pos0(hair,180); pos1(vair,90); pos2(stem,0);
pos3(stem,-180); pos4(vair,-90); pos5(hair,0);
y0=y2=2/3h; y3=y5=1/3h; top y1r=h+oo; bot y4r=-oo;
rt x2r=hround(.5w+.5stem-eps); x2=x3;
x0-.5hair=hround-.5hair; x5+.5hair=hround(w+.5hair-eps);
x1=.5[x0,x2]; x4=.5[x3,x5];
filldraw stroke z0e{up}...pulled_arc.e(1,2); % opening hook
filldraw z2l--z3r--z3l--z2r--cycle;  % stem
filldraw stroke pulled_arc.e(3,4)...{up}z5e;  % closing hook
pos3'(hair,180); pos6(hair,180); pos7(vair,90);
pos8(hair,0); pos9(flare,0);
x3'l=x6l=x3l; y3'=y3; y6=3/4h; x7=.5[x8,x2]; top y7r=h+oo;
rt x8r=hround(w-.25u); y8+.5flare=vround(bot y7l-.03x_height);
filldraw stroke z3'e---z6e...{right}z7e; bulb(7,8,9);  % upper link and bulb
pos2'(hair,0); pos16(hair,0); pos17(vair,-90);
pos18(hair,-180); pos19(flare,-180);
x2'l=x16l=x2l; y2'=y2; y16=1/4h; x17=.5[x18,x3]; bot y17r=-oo;
lft x18r=hround.25u; y18-.5flare=vround(top y17l+.03x_height);
filldraw stroke z2'e---z16e...{left}z17e; bulb(17,18,19); % lower link and bulb
math_fit(0,ic#); penlabels(0,1,2,3,4,5,6,7,8,9,16,17,18,19); endchar;

              cmchar "Italic letter y";
beginchar("y",8u#,x_height#,desc_depth#);
italcorr x_height#*slant;
adjust_fit(0,0);
numeric left_stem,right_stem,bot_stem,bot_vair;
left_stem=fudged.stem-stem_corr;
right_stem=fudged.hair;
bot_stem=fudged.hair;
bot_vair=Vround(vair);
pickup tiny.nib;
x1l=.5w-u; x4r=w-.5u; y1=y4r=.57h; y2=y3=0; x2l=x3l;
numeric alpha,alpha[]; x9=3u; y9=bot_vair-d-oo;
alpha1=diag_ratio(2,bot_stem,y1-y3,x4r-x1l-apex_corr);
alpha2=diag_ratio(1,bot_stem,y1-y9,x4r-x9);
if alpha1<alpha2: x2l-x1l=x4r-x3r+apex_corr; alpha=alpha1;
else: alpha=alpha2; z3l=whatever[z9,z4r-(alpha*bot_stem,0)]; fi
penpos3(alpha*bot_stem,0); penpos4(alpha*right_stem,0);
alpha3=(y1++(x2l-x1l))/y1;
penpos1(alpha3*left_stem,0); penpos2(alpha3*left_stem,0);
z23=whatever[z1r,z2r]=z4l+whatever*(z3r-z4r);
if y23>notch_cut: y23:=notch_cut;
  fill z23+.5right{up}...{z4r-z3r}diag_end(23,4l,1,1,4r,3r)
    --z3r--z2l--diag_end(2l,1l,1,1,1r,2r){z2-z1}
    ...{down}z23+.5left--cycle; % left and right diagonals
else: fill z23--diag_end(23,4l,1,1,4r,3r)--z3r--z2l
    --diag_end(2l,1l,1,1,1r,23)--cycle; fi % left and right diagonals
pickup tiny.nib;
pos0(alpha*left_stem,0);
x[-2]=hround(.5hair)-.5hair; z0=whatever[z1,z2]; 
v_hook_in([-2],[-1],0);     % opening hook
z1'=z1; pos1'(alpha*left_stem,0);
z4'=z4; pos4'(alpha*right_stem,0);
filldraw stroke z0e--z1'e; % join
v_bulb(4',10);     % closing bulb
penpos5(alpha*bot_stem,0); z5r=whatever[z3r,z4r]; y5-.5vair=-.5d;
numeric light_bulb; light_bulb=hround 7/8[hair,flare]; clearpen;
 penpos6(vair,-90); penpos7(hair,-180); penpos8(light_bulb,-180);
 x6=2u; y6r=-d-oo; y8-.5light_bulb=-.85d; x8r=hround .35u;
 fill stroke z3e---z5e...{left}z6e; bulb(6,7,8);  % arc and bulb
penlabels([-2],[-1],0,1,2,3,4,5,6,7,8,9,10,23); endchar;

iff known hooktop_y:
cmchar "Italic letter hooktop y";
beginchar(hooktop_y,11u#,x_height#,desc_depth#);
italcorr x_height#*slant+.25u#;
adjust_fit(0,0);
numeric left_stem,right_stem,bot_stem,bot_vair;
left_stem=fudged.stem-stem_corr;
right_stem=fudged.hair;
bot_stem=fudged.hair;
bot_vair=Vround(vair);
pickup tiny.nib;
x1l=3u; x4r=w-3u; y1=y4r=.7h; y2=y3=0; x2l=x3l;
numeric alpha,alpha[]; x9=3u; y9=bot_vair-d-oo;
alpha1=diag_ratio(2,bot_stem,y1-y3,x4r-x1l-apex_corr);
alpha2=diag_ratio(1,bot_stem,y1-y9,x4r-x9);
if alpha1<alpha2: x2l-x1l=x4r-x3r+apex_corr; alpha=alpha1;
else: alpha=alpha2; z3l=whatever[z9,z4r-(alpha*bot_stem,0)]; fi
penpos3(alpha*bot_stem,0); penpos4(alpha*right_stem,0);
alpha3=(y1++(x2l-x1l))/y1;
penpos1(alpha3*left_stem,0); penpos2(alpha3*left_stem,0);
z23=whatever[z1r,z2r]=z4l+whatever*(z3r-z4r);
if y23>notch_cut: y23:=notch_cut;
  fill z23+.5right{up}...{z4r-z3r}diag_end(23,4l,1,1,4r,3r)
    --z3r--z2l--diag_end(2l,1l,1,1,1r,2r){z2-z1}
    ...{down}z23+.5left--cycle; % left and right diagonals
else: fill z23--diag_end(23,4l,1,1,4r,3r)--z3r--z2l
    --diag_end(2l,1l,1,1,1r,23)--cycle; fi % left and right diagonals
pickup tiny.nib;
pos0(alpha*left_stem,0);
x[-2]=hround(.5hair)-.5hair; z0=whatever[z1,z2]; 
v_hook_in([-2],[-1],0);     % opening hook
z1'=z1; pos1'(alpha*left_stem,0);
filldraw stroke z0e--z1'e; % join
penpos5(alpha*bot_stem,0); z5r=whatever[z3r,z4r]; y5-.5vair=-.5d;
numeric light_bulb; light_bulb=hround 7/8[hair,flare]; clearpen;
 penpos6(vair,-90); penpos7(hair,-180); penpos8(light_bulb,-180);
 x6=2u; y6r=-d-oo; y8-.5light_bulb=-.85d; x8r=hround .35u;
 fill stroke z3e---z5e...{left}z6e; bulb(6,7,8);  % lower arc and bulb
z4'=z4; penpos4'(alpha*right_stem,180);
penpos10(vair,90); penpos11(hair,0); penpos12(light_bulb,0);
x10=.5[x4,x12]; top y10r=h+oo; rt x12r=hround(w-.25u);
y12+.5light_bulb=vround(.85h);
fill z4'l{z4-z3}...{right}z10l--z10r{left}...{z3-z4}z4'r--cycle; 
bulb(10,11,12); % upper arc & bulb
penlabels([-2],[-1],0,1,2,3,4,5,6,7,8,9,10,11,13,23); endchar;

cmchar "Italic letter z";
beginchar("z",5.5u#+max(1.5u#,stem#),x_height#,0);
italcorr x_height#*slant+.5hair#;
adjust_fit(if monospace:.5u#,.5u# else: 0,0 fi); pickup fine.nib;
pos1(hair,0); pos2(stem,-90); pos3(vair,-90); pos4(hair,0);
lft x1l=hround(u-.5hair); x2=2.5u; x3=w-2u; rt x4r=hround(w-.5u);
top y1=.78h; top y2l=top y4=h+oo; y3=.825h;
pos5(hair,0); pos6(vair,-90); pos7(stem,-90); pos8(hair,0);
x5=x1; x6=2.5u; x7=w-2u; x8+.5hair=hround(w+.5hair-eps);
bot y5=bot y7r=-oo; y6=.175h; bot y8=.31h;
pair p; p=(z4-z5) yscaled 2;
filldraw stroke z1e{up}...z2e{right}..z3e{right}...{p}z4e;  % upper bar
filldraw stroke z5e{p}...z6e{right}..{right}z7e...{up}z8e;  % lower bar
filldraw stroke z5e{p}..{p}z4e;  % diagonal
math_fit(0,1/3x_height#*slant+.5hair#+.5u#);
penlabels(1,2,3,4,5,6,7,8); endchar;

iff known zhe:
cmchar "Italic letter ezh";      % from wnipai
beginchar(zhe,5.5u#+max(1.5u#,stem#),x_height#,desc_depth#);
italcorr x_height#*slant+.5hair#;
adjust_fit(if monospace:.5u#,.5u# else: 0,0 fi); pickup fine.nib;
pos1(hair,0); pos2(stem,-90); pos3(vair,-90); pos4(hair,0);
lft x1l=hround(u-.5hair); x2=2.5u; x3=w-2u; rt x4r=hround(w-.5u);
top y1=.78h; top y2l=top y4=h+oo; y3=.825h;
pos5(hair,0); pos6(vair,-90); pos7(stem,-90); pos8(hair,0);
x5=x1; x6=2.5u; x7=w-2u; x8+.5hair=hround(w+.5hair-eps);
bot y5=bot y7r=-oo; y6=.175h; bot y8=.31h;
pair p; p=(z4-z5) yscaled 2;
z21=.7[z4,z5]; pos21(hair,0);
x22=x21+1.5u; y22=y21+.15h;
filldraw stroke z1e{up}...z2e{right}..z3e{right}...{p}z4e;  % upper bar
filldraw stroke z21e{p}..{p}z4e;  % diagonal
x23=x4; y23=-.25d; x24=.5w; y24=-d; x25=x5; y25=-.3d;
pos22(vair,-90); pos23(.8curve,-180); pos24(hair,-270); pos25(vair,-360);
filldraw stroke z21e{p}...z22e{right}...{down}z23e...{left}z24e...{up}z25e;
math_fit(0,1/3x_height#*slant+.5hair#+.5u#);
penlabels(1,2,3,4,21,22,23,24,25); endchar;
     
endinput;
