%
% lgocyrac.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:
%
% Old Slav Accents and Signs
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% List of accents & signs
%
% thousands
% titlo
% palatal
% dasia
% psili
% accte
% kamora
% paerok
% pneuac
% pneugr
% zvat
%
% tma
% legion
% leodr
% vran
% koloda
% tmatem
%
% vzvat
% vdasia
% vpsili
% udasia
% upsili
% vpneuac
% vpneugr
%

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

lhchar "Cyrillic sign thousands"; % ss uses SlavTeX form
cyrchar(thousands,if serifs:8u# else:7u# fi,x_height#,desc_depth#);
adjust_fit(0,0);
if serifs: pickup tiny.nib; %pickup crisp.nib;
 numeric bulb_diam,mid_thickness,stem[];
 stem1=fudged.hair if hefty:-4stem_corr fi; bulb_diam=.7[vair,flare];
 mid_thickness=vround if serifs:1/4 else: 1/3 fi[vair,stem];
 x0=w-u; y0=vround .5bar_height; pos0(vair,90);
 lft x2r=u; bot y2=-.5d if serifs:+.25bulb_diam fi; pos2(vair,180);
 pos3(bulb_diam,180); cyrbulb(0,2,3);
 numeric theta; theta=-135;
 pos4(vair,theta); pos4'(vair,theta); pos5(vair,theta); pos5'(vair,theta);
 path thous_p; thous_p=z0{left}...z2{down};
 z1'=((.3[x2r,x0],-d)--(.3[x2r,x0],h)) intersectionpoint thous_p;
 z2'=((.75[x2r,x0],-d)--(.75[x2r,x0],h)) intersectionpoint thous_p;
 z4 =z1'+1.5u*dir(theta-90); z4'=z1'-1.5u*dir(theta-90);
 z5 =z2'+1.5u*dir(theta-90); z5'=z2'-1.5u*dir(theta-90);
 filldraw stroke z4e--z4'e; filldraw stroke z5e--z5'e;
else: pickup fine.nib;
 numeric middle_weight,theta,stem[];
 middle_weight=max(fine.breadth,.6[thin_join,vair]);
 stem1=1/3[max(fine.breadth,.6[thin_join,vair]),stem];
 theta=angle(1/2(w-fine-max(u,.5u+.5stem1)-stem1),d); z0=(w/2,0);
 z1=z0+5u*dir(theta); z2=z0-5u*dir(theta); if y2<-d: y2:=-d; y1:=2y0-y2; fi
 pos1(stem1,theta-90); pos2(stem1,theta-90);
 filldraw stroke z1e--z2e;
 z3=z0+min(2u,.5(x0-x2))*dir(theta)+2u*dir(theta-90);
 z4=z0+min(2u,.5(x0-x2))*dir(theta)-2u*dir(theta-90);
 z5=z0-min(2u,.5(x0-x2))*dir(theta)+2u*dir(theta-90);
 z6=z0-min(2u,.5(x0-x2))*dir(theta)-2u*dir(theta-90);
 pos3(middle_weight,theta); pos4(middle_weight,theta);
 pos5(middle_weight,theta); pos6(middle_weight,theta);
 filldraw stroke z3e--z4e; filldraw stroke z5e--z6e; fi
penlabels(0,1,1',2,2',3,4,4',5,5',6); endchar;

lhchar "Cyrillic accent titlo";
cyrchar(titlo,8u#,x_height#+acc_height#,0);
italcorr h#*slant+.5vair#-1.5u#;
adjust_fit(0,0); x1=.5w;
% low_titlo (1);
_zero:=1;
_one:=2; _two:=3; _three:=4; _four:=5; _five:=6; _six:=7;
%
pickup fine.nib; numeric stem[];
stem0=if serifs: .8[hair,stem] else: fudged.hair-4stem_corr fi;
pos[_one](stem0,0); pos[_two](stem0,0);
pos[_three](stem0,0); pos[_four](stem0,0);
numeric middle_weight;
middle_weight=if serifs: vair else: max(fine.breadth,.6[thin_join,vair]) fi;
pos[_five](middle_weight,90); pos[_six](middle_weight,90);
lft x[_one]l=lft x[_two]l=x[_zero]-hround(2.75u+.5stem0);
rt  x[_four]r=rt  x[_three]r=x[_zero]+hround(2.75u+.5stem0);
x[_five]=x[_one]r; x[_six]=x[_three]l;
top y[_five]r=top y[_one]; bot y[_six]l=bot y[_four];
top y[_three]=h+o;
bot y[_two]=if serifs: max(2/3[x_height+acc_height,x_height],x_height+o+hair)-.5crisp
               else:   vround 2/3[x_height+acc_height,x_height] fi;
y[_one]=5/6[y[_two],y[_three]]; y[_four]=1/6[y[_two],y[_three]];
filldraw stroke z[_five]e--z[_six]e; % bar
filldraw stroke z[_one]e--z[_two]e; filldraw stroke z[_three]e--z[_four]e; % stems
%%%
endchar;

lhchar "Cyrillic accent palatal";
cyrchar(palatal,10u#,min(asc_height#,2x_height#),0); %
italcorr h#*slant+.5vair#-1.5u#;
adjust_fit(0,0);
% low_palatal;
x_center:=.5w; x_move:=0; y_move:=-o;
_one:=1; _two:=2; _three:=3; _four:=4;
_five:=5; _six:=6; _seven:=7; _eight:=8; _nine:=9;
%
pickup fine.nib; numeric stem[];
stem1=if serifs: vair else: max(currentbreadth+eps,.6[thin_join,vair]) fi;
stem2=if serifs: .8[hair,stem] else: vair fi;
pos[_one](stem1,180); pos[_three](.5[stem2,stem1],0);
pos[_two](stem2,90); pos[_four](stem1,90);
top y[_two]r=h+o; x[_two]=x_center;
rt x[_one]l =hround(x[_two]-3.75u if monospace: /expansion_factor fi +.5stem1);
lft x[_three]l=hround(x[_two]+3.75u if monospace: /expansion_factor fi -.5stem1);
bot y[_one]=bot y[_three]=
   if serifs: max(2/3[x_height+acc_height,x_height],x_height+o+hair)-.5crisp
      else:   vround 2/3[x_height+acc_height,x_height] fi;
bot y[_four]=x_height+o; x[_four]=w+eps;
forsuffixes e=l,r:
  path p; p=z[_two]e{right}...{(x[_three]-x[_one]),-7acc_height}z[_three]e;
  z[_three]'e=point .8 of p; endfor
filldraw stroke z[_one]e{(x[_three]-x[_one]),7acc_height}...
         z[_two]e{right}...
         {direction .8 of p}z[_three]'e...{right}z[_four]e; % stroke
%%%
endchar;

lhchar "Cyrillic accent paerok - vertical tilde";
cyrchar(paerok,5u#,asc_height#,0);%Apostrophe height
italcorr asc_height#*slant+.5pdot_diam#-2u#;%Apostrophe
adjust_fit(if monospace: u#,u# else: 0,0 fi);
pickup if serifs:  crisp.nib;
 if not monospace: if vair#>.8curve#: pickup rule.nib; autorounded; fi fi
else: fine.nib; fi
numeric stem[];
stem1=max(currentbreadth+eps,if serifs: .7 rule_thickness else:.6[thin_join,vair] fi);
stem2=max(currentbreadth+eps,if serifs:1.4 rule_thickness else:vair fi);
pos1(stem1,90); pos2(stem2,180); pos3(stem2,180); pos4(stem1,90);
pos0(1.1stem1,-135); z0=.5[z1,z4];
rt x1=rt x3l=hround(w-u)-eps; lft x2r=lft x4=hround(w-x1)+eps;
top y1r=h+oo+eps; bot y4l=good.y(asc_height-comma_depth-pdot_diam)-eps; % Apostrophe depth
.5[y1,y4]=.5[y2,y3]; y1-y2=1/4(y1-y4);
filldraw stroke z1e{left}...z2e{down}..z0e..{down}z3e...{left}z4e;  % stroke
penlabels(1,2,3,4,0); endchar;

lhchar "Cyrillic accent kamora";
cyrchar(kamora,9u#,x_height#+acc_height#,0);
italcorr h#*slant+.5vair#-1.5u#;
adjust_fit(0,0);
%!!! lowercase_breve flipped
x_center:=.5w; y_move:=0; _one:=1; _two:=2; _three:=3;
%
pickup if serifs: crisp else: fine fi nib;
pos[_one](vair,180); pos[_three](vair,0);
top y[_two]r=h; %!!!v
x[_two]=x_center;
lft x[_one]r=hround(x[_two]-2u%narrower frown
   if monospace: /expansion_factor fi -0.5vair);
rt x[_three]r=hround(x[_two]+2u%narrower frown
   if monospace: /expansion_factor fi +0.5vair);
numeric mid_thickness;
mid_thickness=if serifs:vround (1/3[vair,stem]) else: vair fi;%!!!
bot y[_one]=bot y[_three]= %!!!
   if serifs: max(2/3[x_height+acc_height,x_height],x_height+o+hair)-.5crisp
      else:   vround 2/3[x_height+acc_height,x_height] fi;
if y[_two]r<(y[_one]+.5crisp+eps): %!!!
   y[_two]r:=y[_one]+.5crisp+eps; fi %!!!
pos[_two](mid_thickness,90); %!!! moved here after if
if serifs:
filldraw stroke z[_one]e{(3(x[_one]r-x[_three]r),acc_height)}...
         z[_two]e{right}...{(3(x[_one]r-x[_three]r),-acc_height)}z[_three]e;  % stroke
else:
filldraw stroke z[_one]e{((x[_one]r-x[_three]r),3acc_height)}...
         z[_two]e{right}...{((x[_one]r-x[_three]r),-3acc_height)}z[_three]e;  % stroke
fi
%
penlabels(1,2,3); endchar;

lhchar "Cyrillic accent dasia pneumata";
cyrchar(dasia,9u#,min(asc_height#,2x_height#),0); %
italcorr h#*slant+.5vair#-1.5u#;
adjust_fit(0,0);
pickup if serifs: crisp else: fine fi nib;
numeric bulb_diam,stem[];
stem1=if serifs: vair else: max(currentbreadth+eps,.6[thin_join,vair]) fi;
stem2=if serifs:vround (1/4[vair,stem]) else: vair fi;
bulb_diam=max(currentbreadth+eps,min(flare,3u-vair-1-eps));
lft x0r=hround (.5w-1.25u if monospace: /expansion_factor fi -0.5stem1);
bot y0=if serifs: max(2/3[x_height+acc_height,x_height],x_height+o+hair)-.5crisp
            else: vround 2/3[x_height+acc_height,x_height] fi;
pos0(stem1,180); x1=.5w; top y1r=h+o; pos1(stem2,90);
y2=if hefty: y0 if monospace:+.5bulb_diam-.5currentbreadth fi
           else: min(bot y0+7/8bulb_diam,top y1r-currentbreadth-eps) fi;
if serifs:
 rt x2r=hround (.5w+2u if monospace: /expansion_factor fi);
 pos2(stem1,0); pos3(bulb_diam,0); cyrbulb(1,2,3);
else:
 x2r=w-x0r; pos2(stem1,0);
 y2'=y2+1/6(h-x_height); lft x2'l=lft x2l; pos2'(stem2,0);
 forsuffixes e=l,r: path p.e;
   p.e=z2e{(3(x2-x0),acc_height)}...{left}z1e;
   numeric t.e; t.e:=xpart(p.e intersectiontimes ((z2'e)--(x2'e,h+o+eps)));
 endfor
 filldraw stroke z2'e{up}---subpath (t.e,1) of p.e;
fi
if y1r<(y2+.5currentbreadth+eps): y1r:=y2+.5currentbreadth+eps; fi
filldraw stroke z0e{(3(x0-x2),acc_height)}...{right}z1e;
endchar;

lhchar "Cyrillic accent psili pneumata";
cyrchar(psili,9u#,min(asc_height#,2x_height#),0); %
italcorr h#*slant+.5vair#-1.5u#;
adjust_fit(0,0);
pickup if serifs: crisp else: fine fi nib;
numeric bulb_diam,stem[];
stem1=if serifs: vair else: max(currentbreadth+eps,.6[thin_join,vair]) fi;
stem2=vround if serifs:(1/4[vair,stem]) else: vair fi;
bulb_diam=max(currentbreadth+eps,min(flare,3u-vair-1-eps));
rt x0r=hround (.5w+1.25u if monospace: /expansion_factor fi +0.5stem1);
bot y0=if serifs: max(2/3[x_height+acc_height,x_height],x_height+o+hair)-.5crisp
            else: vround 2/3[x_height+acc_height,x_height] fi;
pos0(stem1,0); x1=.5w; top y1r=h+o; pos1(stem2,90);
y2=if hefty: y0 if monospace:+.5bulb_diam-.5currentbreadth fi
           else: min(bot y0+7/8bulb_diam,top y1r-currentbreadth-eps) fi;
if serifs:
 lft x2r=hround (.5w- 2u if monospace: /expansion_factor fi);
 pos2(stem1,180); pos3(bulb_diam,180); cyrbulb(1,2,3);
else:
 x2r=w-x0r; pos2(stem1,180);
 y2'=y2+1/6(h-x_height); rt x2'l=min(x1-1-eps,rt x2l); pos2'(stem2,180);
 forsuffixes e=l,r: path p.e;
   p.e=z2e{(3(x2-x0),acc_height)}...{right}z1e;
   numeric t.e; t.e:=xpart(p.e intersectiontimes ((z2'e)--(x2'e,h+o+eps)));
 endfor
 filldraw stroke z2'e{up}---subpath (t.e,1) of p.e;
fi
if y1r<(y2+.5currentbreadth+eps): y1r:=y2+.5currentbreadth+eps; fi
filldraw stroke z0e{(3(x0-x2),acc_height)}...{left}z1e;
endchar;

lhchar "Cyrillic zvatel'stvo accent";
cyrchar(zvat,9u#,min(asc_height#,2x_height#),0);%height enlarged
italcorr h#*slant+.5vair#-1.5u#;
adjust_fit(0,0);
pickup if serifs: crisp else: fine fi nib;
%!!! zvat
x_center:=.5w; y_move:=0; _one:=1; _two:=2; _three:=3;
%
numeric stem[];
stem1=if serifs: vair else: max(currentbreadth+eps,.6[thin_join,vair]) fi;
stem2=if serifs:vround  (1/3[vair,stem]) else: vair fi;
pos[_one](stem1,180); pos[_three](stem1,0);
top y[_two]r=h+o; x[_two]=x_center;
rt x[_one]l   =hround(x[_two]-1.35u if monospace: /expansion_factor fi +0.5stem1);%
lft x[_three]l=hround(x[_two]+1.35u if monospace: /expansion_factor fi -0.5stem1);%
bot y[_one]=bot y[_three]=
   if serifs: max(2/3[x_height+acc_height,x_height],x_height+o+hair)-.5crisp
      else:   vround 2/3[x_height+acc_height,x_height] fi;
if y[_two]r<(y[_one]+.5currentbreadth+eps):
   y[_two]r:=y[_one]+.5currentbreadth+eps; fi
pos[_two](stem2,90);
filldraw stroke z[_one]e{(x[_one]r-x[_three]r),if not serifs: 7 fi acc_height}...
         z[_two]e{right}...
         {(x[_one]r-x[_three]r),-if not serifs: 7 fi acc_height}z[_three]e;  % stroke
%
penlabels(1,2,3); endchar;

lhchar "Cyrillic accent pneuac - pneumata acute";
cyrchar(pneuac,9u#,min(asc_height#,2x_height#),0);
italcorr asc_height#*slant+.5dot_size#-2u#;
adjust_fit(0,0);
old_u:=u; u:=.75u;
x_move:=.5u if not serifs:+.35u fi;
% classic acute
if serifs: pickup crisp.nib; x1+.5fudged.stem=hround(w-2u)+x_move;
 x2=2/3[x1,w+x_move-x1+(w+x_move-9u)];
 y1+.5fudged.stem=h+eps;
 y2=max(2/3[x_height+acc_height,x_height],x_height+o+hair);
 numeric theta; theta=angle(z2-z1)+90;
 pos1(fudged.stem,theta); pos2(min(fudged.stem,hair),theta);
 filldraw circ_stroke z1e--z2e;  % diagonal
else: pickup fine.nib; pos1(fudged.stem,0); pos2(vair,0);
 rt x1r=hround(w-1.5u)+x_move;
 lft x2l=hround(.5[w+x_move-9u,w+x_move]-.25u-.5vair);
 top y1=h; bot y2=vround 2/3[x_height+acc_height,x_height];
 filldraw stroke z1e--z2e; fi  % diagonal
u:=old_u;
%!!! zvat
x_center:=.5w-1.5u; y_move:=0; _one:=3; _two:=4; _three:=5;
%
numeric stem[];
stem1=if serifs: vair else: max(currentbreadth+eps,.6[thin_join,vair]) fi;
stem2=if serifs:vround  (1/3[vair,stem]) else: vair fi;
pos[_one](stem1,180); pos[_three](stem1,0);
top y[_two]r=h+o; x[_two]=x_center;
rt x[_one]l   =hround(x[_two]-1.35u if monospace: /expansion_factor fi +0.5stem1);
lft x[_three]l=hround(x[_two]+1.35u if monospace: /expansion_factor fi -0.5stem1);
bot y[_one]=bot y[_three]=
   if serifs: max(2/3[x_height+acc_height,x_height],x_height+o+hair)-.5crisp
      else:   vround 2/3[x_height+acc_height,x_height] fi;
if y[_two]r<(y[_one]+.5currentbreadth+eps):
   y[_two]r:=y[_one]+.5currentbreadth+eps; fi
pos[_two](stem2,90);
filldraw stroke z[_one]e{(x[_one]r-x[_three]r),if not serifs: 7 fi acc_height}...
         z[_two]e{right}...
         {(x[_one]r-x[_three]r),-if not serifs: 7 fi acc_height}z[_three]e;  % stroke
%
penlabels(1,2,3,4,5); endchar;

lhchar "Cyrillic accent pneugr - pneumata grave";
cyrchar(pneugr,9u#,min(asc_height#,2x_height#),0);
italcorr asc_height#*slant+.5dot_size#-2u#;
adjust_fit(0,0);
old_u:=u; u:=.75u;
x_move:=if monospace:2u else: 2.5u fi;
% classic gravis
if serifs: pickup crisp.nib;
 x1-.5fudged.stem=hround 2u+(w-9u)+x_move;
 x2=2/3[x1,w+x_move-x1+(w+x_move-9u)];
 y1+.5fudged.stem=h+eps;
 y2=max(2/3[x_height+acc_height,x_height],x_height+o+hair);
 numeric theta; theta=angle(z2-z1)+90;
 pos1(fudged.stem,theta); pos2(min(fudged.stem,hair),theta);
 filldraw circ_stroke z1e--z2e;  % diagonal
else: pickup fine.nib; pos1(fudged.stem,0); pos2(vair,0);
 lft x1l=hround 1.5u+(w-9u)+x_move;
 rt x2r=hround(.5[w+x_move-9u,w+x_move]+.25u+.5vair);
 top y1=h; bot y2=vround 2/3[x_height+acc_height,x_height];
 filldraw stroke z1e--z2e; fi  % diagonal
u:=old_u;
%!!! zvat
x_center:=.5w-1.5u; y_move:=0; _one:=3; _two:=4; _three:=5;
%
numeric stem[];
stem1=if serifs: vair else: max(currentbreadth+eps,.6[thin_join,vair]) fi;
stem2=if serifs:vround  (1/3[vair,stem]) else: vair fi;
pos[_one](stem1,180); pos[_three](stem1,0);
top y[_two]r=h+o; x[_two]=x_center;
rt x[_one]l   =hround(x[_two]-1.35u if monospace: /expansion_factor fi +0.5stem1);
lft x[_three]l=hround(x[_two]+1.35u if monospace: /expansion_factor fi -0.5stem1);
bot y[_one]=bot y[_three]=
   if serifs: max(2/3[x_height+acc_height,x_height],x_height+o+hair)-.5crisp
      else:   vround 2/3[x_height+acc_height,x_height] fi;
if y[_two]r<(y[_one]+.5currentbreadth+eps):
   y[_two]r:=y[_one]+.5currentbreadth+eps; fi
pos[_two](stem2,90);
filldraw stroke z[_one]e{(x[_one]r-x[_three]r),if not serifs: 7 fi acc_height}...
         z[_two]e{right}...
         {(x[_one]r-x[_three]r),-if not serifs: 7 fi acc_height}z[_three]e;  % stroke
%
penlabels(1,2,3,4,5); endchar;

lhchar "Cyrillic accent accte - accent te";
cyrchar(accte,8u#,x_height#+acc_height#,0);
italcorr h#*slant+.5vair#-1.5u#;
adjust_fit(0,0); h:=x_height;
% low_te(0);
_zero:=0; x0=.5w;
_one:=1; _two:=2; _three:=3; _four:=4; _five:=5;
%
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=min(stem1,if serifs: hair else: max(currentbreadth+eps,7/8[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;
%%%
endchar;

%
% Number symbols
%
lhchar"Cyrillic Tma number symbol";
cyrchar(tma,20u#,body_height#,max(paren_depth#,desc_depth#));
autorounded;
adjust_fit(if monospace:-3u#,-3u# else: 0,0 fi); pickup rule.nib;
if .5w <> good.x .5w: change_width; fi
lft x6=hround u; x2=w-x6; top y8=h+o; bot y4=-d-o;
circle_points; draw_circle;  % circle
penlabels(1,2,3,4,5,6,7,8); endchar;

lhchar"Cyrillic Legion number symbol";
cyrchar(legion,20u#,body_height#,max(paren_depth#,desc_depth#));
autorounded;
adjust_fit(if monospace:-3u#,-3u# else: 0,0 fi); pickup rule.nib;
if .5w <> good.x .5w: change_width; fi
lft x6=hround u; x2=w-x6; top y8=h+o; bot y4=-d-o;
circle_points; %draw_circle;  % circle
pickup pencircle scaled .5rule_thickness;
def temp (suffix $) = numeric t; t:=rule_thickness+eps;
 filldraw (x$-t,y$)...(x$,y$-t)...(x$+t,y$)...(x$,y$+t)...cycle; % roundish dot
enddef;
temp(1); temp(2); temp(3); temp(4); temp(5); temp(6); temp(7); temp(8);
penlabels(1,2,3,4,5,6,7,8); endchar;

lhchar"Cyrillic Leodr number symbol";
cyrchar(leodr,20u#,body_height#,max(paren_depth#,desc_depth#));
autorounded;
adjust_fit(if monospace:-3u#,-3u# else: 0,0 fi); pickup rule.nib;
if .5w <> good.x .5w: change_width; fi
lft x6=hround u; x2=w-x6; top y8=h+o; bot y4=-d-o;
circle_points; %draw_circle;  % circle
numeric theta; pickup pencircle scaled .5rule_thickness;
def temp (suffix $,$$) = numeric t; t:=rule_thickness;
 filldraw (x$-t,y$)...(x$,y$-t)...(x$+t,y$)...(x$,y$+t)...cycle; % roundish dot
 z$'=z$+t*(unitvector((x$,y$)-(x$$,y$$))rotated 90);
 z$''=z$+2.5t*unitvector((x$,y$)-(x$$,y$$));
 theta:=angle((x$,y$)-(x$$,y$$))-60;
 draw stroke z$'{(x$,y$)-(x$$,y$$)}...z$''; % comma tail
enddef;
temp(1,6); temp(2,7); temp(3,8); temp(4,1);
temp(5,2); temp(6,3); temp(7,4); temp(8,5);
penlabels(1,2,3,4,5,6,7,8); endchar;

lhchar"Cyrillic Vran number symbol";
cyrchar(vran,20u#,body_height#,max(paren_depth#,desc_depth#));
autorounded;
adjust_fit(if monospace:-3u#,-3u# else: 0,0 fi); pickup rule.nib;
if .5w <> good.x .5w: change_width; fi
lft x6=hround u; x2=w-x6; top y8=h+o; bot y4=-d-o;
circle_points; %draw_circle;  % circle
pickup pencircle scaled .5rule_thickness;
def temp (suffix $) = numeric t; t:=rule_thickness+1+eps;
 draw (x$,y$-t)...(x$,y$+t); draw (x$-t,y$)...(x$+t,y$); % plus sign
enddef;
temp(1); temp(2); temp(3); temp(4); temp(5); temp(6); temp(7); temp(8);
penlabels(1,2,3,4,5,6,7,8); endchar;

lhchar "Cyrillic koloda number symbol";
cyrchar(koloda,18u#,body_height#,max(paren_depth#,desc_depth#));%
italcorr h#*slant+.5vair#-1.5u#;
adjust_fit(if monospace:-3u#,-3u# else: 0,0 fi);
%!!! lowercase_breve flipped
x_center:=.5w; y_move:=0; _one:=1; _two:=2; _three:=3;
%
pickup pencircle scaled .5rule_thickness;
pos[_one](vair,180); pos[_three](vair,0);
top y[_two]r=h+oo; %!!!
x[_two]=x_center;
lft x[_one]r=hround (1.5u); rt x[_three]r=hround(w-1.5u);
numeric mid_thickness; mid_thickness=max(currentbreadth+eps,vround 1/3[vair,stem]);%!!!
bot y[_one]=bot y[_three]= %!!!
   vround max(x_height+o+tiny,1/3[x_height,h]+o-.5mid_thickness)-.5acc_height;
if y[_two]r<(y[_one]+.5crisp+eps): %!!!
   y[_two]r:=y[_one]+.5crisp+eps; fi %!!!
pos[_two](mid_thickness,90); %!!! moved here after if
filldraw stroke (z[_one]e+(u,0))--z[_one]e{up}...z[_two]e{right}
  ...{down}z[_three]e--(z[_three]e+(-u,0));  % stroke
%flip
forsuffixes $ = [_one]l,[_one],[_one]r,[_two]l,[_two],[_two]r,
   [_three]l,[_three],[_three]r :
   y$:=h-d-y$; endfor;
filldraw stroke (z[_three]e+(-u,0))--z[_three]e{down}...z[_two]e{left}
  ...{up}z[_one]e--(z[_one]e+(u,0));  % stroke
penlabels(1,2,3); endchar;

lhchar"Cyrillic Tma Tem number symbol";
cyrchar(tmatem,20u#,body_height#,max(paren_depth#,desc_depth#));
autorounded;
adjust_fit(if monospace:-3u#,-3u# else: 0,0 fi); pickup rule.nib;
if .5w <> good.x .5w: change_width; fi
lft x6=hround u; x2=w-x6; top y8=h+o; bot y4=-d-o;
circle_points; %draw_circle;  % circle
pickup pencircle scaled .5rule_thickness;
def temp (suffix $) = numeric t; t:=rule_thickness+1+eps;
 draw (x$-t,y$)...(x$+t,y$); % minus sign
enddef;
temp(1); temp(2); temp(3); temp(4); temp(5); temp(6); temp(7); %temp(8);
draw (x8-t,y8)...(x8+t,y8);  draw (x8,y8-t)...(x8,y8+t);% plus sign
penlabels(1,2,3,4,5,6,7,8); endchar;

endinput;
%end of file
