%
% lgcmodl.mf
%
%% Cyrillic font container with T2 encoding beta-support
%
% This file is future part of lxfonts package
% Version 3.4 // 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:
%
% Lowercase Cyrillic modified letters and variants
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% List of letternames
%
% Modified
%
% Vg_hcrs
% lat_i_dsc
% Vdzhe
%

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

lhchar "Lowercase Cyrillic letter Vg_hcrs - Variant ghe hcrossed";
cyrchar(Vg_hcrs,8u#-.5width_adj#,x_height#,0);
italcorr x_height#*slant-beak_jut#+.25u#; %Gamma->x_height+.5u#
adjust_fit(serif_fit# if monospace:+\\.5u#,.5u#+ else:,fi\\ -.25u#);
% lower_g;
pickup tiny.nib; pos1(stem,0); pos2(stem,0);
lft x1l=lft x2l=hround (2.5u-.5stem); top y1=h; bot y2=0;
filldraw stroke z1e--z2e; % stem
pickup crisp.nib; pos3(Vround(vair-vair_corr),90); pos4(hair,0);
top y3r=h; x3=x1; rt x4r=hround(w-.45u); y4=good.y(y3l-beak/1.4)-eps;
arm(3,4,e,beak_darkness,.4beak_jut);  % upper arm and beak
if serifs:
 save slab; slab:=Vround(vair-vair_corr); % lower.slab
 nodish_serif(1,2,a,1/3,jut,b,1/3,.5jut);	% upper serif
 slab:=vair; % lower.slab
 dish_serif(2,1,c,1/3,jut,d,1/3,1.25jut); fi	% lower serif
%%%%%
bar_stroke(x1,x1r+1.7u);
penlabels(1,2,3,4); endchar;

lhchar "Lowercase Cyrillic letter lat_i_dsc - Ukrainian i descender";
%numeric dot_diam#; dot_diam#=max(dot_size#,cap_curve#);
cyrchar(lat_i_dsc,5u#,min(asc_height#,10/7x_height#+.5idot_diam#), %!!!from ec
 if is_ogonek: desc_depth# else: sbeak# fi); %ldesc/og_depth
%define_whole_blacker_pixels(idot_diam);
italcorr h#*slant-serif_fit#+.5idot_diam#-2u#;%!!!from ec
adjust_fit(serif_fit#+stem_shift# if monospace:+.25u#fi,
 if serifs: serif_fit# else: 0 fi % lr_serif_adj
	-stem_shift#);
begingroup
pickup tiny.nib; pos1(stem',0); pos2(stem',0);
if odd(w-stem'): change_width; fi
lft x1l=hround(.5w-.5stem'); x1=x2;
top y1=x_height if serifs: +min(oo,serif_drop) fi; bot y2=0;
filldraw stroke z1e--z2e;  % stem
pos3(idot_diam,0); pos4(idot_diam,90); %!!!from ec
if serifs: x3r=max(x1r,x1+.5(idot_diam-tiny)-.2jut) else: x3=x1-.5 fi; %!!!from ec
top y4r=h+1; if bot y4l-top y1<slab: y4l:=min(y4r-eps,y1+tiny+slab); fi
x3=x4; y3=.5[y4l,y4r]; dot(3,4);  % dot
if serifs: sloped_serif.l(1,2,a,1/3,.95jut,serif_drop); % upper serif
 if is_ogonek:
    save slab; slab:=vair; % lower.slab
    dish_serif(2,1,b,1/3,jut,c,1/3,.9jut); fi  %!!! % lower serif
fi
% lowercase descender/ogonek
if is_ogonek:
   endgroup;
   def the_pen=
       if known ogonek_pen: ogonek_pen elseif serifs: tiny else: fine fi
   enddef;
   % |stem| was drawn by |tiny| pen, hence |tiny| in the following equation:
   ogonek_pos=(x2 if not serifs: l fi,.5the_pen)
       if serifs and not is_egyptian: +(.5xvair,0) fi;
   easy_ogonek(the_pen,5,6,7); % ogonek
else:
   save slab; slab:=vair; % lower.slab
   numeric right_jut;
   right_jut=if serifs: 1.414jut else: hround (r-rt x2r-.5u) fi;
   r_serif(2,1,o,1/3,jut,p,1/3,beak_darkness,right_jut,.6beak_jut); % lower right descender
   endgroup;
fi
penlabels(1,2,3,4, 5,6,7); endchar;

lhchar "Lowercase Cyrillic letter Vdzhe";
cyrchar(Vdzhe,9u#-width_adj#,x_height#,desc_depth#);
italcorr x_height#*slant-beak_jut#+.35u#; %Gamma->x_height+.65u#
adjust_fit(0,1.7u#); if odd(stem-w): change_width; fi % symmetric & all three equal
% lower_t;
pickup tiny.nib; pos1(stem,0); pos2(stem,0);
lft x1l=lft x2l=hround(.5w-.5stem); top y1=h; bot y2=0;
filldraw stroke z1e--z2e; % stem
pickup crisp.nib; pos3(vair,90); pos4(hair,0);
top y3r=h; x3=x1; rt x4r=hround(w-.45u); y4=good.y(y3l-beak/1.4)-eps;
arm(3,4,e,beak_darkness,.4beak_jut);  % right arm and beak
pos5(hair,180); x5=w-x4; y5=y4;
arm(3,5,f,beak_darkness,-.4beak_jut);  % left arm and beak
%%%
if serifs:
 save slab; slab:=vair; % lower.slab
 %dish_serif(2,1,c,1/3,1.414jut,d,1/3,1.414jut); % lower serif
 slab:=Vround(vair-vair_corr); % lower.slab
 nodish_serif(1,2,a,1/3,.5jut,b,1/3,.5jut); fi	% upper bracketing
%%%%%
w:=w+1.7u;
% tail_part(2);
_zero:=2;
_one:=6; _two:=7; _three:=8; _four:=9; _five:=10;
_six:=11; _seven:=12; _eight:=13; _nine:=14;
%
pickup tiny.nib;
numeric bulb_diam;
bulb_diam=max(currentbreadth+eps,min(.82d-1-eps,hround 7/8[hair,flare]));
set_bar_axis; y[_one]r=y[_two]r=y2.bh; y[_one]l=y[_two]l=y1.bh;
penpos[_three](max(currentbreadth+eps,curve if hefty:-3stem_corr fi),0);
y[_three]=.5[y[_one]r,-d];
x[_two]l=x[_two]r=w-4.75u; x[_one]l=x[_one]r=x[_zero];
x[_three]r=hround(w-u); x[_two]l:=x[_four]l:=x[_two]r-.25curve;
{{interim superness:=more_super;
 fill stroke super_arc.e([_three],[_two])..z[_one]e}};  % lobe
if serifs: z[_five]=z[_three]; pos[_five](curve if hefty:-3stem_corr fi,0);
 pos[_six](vair,-90); bot y[_six]r=-d-oo; y[_seven]-.5flare=-.85d;
 pos[_seven](hair,-180); pos[_eight](bulb_diam,-180);
 rt x[_eight]l=max(lft x[_zero]l-jut+bulb_diam,
  floor x[_three]-3.5u if monospace: / expansion_factor fi);
 z[_seven]r=z[_eight]r;
 x[_six]=max(rt x[_eight]l,.6[x[_five],x[_seven]r]);
 (x,y[_six]r)=whatever[z[_six]l,z[_five]l];
 x[_six]r:=max(x,.5[x[_seven]r,x[_six]]);
 filldraw stroke super_arc.e([_five],[_six]);
 bulb([_six],[_seven],[_eight]); % bulb
else:
 pickup fine.nib; z[_five]=z[_three];
 pos[_five](max(fine.breadth,curve if hefty:-3stem_corr fi),0);
 pos[_nine](vair',-90); pos[_six](.6[vair',flare],-105);
 rt x[_six]r=x[_three]-4.5u; bot y[_six]r=-d;
 bot y[_nine]r=-d-oo; x[_nine]=.35[x[_six]r,x[_three]r];
 filldraw stroke super_arc.e([_five],[_nine])
  & term.e([_nine],[_six],left,.75,4); fi
%%%
if serifs: numeric inner_jut;
 if rt x2r+jut+.5u+1<=x[_three]r: inner_jut=jut;
  else: rt x2r+inner_jut+.5u+1=x[_three]r; fi
 slab:=vair; % lower.slab
 dish_serif(2,1,c,1/3,1.414jut,d,1/3,inner_jut); fi % lower serif
%%%%%
penlabels(1,2,3,4,5, 6,7,8,9,10,11,12,13,14); endchar;

endinput;
%end of file
