%
% lgsladi.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 not included in Unicode
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% List of letternames
%
% Vl_yus
% izh_uml
% i_a
% Olg
% Ong
% Oery
% Ohrdsgn
% Och
% Oshch
% Oo_cdot
% Oo_cddot
% Oe
% Ou
% On
%
% Vfita
% Vkoppa
%

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

lhchar "Italic Cyrillic letter Vl_yus - like crossed Delta";
cyrchar(Vl_yus,10u#+2stem#,x_height#,0);
adjust_fit(serif_fit#,serif_fit#);
numeric left_stem,right_stem,outer_jut,alpha;
right_stem=stem-stem_corr;
left_stem=min(hair if hefty: -3stem_corr fi,right_stem);
outer_jut=.8jut; x1l=w-x4r=l+letter_fit+.5u; y1=y4=0; %+outer_jut
x2-x1=x4-x3; x3r=x2r+apex_corr; y2=y3=h+apex_o+apex_oo;
alpha=diag_ratio(2,left_stem,y2-y1,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];
if y0<h-notch_cut: y0:=h-notch_cut;
 fill z0+.5right{down}...{z4-z3}diag_end(3l,4l,1,1,4r,3r)
  --diag_end(4r,3r,1,1,2l,1l)--diag_end(2l,1l,1,1,1r,2r){z2-z1}
  ...{up}z0+.5left--cycle; % left and right diagonals
else: fill z0--diag_end(0,4l,1,1,4r,3r)--diag_end(4r,3r,1,1,2l,1l)
  --diag_end(2l,1l,1,1,1r,0)--cycle; fi % left and right diagonals
penpos5(whatever,angle(z2-z1)); z5=whatever[z1,z2];
penpos6(whatever,angle(z3-z4)); z6=whatever[z3,z4]; y6=y5;
if hefty: y5r else: y5 fi =.5y0;
y5r-y5l=y6r-y6l=.6[thin_join,vair]; penstroke z5e--z6e; % bar line
penpos5'(whatever,angle(z2-z1)); z5'=whatever[z1,z2];
penpos6'(whatever,angle(z3-z4)); z6'=whatever[z3,z4]; y6'=y5';
bot y5'l=0;
y5'r-y5'l=y6'r-y6'l=vair'; penstroke z5'e--z6'e; % bar line
penlabels(0,1,2,3,4,5,5',6,6'); endchar;

lhchar "Italic Cyrillic letter izh_uml - izhitsa umlaut";
cyrchar(izh_uml,9.5u#,lc_trema_height#,0);
italcorr x_height#*slant+.25u#;
adjust_fit(.25u#,max(u#,.5u#+.5flare#)); %izhy_adj
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
lowercase_umlaut(.5[x1,x4]-.5w,0, 11,12,13,14);
penlabels(0,1,2,3,4,5,6,7,8,9,10, 11,12,13,14); endchar;

lhchar "Italic Cyrillic letter ligature i_a - iot a";
cyrchar(i_a,9u#,x_height#,0);
italcorr max(1/3x_height#*slant,x_height#*slant+.5(.2[hair#,stem#])-u#);
adjust_fit(if monospace: 4u# else: 4.5u# fi -.35u#,
 if monospace:-1.5u# else:0 fi); pickup fine.nib;
% ital_ia
forsuffixes $=hair,stem: shaved$:=mfudged$; save $; $=shaved$; endfor
numeric light_stem; light_stem=hround .75[hair,stem];
pos1(light_stem,0); pos1'(vair,-225); pos4(curve,-180);
rt x1r=rt x2r=rt x3r=hround(w-2.5u+.5light_stem);
y1+.5light_stem=h; y3=bar_height; x1'=x1; y1'=3/4x_height;
pos5(vair,-90); pos3(hair,0);
lft x4r=hround(1.5u-.5curve); x5=.5[x4,x3];
y4=.3[y5,y1]; bot y5r=-oo;
filldraw stroke z1'e{3(x4-x1),y4-y1}...pulled_arc.e(4,5)
 & pulled_arc.e(5,3);  %  bowl of a
% right_stem;
_one:=2; _two:=6; _three:=7;
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 circ_stroke z1e--z2e;  % stem
% 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]=x2; y[_five]=y[_six]=y1'; %!!!
filldraw stroke z[_five]e--z[_six]e; % bar %!!!
%%%
penlabels(0,1,2,3,4,5,6,7,8,9,10,11,12,13); endchar;

lhchar "Italic Cyrillic letter Olg - old soft el (elghe)";
cyrchar(Olg,9u#,x_height#,0);
italcorr x_height#*slant+.5stem#-u#; %tau
adjust_fit(if monospace:-.5u# else:.5u# fi, %wbulb_adj
 max(2u#,u#+stem#) if monospace:-u# fi);
% ital_l;soft
pickup fine.nib;
pos1(vair,-90); pos2(stem,180); pos3(hair,0); pos10(stem,0);
pos4(vair,-90); pos5(hair,-180); pos6(flare,-180);
top y1l=h; x1=.5[x3,x2];
x3=3u; y3=.35h; %!!!
y6-.5flare=.1h; lft x6r=-.25u; z5r=z6r;
bot y4r=-oo; x4=max(.4[lft x6r,rt x3r],lft x6r+.5flare-eps);
top y10=top y1l; lft x10l=lft x7l=hround(w-2.5u-.5stem); x10=x2; y2=y1; %!!!
bulb(4,5,6); % bulb
filldraw stroke pulled_arc.e(4,3) &  super_arc.e(3,1)...z2e; %!!! % left stem
% 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 z7e--z10e;
% italic beak
pickup fine.nib;
pos11(stem,0); rt x11r=r-letter_fit  if monospace:+.5stem else:-.25u fi;
y11-.5stem=2/3x_height-.5fine;
pos12(stem,0); pos13(vair,90); pos14(vair,90);
x14=x2; top y14r=top y13r=x_height; x12=x11; y12=bot y13l-.25flare;
x13+.25flare=lft x11l; x13r:=lft x11l-(top y13r-y12);
filldraw circ_stroke z11e{up}--z12e{up}...z13e{left}--z14e; % ital_beak
penlabels(1,2,3,4,5,6,7,8,9,10,11,12,13,14); endchar;

% older forms of Cyrillic letters
% italic form repeat "non old" form
lhchar "Italic Cyrillic letter Ong - old soft en (enghe)";
cyrchar(Ong,10u#,x_height#,0);
italcorr x_height#*slant+.5stem#-u#; %tau
adjust_fit(0,max(2u#,u#+stem#) if monospace:-u# fi);
% ital_ng;
pickup fine.nib; x2=x3; pos3(stem,0); lft x3l=hround(2.5u-.5stem);
%ihalfstem;
if monospace: pos2(stem,0); top y2=h;
else: x0=0; hook_in(0,1,2); fi % opening hook
y3-.5stem=-oo;
filldraw circ_stroke z3e--z2e;
x10=x3l; y10=y11=bar_height; pos10(vair,90); pos11(vair,90);
pos6(stem,0); rt x7r=hround(w-2.5u+.5stem); top y6=h; x7=x6;
% 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
z7'=z7; pos7'(stem,0);
filldraw circ_stroke z7'e--z6e; x11=x6l; filldraw stroke z10e--z11e;
% italic beak
pickup fine.nib;
pos12(stem,0); rt x12r=r-letter_fit  if monospace:+.5stem else:-.25u fi;
y12-.5stem=2/3x_height-.5fine;
pos13(stem,0); pos14(vair,90); pos15(vair,90);
x15=x6; top y15r=top y14r=x_height; x13=x12; y13=bot y14l-.25flare;
x14+.25flare=lft x12l; x14r:=lft x12l-(top y14r-y13);
filldraw circ_stroke z12e{up}--z13e{up}...z14e{left}--z15e; % ital_beak
%%%
penlabels(0,1,2,3,4,5,6,7,8,9,10,11); endchar;

lhchar "Italic Cyrillic letter Oery - old ery";
cyrchar(Oery,if monospace: 6u# else:7.5u#fi,x_height#,0);
italcorr .7x_height#*slant+.5curve#-u# if math_fitting:-.5u# fi;
adjust_fit(u#,if monospace:2.5u# else:4u# fi);
% ital_hrdsn;
pickup tiny.nib;
pos1(hair,0); pos1'(hair,-45); pos2(hair,0);
rt x1r=hround(w-2u-eps); top y1=h;
lft x2l=hround(u-.5stem); y2=.6bar_height;
z1'=(.35[x1,x2],.65[y1,1.2bar_height+oo]);
filldraw stroke z2e{up}....{2(x1-x2),(y1-1.2bar_height)}z1'e..{up}z1e;  % stem
% hrdsn_beak;
pos6(hair,180); pos7(.6[hair,curve],60); pos8(hair,90);
z8r=z1r; x6=-u; y6=3/4x_height; x7=.5[x6,x8];
top y7r=top y8r;
filldraw stroke z6e{up}...{5,-1}z7e...{1,1}z8e; % fillip
pickup fine.nib; pos2'(stem,-180); pos3(vair,-90);
pos4(curve,0); pos5(vair,90);
lft x2'r=tiny.lft x2l;
y2'=y2;  x3=x5=.5[x2,x4]; rt x4r=hround(w-u+.5curve);
bot y3r=-oo; top y5r=1.2bar_height+oo; y4=y2;
filldraw stroke pulled_arc.e(2',3) & pulled_arc.e(3,4)
 & pulled_arc.e(4,5) & pulled_arc.e(5,2');  % bowl
%%%
% I
w:=w+4u;
pos11(stem,0); y11+.5stem=h; rt x11r=hround(w-2.5u+.5stem); x12=x11;
if monospace: pos14(vair,90); x14=good.x .5[x11,w]; bot y14l=0; y12=1/3h;
 pos12(stem,0); filldraw stroke z12e{down}...{right}z14e; % terminal
else: x14=w; hook_out(12,13,14); fi % opening hook
filldraw circ_stroke z11e--z12e; % stem
%pickup tiny.nib;
filldraw circ_stroke z11e--z12e;
penlabels(1,2,2',3,4,5,100,101,102); endchar;

% repeat "non old" form
lhchar "Italic Cyrillic letter Ohrdsn - old hard sign";
cyrchar(Ohrdsn,if monospace: 6u# else:7.5u#fi,x_height#,0);
italcorr .7x_height#*slant+.5curve#-u# if math_fitting:-.5u# fi;
adjust_fit(u#,0);
% ital_hrdsn;
pickup tiny.nib;
pos1(hair,0); pos1'(hair,-45); pos2(hair,0);
rt x1r=hround(w-2u-eps); top y1=h;
lft x2l=hround(u-.5stem); y2=.6bar_height;
z1'=(.35[x1,x2],.65[y1,1.2bar_height+oo]);
filldraw stroke z2e{up}....{2(x1-x2),(y1-1.2bar_height)}z1'e..{up}z1e;  % stem
% italic_beak(1,x);
pos6(hair,180); pos7(.6[hair,curve],60); pos8(hair,90);
z8r=z1r; x6=-u; y6=3/4x_height; x7=.5[x6,x8];
top y7r=top y8r;
filldraw stroke z6e{up}...{5,-1}z7e...{1,1}z8e; % fillip
pickup fine.nib; pos2'(stem,-180); pos3(vair,-90);
pos4(curve,0); pos5(vair,90);
lft x2'r=tiny.lft x2l;
y2'=y2;  x3=x5=.5[x2,x4]; rt x4r=hround(w-u+.5curve);
bot y3r=-oo; top y5r=1.2bar_height+oo; y4=y2;
filldraw stroke pulled_arc.e(2',3) & pulled_arc.e(3,4)
 & pulled_arc.e(4,5) & pulled_arc.e(5,2');  % bowl
%%%
penlabels(1,2,2',3,4,5,100,101,102); endchar;

% italic form of next few letter are rather conditional
% don't look at them seriously
lhchar "Italic Cyrillic letter Oe - old e (C with mid-line)";
cyrchar(Oe,7u#,x_height#,0); % eng
italcorr x_height#*slant-.2u#;
adjust_fit(if monospace: .5u#,-1.5u# else: 0,-1.1u# fi);
pickup fine.nib; pos2(vair',90); pos4(vair',270);
x2=x4=.5(w+u); top y2r=vround(h+1.5oo); bot y4r=-oo;
pos3(curve,180); lft x3r=hround max(.6u,1.35u-.5curve); y3=.5h; % eng
pos1(hair,0); pos0(flare,0);
y1=min(bar_height+2vair'+2,.9[bar_height,h]-flare);
pos5(hair,0); rt x1r=rt x5r=hround(w-.5u);
y5=max(good.y(.5bar_height-.9),y4l+vair');
(x,y4l)=whatever[z4r,z5l]; x4l:=min(x,x4l+.5u);
x10'r=x10'l+(x1r-x1l)=.5[x2r,x1r]+eps; x11'r=x11'l+(x5r-x5l)=.5[x4r,x5r]+eps;
forsuffixes e=l,r: path pt.e,pb.e; pt.e=z1e{x2-x1,5(y2-y1)}...{left}z2e;
 pb.e=z4e{right}..tension .9 and 1..{x5-x4,5(y5-y4)}z5e;
numeric tt.e,tb.e; tt.e=ypart(((x10'e,0)--(x10'e,h)) intersectiontimes pt.e);
 tb.e=ypart(((x11'e,0)--(x11'e,h)) intersectiontimes pb.e); endfor
filldraw stroke subpath(tt.e,1) of pt.e &
 pulled_super_arc.e(2,3)(.7superpull) & pulled_super_arc.e(3,4)(.5superpull)
 & subpath(0,tb.e) of pb.e;  % arc and lower terminal
% hstroke
bar_stroke(x3l,0.85[x3l,x11'l]-eps); % bar
penlabels(1,1',2,3,4,5,6); endchar;

% like flipped h
lhchar "Italic Cyrillic letter Ou - old u";  %
cyrchar(Ou,if monospace:8.5u# else:9u#fi,x_height#,desc_depth#);
italcorr x_height#*slant+.5stem#-u#;
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=.5[x3,x5];
pos6(stem,0); rt x6r=hround(w-1.5u+.5stem);
y3=.7[y4,y5]; bot y4r=-oo; y5=.57h; x5=x6=x7;
filldraw stroke z2'e{-u,-x_height}
 ...super_arc.e(3,4)...{up}z5e; % left stem and arc
pickup tiny.nib; y6+.5stem=h; z6'=z6;
pos6'(stem,0); pos7(stem,0);
bot y7=-d; filldraw circ_stroke z6e--z7e;  % stem
save slab; slab:=vair; % lower.slab
dish_serif(7,6,a,1/3,jut,b,1/3,.75jut);	% serif
penlabels(0,1,2,3,4,5,6,7); endchar;

lhchar "Italic Cyrillic letter On - old en";
cyrchar(On,9u#+width_adj#,x_height#,0); % n_width
italcorr x_height#*slant-beak_jut#-.25u#;
adjust_fit(u#,max(.5u#,.5curve#));
numeric thin_stem; thin_stem=hround(fudged.hair+stem_corr);
pickup tiny.nib; y2=.35h; bot y8r=-oo;
pos10(flare,-180); pos9(hair,-180); pos8(vair,-90);
y10-.5flare=.1h; lft x10r=l+letter_fit+hround(.5u-.5); z9r=z10r;
pos1(thin_stem,0); pos2(thin_stem,0); pos3(thin_stem,0); pos4(thin_stem,0);
top y1=h; bot y4=0; x1=x2; x3=x4; x1l=w-x3r;
y3=min(.5x_height,h-curve);
rt x3r=hround(w-2.5u+.5fudged.stem);
x8=max(lft x10r+.5flare,.4[lft x10r,rt x2r]);
filldraw stroke pulled_arc.e(8,2) & z2e--z1e; % left stem
filldraw stroke z3e--z4e; % right stem
bulb(8,9,10);
penpos5(whatever,0); penpos6(whatever,90); z5l=z1l; z6l=z4l;
 z7=z6l+(max(eps,stem-3stem_corr-tiny),0) rotated (angle(z5l-z6l)-90);
 z5r=z7+whatever*(z5l-z6l); z6r=z7+whatever*(z5l-z6l);
 filldraw stroke z5e..z6e;  % diagonal
%v_bulb: w changed to r
 y11+.5curve=x_height+o+oo; x11+.5curve=r-.5u;
 numeric theta; theta=angle(4(x3-x11),y3-y11); pos11(curve,theta+90);
 filldraw z11l{dir theta}..tension atleast 1 and 1..{z4r-z3r}z3l
  --z3r{z3r-z4r}...{-dir theta}z11r..cycle;  % bulb
sloped_serif.l(5,6,a,1/3,jut,serif_drop);
penlabels(1,1',2,3,4,4',5,6,7,8,9,10,11); endchar;

% repeat non old form
lhchar "Italic Cyrillic letter Och - old che";
cyrchar(Och,9.5u#,x_height#,0);
italcorr 1/3x_height#*slant+.5hair#+.5u#;
adjust_fit(0,0);
% ital_ch;
pickup fine.nib; interim superness:=more_super;
x2=x3; pos3(stem,-180); lft x3r=hround(2.5u-.5stem);
% left shstem;
if monospace:
 pos0(vair,90); x0=good.x .5[0,x2]; top y0l=h; y2=2/3h; pos2(stem,0);
 filldraw stroke z2e{u,x_height}...{left}z0e; % terminal
else:
 x0=0;  hook_in(0,1,2)(skewed); fi % opening hook
pos2'(stem,-180); z2'=z2;
pos4(vair,-90); pos5(hair,0); x4=.5[x3,x5];
pos6(stem,0); rt x6r=hround(w-2.5u+.5stem);
x5=x6=x7; x9=w; hook_out(7,8,9);  % closing hook
bot y4r=.75bar_height; y5=.75h; y3=min(y2-eps,.7[y4,y5]); y6+.5stem=h;
filldraw stroke z2'e...super_arc.e(3,4)...{up}z5e; % left stem and arc
filldraw circ_stroke z6e--z7e;  % right stem
%%%
penlabels(0,1,2,3,4,5,6,7,8,9); endchar;

lhchar "Italic Cyrillic letter Oshch - old shcha";
cyrchar(Oshch,15u#,x_height#,desc_depth#);
italcorr 1/3x_height#*slant+.5hair#+.5u#;
adjust_fit(if monospace:-2u#,-1.5u# else: 0,0 fi); %rshstem_adj&lstem_adj
% ital_sh;
pickup fine.nib; interim superness:=more_super;
numeric shaved_stem; shaved_stem=mfudged.stem; save stem; stem=shaved_stem;
x2=x3+.25u; pos3(stem,-180); lft x3r=hround(2.5u-.5stem);
if monospace: pos0(vair,90); x0=good.x .5[0,x2]; top y0l=h; y2=2/3h;
 pos2(stem,0); filldraw stroke z2e{u,x_height}...{left}z0e; % terminal
else: x0=0;  hook_in(0,1,2)(skewed); fi % opening hook
pos2'(stem,-180); z2'=z2; pos4(vair,-90); pos5(min(stem,hair),0); x4=.5[x3,x5]; x5=x7';
pos5'(min(stem,hair),0); pos6'(vair,-90); pos7'(stem,-180); x5'=x7; y5'=y5;
pos8'(stem,-180); x8'=x7'; y8'+.5stem=h;
pos6(stem,0); rt x7r=hround(w-2.5u+.5stem);
x6=x7; y3=.7[y4,y5]; bot y4r=-oo; y5=.57h; y6+.5stem=h;
x7'+.5stem=hround(.5w+.5stem);
% 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
x6'=.6[x5',x7']; bot y6'r=bot y4r; y7'=.35x_height;
filldraw stroke super_arc.e(7',6')...{up}z5'e; % middle stroke
filldraw circ_stroke z8'e--z7'e; % middle stem
filldraw stroke z2'e{-u,-x_height}
 ...super_arc.e(3,4)...{up}z5e; % left stem and arc
filldraw circ_stroke z6e--z7e;  % right stem
% from dzhe serif
x10=x7; y10=-.25d; x11=x5; y11=-.8d; x12=x11-1.5u; y12=y11+u;%-d
z4'=z6'; penpos4'(vair,-90);
penpos10(vair,-180); penpos11(if not monospace:.7 fi stem,-270);
penpos12(hair,-360);
fill circ_stroke z12e{down}...{right}z11e...z10e..{-2,1}z4'e;
penlabels(0,1,2,3,4,5,6,7,8,9,10,11,12); endchar;

lhchar "Italic Cyrillic letter Oo_cdot - old o cdot";
cyrchar(Oo_cdot,10u#,x_height#,0); %f width-u
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
% dot
pickup tiny.nib;
dot_diam:=min((lft x4l-rt x2l-1),
max(tiny.breadth,hround(max(dot_size,cap_curve)-2stem_corr)));
pos5(dot_diam,0); pos5'(dot_diam,90);
z5=z5'; x5=x1; y5=.5[y1,y3]; dot(5,5');
penlabels(1,2,3,4,5,5'); endchar;

lhchar "Italic Cyrillic letter Oo_cddot - old o double cdot";
cyrchar(Oo_cddot,11u#,x_height#,0); %f width
italcorr .7x_height#*slant+.5curve#-u# if math_fitting:-.5u# fi;
adjust_fit(if monospace:-.5u#,-.5u# 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
% dots
_one:=5; _two:=6; _three:=7; _four:=8;
dot_diam:=min(.5(lft x4l-rt x2l)-1,
max(tiny.breadth,hround(max(dot_size,cap_curve)-2stem_corr)));
pickup tiny.nib;
pos[_one](dot_diam,0); pos[_two](dot_diam,90);
x[_one]=x[_two]=.5w-1.375u; y[_one]=y[_two]=.5[y1,y3];
dot([_one],[_two]);  % left dot
pos[_three](dot_diam,0);
penpos[_four](y[_two]r-y[_two]l,90);
y[_three]=y[_four]=y[_one]; x[_three]=x[_four]=x[_one]+2.75u;
dot([_three],[_four]);  % right dot
penlabels(1,2,3,4, 5,6,7,8); endchar;

% like tilded o
lhchar "Italic Cyrillic letter Vfita";
cyrchar(Vfita,9u#,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
%%tilde
numeric bar[]; pickup fine.nib; bar1=max(fine.breadth,.6[thin_join,vair]);
z5=z2l; z6=z4l; penpos5(bar1,90); penpos6(bar1,90);
if serifs: bar2=.5[bar,curve];
 if bar#>.5curve#: fill stroke z5e--z6e; else:
 penpos7(bar2,90); z7=.5[z5,z6];
 fill stroke z5e{1,1}..{1,-1}z7e..{1,1}z6e; fi
else: fill stroke z5e--z6e; fi
penlabels(1,2,3,4,81,82,83); endchar;

lhchar "Italic Cyrillic letter Vkoppa - Variant koppa (c with tail)";
cyrchar(Vkoppa,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 tiny.nib; pos0(stem,0); pos7(stem,0);
rt x0r=rt x1r+eps; x7=x0; pickup fine.nib;
bot y7-.5stem=-d-oo; x5=x0; top y5l=tiny.top y0;
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-u))+eps;
lft x3r=hround(1.5u-.5curve); 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 .75bar_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
pickup tiny.nib; filldraw circ_stroke z7e--z0e;  % stem
save slab; slab:=vair; % lower.slab
serif(0,7,a,1/3,-max(jut,1.5u)); % serif
penlabels(0,1,2,3,4,5,6); endchar;
