%
% lgt2slxi.mf
%
%% Cyrillic font container with T2 encoding beta-support
%
% This file is future part of lxfonts package
% Version 3.5 // Patchlevel=0
% (c) O.Lapko
%
% This package is freeware product 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 all this package as well) and to save it under the same name.
%
% Content:
%
% Italic Old Slav letters
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% List of letternames
%
% vnarrow_e
% zelo
% vuk
% vi_a
% izh_dgr
% Vl_yus
% izh_uml
% olg
% oery
% ohrdsgn
% oo_cdot
% oo_cddot
% Vizh
% t_peter
% zelo_m
%

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

lhchar "Italic Cyrillic letter vnarrow_e";
cyrcharmoving(vnarrow_e);

lhchar "Italic Cyrillic letter zelo";
cyrcharmoving(zelo);

lhchar "Italic Cyrillic letter vuk - variant uk";
cyrcharmoving(vuk);

lhchar "Italic Cyrillic letter vi_a - variant iot a";
cyrcharmoving(vi_a);

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 Vl_yus - like crossed Delta";
cyrcharmoving(Vl_yus);

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 olg - old soft el (elghe)";
cyrcharmoving(olg);

lhchar "Italic Cyrillic letter oery - old ery";
cyrcharmoving(oery);

lhchar "Italic Cyrillic letter ohrdsn - old hard sign";
cyrcharmoving(ohrdsn);

lhchar "Italic Cyrillic letter oo_cdot - old o cdot";
cyrcharmoving(oo_cdot);

lhchar "Italic Cyrillic letter oo_cddot - old o double cdot";
cyrcharmoving(oo_cddot);

lhchar "Italic Cyrillic letter vizh - Variant izhitsa";
cyrcharmoving(vizh);

lhchar "Italic Cyrillic letter t_peter -- looks like m";
cyrcharmoving(t_peter);

lhchar "Italic Cyrillic letter zelo_m -- variant zelo mirror";
cyrcharmoving(zelo_m);

lhchar "Italic Cyrillic letter izhei";
cyrcharmoving(izhei);

lhchar "Italic Cyrillic letter lo";
cyrcharmoving(lo);

lhchar "Italic Cyrillic letter mo";
cyrcharmoving(mo);

endinput;
%end of file
