%
% lgslavi.mf
%
%% Cyrillic font container with T2 encoding beta-support
%
% This file is future part of lxfonts package
% Version 3.2 // Patchlevel=0
% (c) O.Lapko
%
% This package belongs to the public domain under conditions similar to
% those of D. E. Knuth specified for the Computer Modern family of fonts.
% In particular, only the authors are entitled to modify this file
% and to save it under the same name.
%
% Content:
%
% Italic Old Slav letters included in Unicode
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% List of letternames and their codes in Unicode
%
% omga          "61
% i_e           "65
% l_yus         "67
% il_yus        "69
% ib_yus        "6d
% ksi           "6f
% psi           "71
% fita          "73
% izh_dgr       "75
% uk            "77
% omga_rnd      "79
% omga_tlo      "7b
% ot            "7d
% koppa         "7f
%

LHver_check(3,2);  % like |version_check| in ec

lhchar "Italic Cyrillic letter omga - omega";
cyrchar(omga,11u#,x_height#,0);
italcorr .7x_height#*slant+.5curve#-u# if math_fitting:-.15u# fi; %o+.35u
adjust_fit(if monospace:-.35u#,-.35u# else:0,0 fi); %bowl_adj
% ital_omega;
pickup fine.nib; pos2(stem,-180); lft x2r=hround.5u; y2=y4=y6=y8=bar_height;
pos3(vair,-90); pos4(hair,0); pos5(vair,90);
pos6(hair,180); pos7(vair,270); pos8(stem,360);
bot y3r=bot y7r=-oo; top y5r=vround(.2[y4,h]+.5vair);
x3=.5[x2,x4]; x7+.25u=.5[x6,x8]; rt x8r=hround(w-.5u);
x5+.5stem=hround(.5[x2l,x8l]+.5stem)+eps;
x5=.5[x4,x6]; rt x4r-lft x6r=min(stem,2hair)+2eps;
y1+.5hair=h+oo; x1=min(x2l+1.25u,lft x6r); x9=w-x1; y9=y1;
pos1(hair,angle(2(x1-x2),y1-y2)+90); pos9(hair,-angle(2(x1-x2),y1-y2)+90);
if x4l<x6l: x4l:=x6l:=x5; fi
filldraw stroke z1e...z2e{down}...z3e{right}
 ...{up}z4e...{left}z5e;  % left arc
filldraw stroke z5e{left}...z6e{down}...
 z7e{right}...{up}z8e...z9e;  % right arc
%%%
penlabels(1,2,3,4,5,6,7,8,9); endchar;

lhchar "Italic Cyrillic letter i_e - iot e (HC with mid-line)";
cyrchar(i_e,8u#,x_height#,0);
italcorr if math_fitting:1/3x_height#*slant else:x_height#*slant-.5u# fi; %c+.5u
adjust_fit(if monospace: 3u# else: 4.5u# fi +0.2u#,0);
%  ital_ukre;iot
pickup fine.nib; pos0(flare,0); pos1(hair,0); pos2(vair,90);
pos3(curve,180); pos4(vair,270); pos5(hair,320);
x2=x4=.5(w+u); rt x1r=max(rt x2,hround(w-.5u))+eps;
lft x3r=hround(1.5u-.5curve); x5r=good.x(w-eps); x6=x5;
y1=.5[bar_height,h]; top y2r=h+oo; bulb(2,1,0);  % bulb
bot y4r=-oo; y3=.5[y2,y4]; top y5l=vround .5bar_height; y6=bar_height;
path p; p=z4{right}..z5..z6;
filldraw stroke pulled_arc.e(2,3)
 & pulled_arc.e(3,4)...{direction 1 of p}z5e;  % arc
pos7(vair,90);
y7=bar_height; rt x7=hround max(rt x2+1+eps,lft x0l-eps);
% i half
_one:=8; _two:=9; _three:=10; _four:=11; _five:=12; _six:=13;
%
pos[_four](stem,0);
lft x[_four]l=l+letter_fit if not monospace: +hround(2.5u-.5stem) fi;
y[_four]-.5stem=-oo; x[_three]=x[_four];
if monospace:
 pos[_three](stem,0); top y[_three]=h;
else:
 x[_one]=l+letter_fit; hook_in([_one],[_two],[_three]); fi % opening hook
filldraw circ_stroke z[_four]e--z[_three]e; % stem
pos[_five](vair,90); pos[_six](vair,90); %!!!
x[_five]=x[_four]; x[_six]=x7; y[_five]=y[_six]=bar_height; %!!!
filldraw stroke z[_five]e--z[_six]e; % bar %!!!
%%%
penlabels(1,1',2,3,4,5,6,7,8,9,10,11,12); endchar;

lhchar "Italic Cyrillic letter l_yus - little yus";
cyrchar(l_yus,11u#,x_height#,0);
italcorr 1/3x_height#*slant+.5hair#+.5u#;
adjust_fit(if monospace:-.5u# else:.5u# fi, %wbulb_adj
 0);
% ital_amod;
pickup fine.nib; pos1(vair,-90); pos2(hair,0); pos3(hair,0); pos4(vair,-90);
pos5(hair,-180); pos6(flare,-180);
pos1'(stem,180); pos10(stem,0);
top y1l=h+oo; x1=.5[x3,x1']; x2=x3=3u; y3=.35h; y2=.75h;
bot y4r=-oo; x4=lft x6r+flare; y6-.5flare=.1h; lft x6r=-.25u; z5r=z6r;
y1'=.8h; x1'=x7; z10=z1';
rt x7r=hround(w-2.5u+.5stem);
bulb(4,5,6); % bulb
x9=w; hook_out(7,8,9); % closing hook
filldraw stroke z10e--z7e; % tie
filldraw stroke pulled_arc.e(4,3) &  super_arc.e(3,1)
 & super_arc.e(1,1'); % right stem
% stem&bar
y11=y12=bar_height; pos11(vair,90); pos12(vair,90);
 z11=((l,y11)..(w,y11)) intersectionpoint
  (pulled_arc.r(4,3) &  super_arc.r(3,1));
 z12=((0,y12)..(w-u,y12)) intersectionpoint (z10l..z7l);
filldraw stroke z11e--z12e; % bar
numeric stem[]; stem1=max(fine.breadth+eps,.7[thin_join,stem]);
pos13(stem1,0); pos14(stem1,0);
x13=x14=.5[x11,x12]; y13=y12; y14-.5stem1=0;
filldraw circ_stroke z14e--z13e; % stem
%%%
penlabels(1,1',2,3,4,5,6,7,8,9,11,11',14,15);
endchar;

lhchar "Italic Cyrillic letter il_yus - iotfied little yus";
cyrchar(il_yus,11u#,x_height#,0);
italcorr 1/3x_height#*slant+.5hair#+.5u#;
adjust_fit(if monospace: 3.5u#+else: 4.5u#+fi.5u#,
 if monospace:-1.5u# else:0 fi); %rstem_adj
% ital_amod;iot
pickup fine.nib; pos1(vair,-90); pos2(hair,0); pos3(hair,0); pos4(vair,-90);
pos5(hair,-180); pos6(flare,-180);
pos1'(stem,180); pos10(stem,0);
top y1l=h+oo; x1=.5[x3,x1']; x2=x3=3u; y3=.35h; y2=.75h;
bot y4r=-oo; x4=lft x6r+flare; y6-.5flare=.1h; lft x6r=-.25u; z5r=z6r;
y1'=.8h; x1'=x7; z10=z1';
rt x7r=hround(w-2.5u+.5stem);
bulb(4,5,6); % bulb
% right_stem;
_one:=7; _two:=8; _three:=9;
if monospace: pos[_three](vair,90); pos[_one](stem,0);
 x[_three]=good.x .5[x[_one],w]; bot y[_three]l=0; y[_one]=1/3h;
 filldraw stroke z[_one]e{down}...{right}z[_three]e; % terminal
else: x[_three]=w; hook_out([_one],[_two],[_three]); fi % opening hook
filldraw stroke z10e--z7e; % tie
filldraw stroke pulled_arc.e(4,3) &  super_arc.e(3,1)
 & super_arc.e(1,1'); % right stem
% stem&bar
y11=y12=bar_height; pos11(vair,90); pos12(vair,90);
 z11=((l,y11)..(w,y11)) intersectionpoint
  (pulled_arc.r(4,3) &  super_arc.r(3,1));
 z12=((0,y12)..(w-u,y12)) intersectionpoint (z10l..z7l);
filldraw stroke z11e--z12e; % bar
numeric stem[]; stem1=max(fine.breadth+eps,.7[thin_join,stem]);
pos13(stem1,0); pos14(stem1,0);
x13=x14=.5[x11,x12]; y13=y12; y14-.5stem1=0;
filldraw circ_stroke z14e--z13e; % stem
%%%
% i half
_one:=15; _two:=16; _three:=17; _four:=18; _five:=19; _six:=20;
%
pos[_four](stem,0);
lft x[_four]l=l+letter_fit if not monospace: +hround(2.5u-.5stem) fi;
y[_four]-.5stem=-oo; x[_three]=x[_four];
if monospace:
 pos[_three](stem,0); top y[_three]=h;
else:
 x[_one]=l+letter_fit; hook_in([_one],[_two],[_three]); fi % opening hook
filldraw circ_stroke z[_four]e--z[_three]e; % stem
pos[_five](vair,90); pos[_six](vair,90); %!!!
x[_five]=x[_four]; x[_six]=x11; y[_five]=y[_six]=bar_height; %!!!
filldraw stroke z[_five]e--z[_six]e; % bar %!!!
%%%
penlabels(1,1',2,3,4,5,6,7,8,9,11,12,13,14,15,16,17,18,19,20);
endchar;

lhchar "Italic Cyrillic letter ib_yus - iot big yus";
cyrchar(ib_yus,9u#,x_height#,0);
italcorr 1/3x_height#*slant+.5hair#+.5u#; %h
adjust_fit(if monospace: 4u#+else: 5u#+fi w#-5u#,
 if monospace:-1.5u# else:0 fi); %rstem_adj
% ital_yus;iot
% itop_yus;
pickup fine.nib;
penpos1(fudged.stem,0); penpos2(fudged.hair,0);
penpos3(fudged.stem,0); penpos4(fudged.hair,0);
w-x2r=.24w; x2-x3=x3-x1; y1=h; y2=y1; y3=y4=bar_height;
x3l=hround(2.5u-.5stem); x3r=x4r;
z0=whatever[z4l,z2l]=whatever[z1r,z3r];
if hefty:
 y0:=bar_height+.5fine;
 fill z3l--diag_end(3l,1l,1,1,1r,3r){z3r-z1r}
  ...{down}(x0-.5,y0)..(x0+.5,y0){up}...
  {z2l-z4l}diag_end(4l,2l,1,1,2r,4r)--z4r--cycle; % diagonals
else:
 fill z3l--diag_end(3l,1l,1,1,1r,3r)--z0--
  diag_end(4l,2l,1,1,2r,4r)--z4r--cycle; fi % diagonals
penpos5(fudged.stem,0); x5=x3; y5-.5stem=-oo;
fill circ_stroke z5e--z3e; %middle stem
z6=whatever[z4,z2]; z7=whatever[z1,z3]; y6=y7=good.y(y1-vair);
fill z1--z7--z6--z2--cycle; % upper bar
% bowls
pos8(vair,90); pos9(stem,0); pos10(vair,90); pos11(hair,180);
pos12(stem,180); pos13(vair,90); pos14(hair,0); z8=z3;
x11=hround(w+.5hair-eps)-.5hair; x11-x3=x3-x14; y11=y14=1/3x_height;
lft x9l=hround(w-2.75u-.5stem); x9-x3=x3-x12; y9=y12=1/2y8;
x10=hround(w-1.2u); x10-x3=x3-x13;
bot y10l=bot y13l=if monospace: 0 else:-oo fi;
filldraw stroke if not monospace:z14e{down}... fi
 z13e{right}...z12e{up}...z8e{right}...z9e{down}...z10e{right}
 if not monospace:...{up}z11e fi;  % left lower diagonal
%%%
% i half
_one:=15; _two:=16; _three:=17; _four:=18; _five:=19; _six:=20;
%
pos[_four](stem,0);
lft x[_four]l=l+letter_fit if not monospace: +hround(2.5u-.5stem) fi;
y[_four]-.5stem=-oo; x[_three]=x[_four];
if monospace:
 pos[_three](stem,0); top y[_three]=h;
else:
 x[_one]=l+letter_fit; hook_in([_one],[_two],[_three]); fi % opening hook
filldraw circ_stroke z[_four]e--z[_three]e; % stem
pos[_five](vair,90); pos[_six](vair,90); %!!!
x[_five]=x[_four]; x[_six]=x8; y[_five]=y[_six]=bar_height; %!!!
filldraw stroke z[_five]e--z[_six]e; % bar %!!!
%%%
penlabels(1,2,3,4,5,6,7,8,9,11,12,13,14,15,16,17,178,19,20); endchar;

% like CYR_.z or numeral 3
lhchar "Italic Cyrillic letter ksi";
cyrchar(ksi,7.5u#,x_height#+1.75dot_size#,desc_depth#);
bh#:=min(bar_height#,1.14x_height#-bar_height#); define_pixels(bh);
italcorr if math_fitting:1/3x_height#*slant else:x_height#*slant-u# fi; %e
adjust_fit(0,.5serif_fit#); h:=x_height; pickup fine.nib;
pos0(flare,180); pos2(vair,90); top y2r=h+oo;
numeric right_curve; right_curve=curve-stem_corr;
pos4(vair,-90); pos5(vair,-90); pos6(vair,90); pos5'(vair,90);
x2=x6=.5[u,x7']; pos7'(right_curve,0); rt x7'r=hround(w-.6u);
pos3(.5[hair,curve],0); rt x3r=min(rt x7'r-1,hround(w-u));
y3=.5[y4l,y2l]; x4=1/3[x5,x3l]; y4=y5; y5'=y13; y5=y5'=bar_height;
lft x1r=hround .625u; y1=min(bh+.5flare+2vair+2,.9[bh,h]-.5flare);
pos1(hair,180); bulb(2,1,0);  % bulb
lft x5=lft x5'=min(rt x0l+.5vair,lft x6)+eps;
filldraw stroke super_arc.e(2,3) & super_arc.e(3,4)..z5e; % upper bowl
pos13(vair,90); x13=hround.5[.5u,w-.8u];
rt x7r=hround(w-.6u); x7r-x7l=hround .5[vair,stem]-fine; %
x9=x10=2u; x11=.5w-.5u; y9=-.3d; pos11(vair,135); pos10(vair,90);
numeric theta; theta=-90+angle(28u,x_height); slope:=x_height/28u;
pos9(.5[stem,curve],theta); ellipse_set(13l,7l,8l,9l); ellipse_set(13r,7r,8r,9r);
bot y10l=-d-oo; y11=min(-3/4d-oo,y7l);
filldraw stroke z11e{x10-x11,2(y10-y11)}...z10e{left}...z9e
 ---z8e...{up}z7e...{left}z13e...{left}z5'e;  % main stroke
%"hachek"
pickup crisp.nib;
pos15(vair',90); x15=x13; y15=h;
x13-x14=x16-x13=good.x 2.25u; top y14=top y16=h+.75dot_size;
pos16(.25[vair,curve],angle(z16-z15)+90); pos14(whatever,0);
z14l=z15l+whatever*(z15-z14); (x14r,y)=z15r+whatever*(z15-z14); %y14l=y14r=y14;
filldraw stroke z14e--z15e{z16r-z15}..{.5right}z16e;  % diagonals
penlabels(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16); endchar;

lhchar "Italic Cyrillic letter psi";
cyrchar(psi,11u#,asc_height#,desc_depth#);
italcorr x_height#*slant;
adjust_fit(0,0); pickup fine.nib; interim superness:=more_super;
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); z2'=z2; pos4(vair,-90); pos5(hair,0);
x4=.5w+u; rt x5r=hround(w-.5u);
y3=.7[y4,y5]; bot y4r=-oo; y5=.57x_height;
filldraw stroke z2'e{-u,-x_height}...super_arc.e(3,4)
 ..tension atleast 1.05..{up}z5e; % left stem and arc
v_bulb(5,6);  % closing bulb
%%ef stem
pickup tiny.nib; pos9(stem',0); pos10(stem,0);
pos0'(stem',0); pos1'(stem,0); z1'l=z0'l; x0'=x9; x1'=x10;
lft x9l=hround(.5[x3,x5]-.5stem'); top y9=h; % if serifs: +min(oo,serif_drop) fi;
numeric edge; edge=rt x10r;
y1'=ypart(((edge,body_height+2dot_size)--(edge,-o))
	intersectionpoint(z3r{down}...{right}z4r...{up}z5r));
pickup tiny.nib; bot y10=-d;
filldraw stroke z9e--z0'e--z1'e--z10e;  % stem
pickup crisp.nib; pos12(hair,0); pos11'(stem,0);
z11'=z10; x12l=x11'l; bot y12=0;
filldraw stroke z11'e--z12e;  % point
if serifs: numeric ef_jut; ef_jut=if monospace:1.4 fi jut;
 sloped_serif.l(9,0',a,1/3,ef_jut,serif_drop);  % upper serif
 save slab; slab:=vair; % lower.slab
 dish_serif(10,0',b,1/3,ef_jut,c,1/3,ef_jut); fi  % lower serif
penlabels(0,1,2,3,4,5,6,7,8); endchar;

%WNCYR shape without serifs
lhchar "Italic Cyrillic letter fita (looks like theta)";
cyrchar(fita,8u#,x_height#,0);
italcorr .7x_height#*slant+.5curve#-u# if math_fitting:-.5u# fi;
adjust_fit(0,0); pickup fine.nib;
pos1(vair,90); pos2(curve,180); pos3(vair,270); pos4(curve,360);
x1=x3=.5w; lft x2r=hround(1.5u-.5curve);
x4=w-x2;
top y1r=h+oo; y2=y4=.5[y1,y3]; bot y3r=-oo;
filldraw stroke pulled_arc.e(1,2) & pulled_arc.e(2,3)
 & pulled_arc.e(3,4) & pulled_arc.e(4,1); % bowl
bar_stroke(x2,x4); % bar
penlabels(1,2,3,4,5,6); endchar;

lhchar "Italic Cyrillic letter izh_dgr - izhitsa double grave";
cyrchar_twice(izh_dgr,9.5u#,x_height#+acc_height#,0);
italcorr x_height#*slant+.25u#;
adjust_fit(.25u#,max(u#,.5u#+.5flare#)); %izhy_adj
full_h:=h; h:=x_height;
% ital_izh;
numeric left_stem,right_stem,outer_jut,alpha,bulb_diam;
left_stem=stem-stem_corr; bulb_diam=7/8[hair,flare];
right_stem=min(hair if hefty:-2stem_corr fi,left_stem);
outer_jut=.75jut; x1l=l+letter_fit+outer_jut+.25u; x4r=w-x1l; y1=y4=h;
x2-x1=x4-x3; x2l+apex_corr=x3l; y2=y3=-apex_o;
alpha=diag_ratio(2,right_stem,y1-y2,x4r-x1l-apex_corr);
penpos1(alpha*left_stem,0); penpos2(alpha*left_stem,0);
penpos3(alpha*right_stem,0); penpos4(alpha*right_stem,0);
z0=whatever[z1r,z2r]=whatever[z3l,z4l];
penpos4''(alpha*right_stem,0);
penpos5(vair,90); penpos6(hair,0); penpos7(flare,0);
x5=if serifs:.5[x4'',rt x6r] else: rt x6r fi; top y5r=h+oo;
y4''=min(.9x_height,y5l-vair); z4''=whatever[z3,z4];
rt x6r=hround(r-.5u-.5);
y6=max(vround(top y5r-.5hair)-1-.5flare,
 min(bar_height+.5flare+2vair'+2,.9[bar_height,h]-.5flare));
cyrbulb(5,6,7); % bulb
penpos1'(alpha*left_stem,0); y1'=3/4x_height; z1'=whatever[z1,z2];
x10=l+letter_fit; x10:=hround(x10-.5hair)+.5hair; y10=2/3x_height;
penpos9(vair,90); y9r=x_height+oo; x9=min(x1l-.5,x10+u);
if y0>cap_notch_cut:
 y0:=cap_notch_cut;
 fill z0+.5right{up}...{z4-z3}z4''l...{right}z5r--z5l{left}
  ...z4''r{z3-z4}--diag_end(4r,3r,1,1,2l,1l)--
   z1'l{z1-z2}...{left}z9l--z9r{right}
   ..tension atleast .75 and 1..{z2-z1}z1'r
  ...{down}z0+.5left--cycle; % left and right diagonals
else:
 pickup pencircle scaled1;
 fill z0--z4''l{z4-z3}...{right}z5r--z5l{left}...{z3-z4}z4''r
  --diag_end(4r,3r,1,1,2l,1l)--
   z1'l{z1-z2}...{left}z9l--z9r{right}
   ..tension atleast .75 and 1..{z2-z1}z1'r
  --cycle; fi % left and right diagonals
pickup fine.nib;
pos9'(vair,90); z9'=z9; pos10(hair,180);
filldraw stroke z10e{up}...z9'e{right};
%%%
% the accent
if monospace: hpos_corr=-2u; put_gravis; hpos_corr=2u; put_gravis;
else: hpos_corr=-1.5u; put_gravis; hpos_corr=1.5u; put_gravis; fi
repeat_once;
penlabels(0,1,2,3,4); endchar;

lhchar "Italic Cyrillic letter uk";
cyrchar(uk,9.75u#,asc_height#,0);
italcorr asc_height#*slant-.5u#;
adjust_fit(0,0);
% ital_uk;
numeric top_thickness,mid_thickness,bot_thickness,upper_side,lower_side,theta;
top_thickness=max(fine.breadth,vround(slab-2vair_corr));
bot_thickness=max(fine.breadth,vround(slab-vair_corr));
x0=.5w; y0=if monospace:bar_height else:.7x_height fi; %h;%%%%%%%%%%%%%%
pickup fine.nib; theta=90-angle(20u,h); slope:=-h/20u;
upper_side=max(fine.breadth+eps,hround(.5[hair,stem]-stem_corr));
lower_side=hround(.5[hair,stem]+stem_corr);
if lower_side>1.2upper_side: upper_side:=lower_side; fi
pos1(top_thickness,-90); pos6(bot_thickness,-90);
x1=x6=.5w; top y1l=h+o; bot y6r=-o; pos0(cap_stem,theta);
lft x2l=w-rt x8l=hround 1.25u; lft x7r=w-rt x5r=hround 1.75u;
 x2r-x2l=stem-fine; x5r-x5l=lower_side-fine;%%%%%%%%%%%
ellipse_set(1l,2l,3l,0l); ellipse_set(1r,2r,3r,0r);
ellipse_set(6l,5l,4l,0l); ellipse_set(6r,5r,4r,0r);
numeric tau; tau=max(.8,.20710678/(superness-.5));
y2r:=y2l+serif_drop;
filldraw stroke z2e{down}
 ..z3e---z4e..z5e{down}..tension atleast tau..z6e{left};  % S stroke
pos7(lower_side,180); pos8(upper_side,180);
y7=.5[y5l,y5r]; y8=.5[y2l,y2r]; pos9(vair,90); z9=z0;
filldraw stroke z8e{down}
 ..tension atleast tau and atleast 1..{-18u,-.618h}z9e; % upper right stroke
filldraw stroke z6e{left}..tension atleast tau..z7e{up}
 ..tension atleast tau and atleast 1..{18u,.5h}z9e;% lower left stroke
% italic bulb
z8'=z8; pos8'(upper_side,0);
y1'+.5curve=h+oo; x1'=x8-max(u,.5u+.5curve); %+.5curve%y8+(x_height-bar_height); %%%%%%%%%%%
numeric theta; theta=angle(4(x8'-x1'),y8'-y1'); pos1'(curve,theta+90);
filldraw z1'l{dir theta}..tension atleast 1 and 1..{down}z8'l
 --z8'r{up}...{-dir theta}z1'r..cycle;  % bulb
% from sloped serif
pos12(slab,90); lft x12=x2l-.5jut; y12r=y2r-serif_drop; z14=z2l;
filldraw z2r--z12r--z12l{right}
 ...1/3[(x14,y12l),.5[z12l,z14] ]{z14-z12l}
 ...{down}z14--(x2r,y14)--cycle;  % sloped serif
%%%%%
penlabels(0,1,2,3,4,5,6,7,8,9); endchar;

lhchar "Italic Cyrillic letter omga_rnd - omega round";
cyrchar(omga_rnd,11u#,x_height#,0); %f width
italcorr .7x_height#*slant+.5curve#-u# if math_fitting:-.5u# fi;
adjust_fit(if monospace:0,0 else:-.35u#,-.35u#fi); pickup fine.nib;
pos1(vair,90); pos2(curve,180); pos3(vair,270); pos4(curve,360);
interim superness:=1.075 superness;  %
x1=x3=.5w; lft x2r=hround(1.5u-.5curve); x4=w-x2;
top y1r=h+oo; y2=y4=.5[y1,y3]; bot y3r=-oo;
filldraw stroke pulled_arc.e(1,2) & pulled_arc.e(2,3)
 & pulled_arc.e(3,4) & pulled_arc.e(4,1); % bowl
pickup crisp.nib;
% dots
numeric bulb_diam; bulb_diam=hround 7/8[hair,flare];
z5=z1r; z6=z3r; x5'=x6'=x1; pos5(bulb_diam,0); pos6(bulb_diam,0);
bot y5'=max(.5h+1,bot y1l-.7bulb_diam);
top y6'=min(.5h-1,top y3l+.7bulb_diam);
pos6'(min(bulb_diam,.7[hair,fudged.stem]),0);
pos5'(min(bulb_diam,.7[hair,fudged.stem]),0);
filldraw circ_stroke z5e--z5'e; filldraw circ_stroke z6e--z6'e; %dots
penlabels(1,2,3,4); endchar;

lhchar "Italic Cyrillic letter omga_tlo - omega titlo";
cyrchar(omga_tlo,11u#,x_height#+acc_height#,0);
italcorr .7x_height#*slant+.5curve#-u# if math_fitting:-.15u# fi; %o+.35u
adjust_fit(if monospace:-.35u#,-.35u# else:0,0 fi); %bowl_adj
full_h:=h; h:=x_height;
% ital_omega;
pickup fine.nib; pos2(stem,-180); lft x2r=hround.5u; y2=y4=y6=y8=bar_height;
pos3(vair,-90); pos4(hair,0); pos5(vair,90);
pos6(hair,180); pos7(vair,270); pos8(stem,360);
bot y3r=bot y7r=-oo; top y5r=vround(.2[y4,h]+.5vair);
x3=.5[x2,x4]; x7+.25u=.5[x6,x8]; rt x8r=hround(w-.5u);
x5+.5stem=hround(.5[x2l,x8l]+.5stem)+eps;
x5=.5[x4,x6]; rt x4r-lft x6r=min(stem,2hair)+2eps;
y1+.5hair=h+oo; x1=min(x2l+1.25u,lft x6r); x9=w-x1; y9=y1;
pos1(hair,angle(2(x1-x2),y1-y2)+90); pos9(hair,-angle(2(x1-x2),y1-y2)+90);
if x4l<x6l: x4l:=x6l:=x5; fi
filldraw stroke z1e...z2e{down}...z3e{right}
 ...{up}z4e...{left}z5e;  % left arc
filldraw stroke z5e{left}...z6e{down}...
 z7e{right}...{up}z8e...z9e;  % right arc
%%%
%%%
% the accent
h:=full_h;
% low_palatal(expr .5w+u,0,-o);
x_center:=.5w+u; x_move:=0; y_move:=-o;
_one:=10; _two:=11; _three:=12; _four:=13;
_five:=14; _six:=15; _seven:=16; _eight:=17; _nine:=18;
%
% frown part
pickup fine.nib; numeric frown_width,flare_width;
frown_width=max(fine.breadth,.6[thin_join,vair]);
flare_width=max(fine.breadth,.5[thin_join,flare]);
penpos[_one](frown_width,180); penpos[_three](frown_width,0);
penpos[_two](frown_width,90);
top y[_two]r=y_move+x_height+max(if serifs:.75 fi acc_height,frown_width+1);
x[_two]=x_center-u; lft x[_one]r=hround(x[_two]-1.5u-0.5frown_width);
rt x[_three]r=hround(x[_two]+1.5u+0.5frown_width);
bot y[_one]=bot y[_three]=y_move+vround
   max(x_height+oo+tiny,1/3[x_height,h]+oo-.5frown_width);
%fill stroke z[_one]e{up}...z[_two]e{right}...{down}z[_three]e;  % stroke
% tilde part
penpos[_five](frown_width,180); penpos[_seven](frown_width,90);
penpos[_seven]'(flare_width,0);
bot y[_six]l=y[_two]r+.5flare_width;
rt x[_five]l=x[_one]r-.5flare_width;
x[_six]=x[_two]+.25u; x[_six]-x[_five]l=x[_seven]'l-x[_six];
rt x[_seven]=max(x[_six]+5.5u
 if monospace:/expansion_factor fi,x[_three]r+.5frown_width);
penpos[_six](flare_width,90);
bot y[_five]=bot y[_seven]'=bot y[_one]; bot y[_seven]l=x_height+oo;
forsuffixes e=l,r: path p.e;
p.e=(x[_five]e,y[_five]e+.5fine){up}
 ...z[_six]e{right}...{down}z[_seven]'e; endfor
fill subpath(0,1.5) of p.l..tension.85..
 {right}(x[_seven]l-.5fine,y[_seven]l)
 ...z[_seven]...(x[_seven]r-.5fine,y[_seven]r){left}
 ..tension.85..reverse subpath(0,1.6) of p.r...z[_five]...cycle;  % stroke
%%%
penlabels(1,2,3,4,5,6,7,8,9); endchar;

lhchar "Italic Cyrillic letter ot";
cyrchar(ot,11u#,x_height#+acc_height#,0);
italcorr .7x_height#*slant+.5curve#-u# if math_fitting:-.15u# fi; %o+.35u
adjust_fit(if monospace:-.35u#,-.35u# else:0,0 fi); %bowl_adj
full_h:=h; h:=x_height;
% ital_omega;
pickup fine.nib; pos2(stem,-180); lft x2r=hround.5u; y2=y4=y6=y8=bar_height;
pos3(vair,-90); pos4(hair,0); pos5(vair,90);
pos6(hair,180); pos7(vair,270); pos8(stem,360);
bot y3r=bot y7r=-oo; top y5r=vround(.2[y4,h]+.5vair);
x3=.5[x2,x4]; x7+.25u=.5[x6,x8]; rt x8r=hround(w-.5u);
x5+.5stem=hround(.5[x2l,x8l]+.5stem)+eps;
x5=.5[x4,x6]; rt x4r-lft x6r=min(stem,2hair)+2eps;
y1+.5hair=h+oo; x1=min(x2l+1.25u,lft x6r); x9=w-x1; y9=y1;
pos1(hair,angle(2(x1-x2),y1-y2)+90); pos9(hair,-angle(2(x1-x2),y1-y2)+90);
if x4l<x6l: x4l:=x6l:=x5; fi
filldraw stroke z1e...z2e{down}...z3e{right}
 ...{up}z4e...{left}z5e;  % left arc
filldraw stroke z5e{left}...z6e{down}...
 z7e{right}...{up}z8e...z9e;  % right arc
%%%
% the accent
%%%%%
% the accent
% low_te(16);
_zero:=5;
_one:=10; _two:=11; _three:=12; _four:=13;
_five:=14; _six:=15; _seven:=16; _eight:=17; _nine:=18;
%
if serifs: pickup crisp.nib;
 else: pickup pencircle scaled min(.5fine,.15vair); fi
numeric stem[]; stem1=if hefty: fudged.hair-2stem_corr else: .7[vair,stem] fi;
stem2=if serifs: vair else: max(currentbreadth+eps,.6[thin_join,vair]) fi;
stem3=if serifs: hair else: max(currentbreadth+eps,.6[thin_join,vair]) fi;
pos[_one](stem1,0); pos[_two](stem1,0);
lft x[_one]l=lft x[_two]l=hround(x[_zero]-.5stem1);
numeric mid_thickness;
mid_thickness=vround if serifs:1/4 else: 1/3 fi[vair,stem];
bot y[_two]=bot y[_four]=bot y[_five]=
  vround max(h+o+max(tiny,.5mid_thickness),1/3[h,h+acc_height]+o-.5mid_thickness);
top y[_one]=top y[_three]r=max(h+acc_height,bot y[_two]+1.5vair);
filldraw stroke z[_one]e--z[_two]e; % stem
pos[_three](stem2,90); pos[_four](stem3,0); pos[_five](stem3,180);
x[_three]=x[_one];
rt x[_four]r=hround(x[_zero]+2.5u if monospace:/expansion_factor fi+.5vair);
x[_four]-x[_three]=x[_three]-x[_five];
z[_four]'=beak_darkness[(x[_four]l,y[_three]l),
 .5[(x[_one]r,y[_three]l),z[_four]l] ];
z[_five]'=beak_darkness[(x[_five]l,y[_three]l),
 .5[(x[_one]l,y[_three]l),z[_five]l] ];
filldraw z[_four]r--z[_four]l{up}...z[_four]'
 ...{left}(x[_one]r,y[_three]l)--(x[_one]r,y[_three]l){left}...z[_five]'
 ...{down}z[_five]l--z[_five]r---
 (x[_five]r,y[_three]r)---(x[_four]r,y[_three]r)---cycle;
%%%
penlabels(1,2,3,4,5,6,7,8,9); endchar;

lhchar "Italic Cyrillic letter koppa (looks like c with tail)";
cyrchar(koppa,8u#,x_height#,desc_depth#);
italcorr if math_fitting:1/3x_height#*slant else:x_height#*slant-u# fi;
adjust_fit(if monospace:0 else:-.35u#fi,0); pickup fine.nib;
pickup fine.nib; pos2(vair,90); pos1(hair,0); pos0(flare,0);
x2=.5(w+u); top y2l=vround(h+1.5oo); y1=.5[bar_height,h];
rt x1r=max(rt x2,hround(w-u))+eps; bulb(2,1,0); % bulb
numeric theta; theta=-90-angle(27u,x_height); slope:=x_height/-27u;
pos5(fudged.stem-4stem_corr,theta); pos6(vair,135);
lft x3r=hround max(.6u,1.35u-.5curve); x3l-x3r=hround.8[vair,fudged.stem]-fine;
x5+u=x6=w-2u; y5=.1d; bot y6l=-d-oo;
ellipse_set(2l,3l,4l,5l); ellipse_set(2r,3r,4r,5r);
{{less_tense;
 filldraw stroke z6e{right}...z5e---z4e...{up}z3e...{right}z2e}}; % main stroke
penlabels(0,1,2,3,4,5,6); endchar;
