home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / unixtex-6.1b-bin2.lha / lib / texmf / fonts / ams / cyrillic / src / cyrilu.mf < prev    next >
Text File  |  1996-10-12  |  29KB  |  628 lines

  1. %% @metafontfile{
  2. %%     filename="cyrilu.mf",
  3. %%     version="2.1",
  4. %%     date="30-MAY-1991",
  5. %%     filetype="Metafont: driver",
  6. %%     copyright="Copyright (C) Humanities and Arts Computing Center,
  7. %%            University of Washington;
  8. %%            all rights reserved.  Copying of this file is
  9. %%            authorized only if either:
  10. %%            (1) you make absolutely no changes to your copy
  11. %%                including name; OR
  12. %%            (2) if you do make changes, you first rename it to some
  13. %%                other name.",
  14. %%     author="American Mathematical Society",
  15. %%     address="American Mathematical Society,
  16. %%            Technical Support Department,
  17. %%            P. O. Box 6248,
  18. %%            Providence, RI 02940,
  19. %%            USA",
  20. %%     telephone="401-455-4080 or (in the USA) 800-321-4AMS",
  21. %%     email="Internet: Tech-Support@Math.AMS.org",
  22. %%     codetable="ISO/ASCII",
  23. %%     checksumtype="line count",
  24. %%     checksum="628",
  25. %%     keywords="amsfonts, tex, metafont , cyrillic ",
  26. %%     abstract="This is the driver file for use with 
  27. %%            the cyrillic fonts in AMSFonts 2.1."
  28. %%     }
  29. %
  30. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  31. %  This file contains definitions of letters that have the same shapes in
  32. %  both upper and lower case.
  33.  
  34. cmchar "The Russian letter TSE";
  35. beginchar("C",13u#+width_adj#,cap_height#,0);
  36. italcorr cap_height#*slant-cap_serif_fit#+cap_jut#-2.5u#+min(.5cap_stem#,u#);
  37. adjust_fit(cap_serif_fit#,cap_serif_fit#);
  38. pickup tiny.nib; pos1(cap_stem,0); pos2(cap_stem,0);
  39. pos3(cap_stem,0); pos4(cap_stem,0);
  40. lft x1l=lft x2l=hround max(2u,3u-.5cap_stem); x3=x4=w-x1;
  41. top y1=top y3=h; bot y2=bot y4=0;
  42. filldraw stroke z1e--z2e; % left stem
  43. filldraw stroke z3e--z4e; % right stem
  44. if serifs: numeric inner_jut;
  45.   if rt x1r+cap_jut+.5u+1<=lft x3l-cap_jut: inner_jut=cap_jut;
  46.   else: rt x1r+inner_jut+.5u+1=lft x3l-inner_jut; fi
  47.   dish_serif(1,2,a,1/3,cap_jut,b,1/3,inner_jut);  % upper left serif
  48.   dish_serif(3,4,e,1/3,inner_jut,f,1/3,cap_jut);  % upper left serif
  49.   inner_jut:=.5(x3l-x1r);
  50.   nodish_serif(2,1,c,1/3,cap_jut,d,1/3,inner_jut); % lower left serif
  51.   r_cyr_serif(4,3,g,1/3,inner_jut,h,1/3,cap_jut);   % lower left serif
  52. else: 
  53.   lcyrsanserif(4); lft x2'= lft x2l; bot y2'l=0; pos2'(slab,90);
  54.   rt x4'=rt x4r; y4'=y2'; pos4'(slab,90); filldraw stroke z2'e--z4'e;
  55. fi
  56. math_fit(0,.5ic#); penlabels(1,2,3,4,5,6); endchar;
  57.  
  58. cmchar "The Russian letter DE";
  59. beginchar("D",13u#,cap_height#,0);
  60. adjust_fit(.25u#,.75u#);
  61. pickup tiny.nib; pos1(cap_stem,0); pos2(cap_stem,0);
  62. lft x1l=lft x2l=hround(w-3u); top y1=h; bot y2=0;
  63. x3=u+.75cap_jut; bot y3l=0; pos3(cap_hair,90); lft x3'l=x3l; bot y3'=0; 
  64. if serifs: pos3'(1.5cap_hair,0); else: pos3'(cap_hair,0); fi
  65. x5=.42[x3,x1]; top y5=h; 
  66. if serifs: pos5(1.5cap_hair,0); else: pos5(cap_hair,0);  fi
  67. filldraw stroke z1e--z2e;
  68. filldraw stroke z3'e{z1-z3}...{up}z5e;
  69. bot y4l=0; x4=x2r; pos4(cap_hair,90);
  70. %filldraw stroke z3e--z4e;
  71. pickup crisp.nib; 
  72. top y6=h;  x6-.75cap_jut=rt x1r; pos6(slab,90);
  73. x9=x5; y9r=0; pos9(cap_hair,90);
  74. if serifs:
  75.   numeric inner_jut;
  76.   inner_jut=.5(x1-x5);
  77.   nodish_serif(5,9,aa,1/3,cap_jut,b,1/3,inner_jut);  % upper left serif
  78.   nodish_serif(1,2,ae,1/3,inner_jut,f,1/3,cap_jut);  % upper right serif
  79.   inner_jut:=.5(x2-x3);
  80.   l_cyr_serif(3',1,ac,1/3,cap_jut,d,1/3,inner_jut); % lower left serif
  81.   r_cyr_serif(2,1,ag,1/3,inner_jut,h,1/3,cap_jut);   % lower right serif
  82. else:
  83.   cyrsanserif(3'); lcyrsanserif(2);
  84.   x5'=lft x5l; top y5'=h; pos5'(slab,90);
  85.   filldraw stroke z3e--z4e; filldraw stroke z5'e--z6e;
  86. fi
  87. endchar;
  88.  
  89. cmchar "The Russian letter GHE (looks like Gamma)";
  90. beginchar("G",11.5u#-width_adj#,cap_height#,0);
  91. italcorr cap_height#*slant-beak_jut#-.25u#;
  92. adjust_fit(cap_serif_fit#,0);
  93. h:=vround(h-stem_corr);
  94. pickup tiny.nib; pos1(cap_stem,0); pos2(cap_stem,0);
  95. lft x1l=lft x2l=hround max(2u,3u-.5cap_stem); top y1=h; bot y2=0;
  96. filldraw stroke z1e--z2e; % stem
  97. pickup crisp.nib; pos3(slab,90); pos4(hair,0);
  98. top y3r=h; x3=x1; rt x4r=hround(w-.75u); y4=good.y(y3l-beak)-eps;
  99. arm(3,4,e,beak_darkness,beak_jut);  % upper arm and beak
  100. pos5(cap_bar,-90); pos6(hair,0);
  101. top y5l=vround(.5[y2,y1]+.5cap_bar); x5=x1;
  102. pos0(cap_bar,90); pos7(hair,0);
  103. z0=z5; x6=x7; y6-y5l=y0l-y7;
  104. if serifs: rt x6r=hround(w-4u+.5hair); y6=good.y(y5l+.6beak)+eps;
  105.   rt x9r=hround(w-.5u);
  106. else: rt x6r=hround(w-1.5u); y6=y5l+eps; rt x9r=hround(w-.75u);
  107. fi
  108. %arm(5,6,f,beak_darkness,0); arm(0,7,g,beak_darkness,0);  % middle arm and serif
  109. if serifs: nodish_serif(1,2,a,1/3,cap_jut,b,1/3,.5cap_jut);  % upper serif
  110.   dish_serif(2,1,c,1/3,cap_jut,d,1/3,1.25cap_jut);  % lower serif
  111. fi
  112. math_fit(0,ic#-2.5u#); penlabels(0,1,2,3,4,5,6,7,8,9); endchar;
  113.  
  114. cmchar "The Russian letter KHA (looks like X)";
  115. beginchar("H",13u#,cap_height#,0);
  116. italcorr cap_height#*slant-.25u#;
  117. adjust_fit(cap_serif_fit#,cap_serif_fit#);
  118. numeric stem[],outer_jut,xjut,alpha[];
  119. stem1=cap_stem-2stem_corr; stem2=min(cap_hair,stem1);
  120. outer_jut=.75cap_jut; xjut= if serifs: (stem1-stem2)/4 else: 0 fi;
  121. x1l=l+letter_fit+.5u+outer_jut; x2r=r-letter_fit-u-outer_jut-xjut;
  122. x3l=l+letter_fit+.25u+outer_jut+xjut; x4r=r-letter_fit-.25u-outer_jut;
  123. y1=y2=h; y3=y4=0;
  124. alpha1=diag_ratio(1,stem1,h,x4r-x1l);
  125. alpha2=diag_ratio(1,stem2,h,x2r-x3l);
  126. penpos1(alpha1*stem1,0); penpos2(alpha2*stem2,0);
  127. penpos3(alpha2*stem2,0); penpos4(alpha1*stem1,0);
  128. if hefty: z0=whatever[z1,z4]=whatever[z2,z3];
  129.   x12=x34=x0; y13=y24=y0;
  130.   z12=whatever[z2l,z3l]; z13=whatever[z2l,z3l];
  131.   z24=whatever[z2r,z3r]; z34=whatever[z2r,z3r];
  132.   forsuffixes $=13,24,34: z$'=.1[z$,z0]; endfor
  133.   fill diag_end(12,1r,.5,1,1l,13')--z13'--diag_end(13',3l,1,.5,3r,34')--z34'
  134.    --diag_end(34',4l,.5,1,4r,24')--z24'
  135.    --diag_end(24',2r,1,.5,2l,12)--z12--cycle; % diagonals
  136. else: fill diag_end(4r,1r,.5,1,1l,4l)
  137.    --diag_end(1l,4l,.5,1,4r,1r)--cycle; % left diagonal
  138.   fill diag_end(2l,3l,.5,1,3r,2r)
  139.    --diag_end(3r,2r,.5,1,2l,3l)--cycle;  % right diagonal
  140. fi
  141. if serifs: numeric inner_jut[]; pickup tiny.nib;
  142.   prime_points_inside(1,4); prime_points_inside(2,3);
  143.   prime_points_inside(3,2); prime_points_inside(4,1);
  144.   if rt x1'r+cap_jut+.5u+1<=lft x2'l-cap_jut-xjut: inner_jut1=cap_jut;
  145.   else: rt x1'r+inner_jut1+.5u+1=lft x2'l-inner_jut1-xjut; fi
  146.   if rt x3'r+cap_jut+.5u+1<=lft x4'l-cap_jut-xjut: inner_jut2=cap_jut;
  147.   else: rt x3'r+inner_jut2+.5u+1=lft x4'l-inner_jut2-xjut; fi
  148.   dish_serif(1',4,a,1/3,outer_jut,b,2/3,inner_jut1);  % upper left serif
  149.   dish_serif(4',1,c,2/3,inner_jut2,d,1/3,outer_jut);  % lower right serif
  150.   dish_serif(2',3,e,2/3,inner_jut1+xjut,
  151.    f,1/2,outer_jut+xjut)(dark);  % upper right serif
  152.   dish_serif(3',2,g,1/2,outer_jut+xjut,
  153.    h,2/3,inner_jut2+xjut)(dark);  % lower left serif
  154. fi
  155. math_fit(0,.5ic#); penlabels(0,1,2,3,4,12,13,24,34); endchar;
  156.  
  157. cmchar "The Russian letter I (looks like backwards N)";
  158. beginchar("I",14u#+width_adj#,cap_height#,0);
  159. italcorr cap_height#*slant-cap_serif_fit#+cap_jut#-2.5u#+min(.5cap_stem#,u#);
  160. adjust_fit(cap_serif_fit#,cap_serif_fit#);
  161. pickup tiny.nib; pos1(cap_stem,0); pos2(cap_stem,0);
  162. pos3(cap_stem,0); pos4(cap_stem,0);
  163. lft x1l=lft x2l=hround max(2u,3u-.5cap_stem); x3=x4=w-x1;
  164. top y1=top y3=h; bot y2=bot y4=0;
  165. filldraw stroke z1e--z2e; % left stem
  166. filldraw stroke z3e--z4e; % right stem
  167. if serifs: penpos5(.85cap_stem,90); penpos6(.85cap_stem,90);
  168. else: penpos5(cap_stem,90); penpos6(cap_stem,90);
  169. fi
  170. x5=x1r; x6=x3l; if serifs: y5=.1h; y6=.9h; else: bot y5l=0; top y6r=h; fi
  171. fill stroke z5e--z6e;  % bar
  172. if serifs: numeric inner_jut;
  173.   if rt x1r+cap_jut+.5u+1<=lft x3l-cap_jut: inner_jut=cap_jut;
  174.   else: rt x1r+inner_jut+.5u+1=lft x3l-inner_jut; fi
  175.   dish_serif(1,2,a,1/3,cap_jut,b,1/3,inner_jut);  % upper left serif
  176.   dish_serif(2,1,c,1/3,cap_jut,d,1/3,inner_jut); % lower left serif
  177.   dish_serif(3,4,e,1/3,inner_jut,f,1/3,cap_jut);  % upper left serif
  178.   dish_serif(4,3,g,1/3,inner_jut,h,1/3,cap_jut);  % lower left serif
  179. fi
  180. math_fit(0,.5ic#); penlabels(1,2,3,4,5,6); endchar;
  181.  
  182. %  The letter "K" is the last character defined in this file.
  183. %  See below for comments.
  184.  
  185. cmchar "The Russian letter EL";
  186. beginchar("L",13u#,cap_height#,0);
  187. adjust_fit(0,1.5u#);
  188. numeric ldot_size; ldot_size=1.15flare;
  189. pickup tiny.nib; pos1(cap_stem,0); pos2(cap_stem,0);
  190. lft x1l=lft x2l=hround(w-3u); top y1=h; bot y2=0;
  191. filldraw stroke z1e--z2e;
  192. if serifs:
  193.   numeric inner_jut; inner_jut=.5(x1-x5);
  194.   x4=u+.5ldot_size; x3=x4+.5ldot_size; bot y3r=0; pos3(1.5cap_hair,-90); 
  195.   x5=.42[x4,x1]; top y5=h; pos5(1.5cap_hair,0); pos4(ldot_size,-180);
  196.   pos10(hair,-180);
  197.   filldraw stroke z3e{right}...{up}z5e;
  198.   y4=ldot_size; bulb(3,10,4);
  199.   dish_serif(2,1,a,1/3,cap_jut,b,1/3,cap_jut);
  200.   nodish_serif(1,2,c,1/3,inner_jut,d,1/3,cap_jut);
  201.   top y6=h;  x6-.75cap_jut=rt x1r; pos6(slab,90);
  202.   x5'+.5cap_jut=lft x5l; top y5'=h; pos5'(slab,90);
  203.   x9=x5; y9=0; pos9(cap_hair,0);
  204.   nodish_serif(5,9,aa,1/3,cap_jut,ab,1/3,inner_jut);  % upper left serif
  205. else:
  206.   x5r=hround u; bot y5r=vround(.06h-o); bot y4r=-o; x4r=.35[x5,x3r];
  207.   x3=x5+3flare; top y3=h; lft x3'=lft x3l; top y3'r=h; rt x1'r=rt x1r;
  208.   top y1'r=h; pos3'(slab,90); pos1'(slab,90); pos5(flare,-120); pos4(vair,-90);
  209.   pos3(hair,0);
  210.   filldraw stroke z5e...{right}z4e...{up}z3e;
  211.   filldraw stroke z3'e--z1'e;
  212. fi
  213. endchar;
  214.  
  215. cmchar "The Russian letter EM";
  216. beginchar("M",16u#+width_adj#,cap_height#,0);
  217. italcorr cap_height#*slant-cap_serif_fit#+cap_jut#-2.5u#+min(.5cap_stem#,u#);
  218. adjust_fit(cap_serif_fit#,cap_serif_fit#);
  219. numeric stem[]; % thicknesses of the four strokes
  220. stem1=hround(fudged.hair+stem_corr);
  221. stem2=hround(fudged.cap_stem-4stem_corr);
  222. stem3=hround(fudged.hair-stem_corr);
  223. stem4=hround(fudged.cap_stem-3stem_corr);
  224. if stem4<stem1: stem4:=stem1; fi
  225. pickup tiny.nib; pos1(stem1,0); pos2(stem1,0);
  226. pos3(stem4,0); pos4(stem4,0);
  227. x1=x2; x3=x4; x1l=w-x3r; rt x3r=hround min(w-2u,w-3u+.5stem4);
  228. top y1=top y3=h; bot y2=bot y4=0;
  229. filldraw stroke z1e--z2e; % left stem
  230. filldraw stroke z3e--z4e; % right stem
  231. penpos5(stem2,0); penpos6(stem2,0); penpos7(stem3,0); penpos8(stem3,0);
  232. x5l=x1; x6l=x7l; x8=lft x3l; x6-x5=x8-x7; y5=y8=h; y6=y7;
  233. if hefty: y6=if monospace: vround 1/3h else: o fi;
  234.  numeric upper_notch,lower_notch;
  235.  upper_notch=h-cap_notch_cut; lower_notch=y6+cap_notch_cut;
  236.  x1'=rt x1r; z1'=whatever[z5l,z6l]; x3'=lft x3l; z3'=whatever[z7r,z8r];
  237.  z0=whatever[z5r,z6r]=whatever[z7l,z8l];
  238.  fill z5l..
  239.   if y1'<upper_notch: {right}(x1'+1,upper_notch){down}... fi
  240.   {z6-z5}diag_in(5l,6l,1,6r)..diag_out(7l,1,7r,8r){z8-z7}
  241.   if y3'<upper_notch: ...{up}(x3'-1,upper_notch){right} fi
  242.   ..z8r--diag_out(8r,1,8l,7l){z7-z8}
  243.   if y0<=lower_notch: ..{z7-z8}z0{z5-z6}..
  244.   else: ...{down}(x0+.5,lower_notch)--(x0-.5,lower_notch){up}... fi
  245.   {z5-z6}diag_in(6r,5r,1,5l)--cycle;  % diagonals
  246. else: y6=0; z0=whatever[z5r,z6r]=whatever[z7l,z8l];
  247.  fill z5l..{z6-z5}diag_in(5l,6l,1,6r)..diag_out(7l,1,7r,8r){z8-z7}
  248.   ..z8r--diag_out(8r,1,8l,7l){z7-z8}..{z7-z8}z0{z5-z6}
  249.   ..{z5-z6}diag_in(6r,5r,1,5l)--cycle; fi  % diagonals
  250. if serifs: serif(1,2,a,1/3,-cap_jut);  % upper left serif
  251.  dish_serif(2,1,b,1/2,cap_jut,c,1/2,cap_jut)(dark); % lower left serif
  252.  serif(3,4,d,1/3,cap_jut); %  upper right serif
  253.  dish_serif(4,3,e,1/3,cap_jut,f,1/3,cap_jut); fi  % lower right serif
  254. math_fit(0,max(.5ic#-.5u#,0));
  255. penlabels(0,1,1',2,3,3',4,5,6,7,8); endchar;
  256.  
  257. cmchar "The Russian letter EN (looks like H)";
  258. beginchar("N",13u#+width_adj#,cap_height#,0);
  259. italcorr cap_height#*slant-cap_serif_fit#+cap_jut#-2.5u#+min(.5cap_stem#,u#);
  260. adjust_fit(cap_serif_fit#,cap_serif_fit#);
  261. pickup tiny.nib; pos1(cap_stem,0); pos2(cap_stem,0);
  262. pos3(cap_stem,0); pos4(cap_stem,0);
  263. lft x1l=lft x2l=hround max(2u,3u-.5cap_stem); x3=x4=w-x1;
  264. top y1=top y3=h; bot y2=bot y4=0;
  265. filldraw stroke z1e--z2e; % left stem
  266. filldraw stroke z3e--z4e; % right stem
  267. penpos5(cap_bar,90); penpos6(cap_bar,90);
  268. x5=x1; x6=x3; y5=y6=.52h;
  269. fill stroke z5e--z6e;  % bar
  270. if serifs: numeric inner_jut;
  271.  if rt x1r+cap_jut+.5u+1<=lft x3l-cap_jut: inner_jut=cap_jut;
  272.  else: rt x1r+inner_jut+.5u+1=lft x3l-inner_jut; fi
  273.  dish_serif(1,2,a,1/3,cap_jut,b,1/3,inner_jut);  % upper left serif
  274.  dish_serif(2,1,c,1/3,cap_jut,d,1/3,inner_jut); % lower left serif
  275.  dish_serif(3,4,e,1/3,inner_jut,f,1/3,cap_jut);  % upper left serif
  276.  dish_serif(4,3,g,1/3,inner_jut,h,1/3,cap_jut); fi  % lower left serif
  277. math_fit(0,.5ic#); penlabels(1,2,3,4,5,6); endchar;
  278.  
  279. cmchar "The Russian letter PE (looks like PI)";
  280. beginchar("P",13u#+width_adj#,cap_height#,0);
  281. italcorr cap_height#*slant-cap_serif_fit#+cap_jut#-2.5u#+min(.5cap_stem#,u#);
  282. adjust_fit(cap_serif_fit#,cap_serif_fit#);
  283. pickup tiny.nib; pos1(cap_stem,0); pos2(cap_stem,0);
  284. pos3(cap_stem,0); pos4(cap_stem,0);
  285. lft x1l=lft x2l=hround max(2u,3u-.5cap_stem); x3=x4=w-x1;
  286. top y1=top y3=h; bot y2=bot y4=0;
  287. filldraw stroke z1e--z2e; % left stem
  288. filldraw stroke z3e--z4e; % right stem
  289. if serifs: numeric inner_jut;
  290.  if rt x1r+cap_jut+.5u+1<=lft x3l-cap_jut: inner_jut=cap_jut;
  291.  else: rt x1r+inner_jut+.5u+1=lft x3l-inner_jut; fi
  292.  dish_serif(2,1,c,1/3,cap_jut,d,1/3,inner_jut); % lower left serif
  293.  dish_serif(4,3,g,1/3,inner_jut,h,1/3,cap_jut);   % lower left serif
  294.  inner_jut:=.5(x3l-x1r);
  295.  nodish_serif(1,2,a,1/3,cap_jut,b,1/3,inner_jut);  % upper left serif
  296.  nodish_serif(3,4,e,1/3,inner_jut,f,1/3,cap_jut);  % upper left serif
  297. else:
  298.  lft x1'= lft x1l; top y1'r=h; pos1'(slab,90);
  299.  rt x3'=rt x3r; y3'=y1'; pos3'(slab,90); filldraw stroke z1'e--z3'e;
  300. fi
  301. math_fit(0,.5ic#); penlabels(1,2,3,4,5,6); endchar;
  302.  
  303. cmchar "The Russian letter CHE";
  304. beginchar("Q",14u#+width_adj#,cap_height#,0);
  305. italcorr cap_height#*slant-cap_serif_fit#+cap_jut#-2.5u#+min(.5cap_stem#,u#);
  306. adjust_fit(cap_serif_fit#,cap_serif_fit#);
  307. pickup tiny.nib; pos1(cap_stem,0); pos2(cap_stem,0);
  308. pos3(cap_stem,0); pos4(cap_stem,0);
  309. lft x1l=lft x2l=hround max(2u,3u-.5cap_stem); x3=x4=w-x1;
  310. top y1=top y3=h; %bot y2=x_height; 
  311. bot y4=0;
  312. x22=x3; y22=.65h; %x_height-.25bar_height; 
  313. pos22(cap_bar,90); y2=y22;
  314. filldraw stroke z1e--z2e{down}...{1,2}z22e; % left stem and bowl
  315. filldraw stroke z3e--z4e; % right stem
  316. if serifs: numeric inner_jut;
  317.  if rt x1r+cap_jut+.5u+1<=lft x3l-cap_jut: inner_jut=cap_jut;
  318.  else: rt x1r+inner_jut+.5u+1=lft x3l-inner_jut; fi
  319.  dish_serif(1,2,a,1/3,cap_jut,b,1/3,inner_jut);  % upper left serif
  320. % dish_serif(2,1,c,1/3,cap_jut,d,1/3,inner_jut); % lower left serif
  321.  dish_serif(3,4,e,1/3,inner_jut,f,1/3,cap_jut);  % upper left serif
  322.  dish_serif(4,3,g,1/3,inner_jut,h,1/3,cap_jut); fi  % lower left serif
  323. math_fit(0,.5ic#); penlabels(1,2,3,4,5,6); endchar;
  324.  
  325. cmchar "The Russian letter TE";
  326. beginchar("T",13u#-width_adj#,cap_height#,0);
  327. italcorr cap_height#*slant-beak_jut#-.25u#;
  328. adjust_fit(0,0);
  329. h:=vround(h-2stem_corr);
  330. pickup tiny.nib; pos1(cap_stem,0); pos2(cap_stem,0);
  331. lft x1l=lft x2l=hround(.5w-.5cap_stem); top y1=h; bot y2=0;
  332. filldraw stroke z1e--z2e; % stem
  333. pickup crisp.nib; pos3(slab,90); pos4(hair,0);
  334. top y3r=h; x3=x1; rt x4r=hround(w-.65u); y4=good.y(y3l-beak)-eps;
  335. arm(3,4,e,beak_darkness,.7beak_jut);  % right arm and beak
  336. pos5(hair,180); x5=w-x4; y5=y4;
  337. arm(3,5,f,beak_darkness,-.7beak_jut);  % left arm and beak
  338. if serifs: dish_serif(2,1,c,1/3,1.414cap_jut,d,1/3,1.414cap_jut);  % lower serif
  339.  nodish_serif(1,2,a,1/3,.5cap_jut,b,1/3,.5cap_jut); fi  % upper bracketing
  340. math_fit(-.75cap_height#*slant,ic#-2.5u#); penlabels(1,2,3,4,5,6); endchar;
  341.  
  342. cmchar "The Russian letter VE (looks like B)";
  343. beginchar("V",12.5u#,cap_height#,0);
  344. italcorr .75cap_height#*slant-.5u#;
  345. adjust_fit(cap_serif_fit#,0);
  346. numeric left_stem,right_curve,middle_weight;
  347. left_stem=cap_stem-hround 2stem_corr; middle_weight=.6vair+.5;
  348. pickup tiny.nib; pos1(left_stem,0); pos2(left_stem,0);
  349. lft x1l=lft x2l=hround max(2u,3u-.5left_stem); top y1=h; bot y2=0;
  350. filldraw stroke z1e--z2e; % stem
  351. penpos3(cap_band,90); penpos4(cap_band,90);
  352. penpos6(middle_weight,-90); penpos7(middle_weight,-90);
  353. penpos8(middle_weight,90); penpos9(middle_weight,90);
  354. penpos5(right_curve-stem_corr,0); penpos10(right_curve,0);
  355. penpos11(cap_band,-90); penpos12(cap_band,-90);
  356. z3r=top z1; y4=y3; y5=.5[y4,y6]; y6=y7; y7l-y8l=vair;
  357. z12r=bot z2; y11=y12; y10=.5[y11,y9]; y8=y9; .5[y7l,y8l]=.52h;
  358. x4=x6; x9=x11=x4+.5u; x7=x8=x1; x9l:=x4+.25u;
  359. x5r=hround(w-1.5u); x10r=hround(w-u);
  360. if serifs: right_curve=cap_curve-stem_corr; x4=.5[x1,w-1.5u];
  361. else: right_curve=cap_curve-3stem_corr; x4=.5[x1,w-2.5u];
  362.  x4l:=x4l-.5u; x9l:=x9l-.5u; fi
  363. x6l:=x6l-.5u; x11l:=x11l-.5u;
  364. fill stroke z3e..super_arc.e(4,5) & super_arc.e(5,6)..z7e;  % upper lobe
  365. fill stroke z8e..super_arc.e(9,10) & super_arc.e(10,11)..z12e;  % lower lobe
  366. if serifs: nodish_serif(1,2,a,1/3,cap_jut,b,1/3,.5cap_jut);  % upper serif
  367.  nodish_serif(2,1,c,1/3,cap_jut,d,1/3,.5cap_jut); fi  % lower serif
  368. math_fit(0,.5ic#); penlabels(1,2,3,4,5,6,7,8,9,10,11,12); endchar;
  369.  
  370. cmchar "The Russian letter SHCHA";
  371. beginchar("W",19u#+width_adj#,cap_height#,0);
  372. italcorr cap_height#*slant-cap_serif_fit#+cap_jut#-2.5u#+min(.5cap_stem#,u#);
  373. adjust_fit(cap_serif_fit#,cap_serif_fit#);
  374. pickup tiny.nib; pos1(cap_stem,0); pos2(cap_stem,0);
  375. pos3(cap_stem,0); pos4(cap_stem,0); pos5(cap_stem,0); pos6(cap_stem,0);
  376. lft x1l=lft x2l=hround max(2u,3u-.5cap_stem); x3=x4=w-x1;
  377. top y1=top y3=h; bot y2=bot y4=0;
  378. z5=.5[z1,z3]; z6=.5[z2,z4];
  379. filldraw stroke z1e--z2e; % left stem
  380. filldraw stroke z3e--z4e; % right stem
  381. filldraw stroke z5e--z6e; % center stem
  382. if serifs: numeric inner_jut;
  383.  if rt x1r+cap_jut+.5u+1<=lft x5l-cap_jut: inner_jut=cap_jut;
  384.  else: rt x1r+inner_jut+.5u+1=lft x5l-inner_jut; fi
  385.  dish_serif(1,2,a,1/3,cap_jut,b,1/3,inner_jut);  % upper left serif
  386.  dish_serif(3,4,e,1/3,inner_jut,f,1/3,cap_jut);  % upper right serif
  387.  dish_serif(5,6,i,1/3,inner_jut,j,1/3,inner_jut); % upper center serif
  388.  inner_jut:=.5(x3l-x5r);
  389.  nodish_serif(2,1,c,1/3,cap_jut,d,1/3,inner_jut); % lower left serif
  390.  nodish_serif(6,5,k,1/3,inner_jut,m,1/3,inner_jut); % lower center serif
  391.  r_cyr_serif(4,3,g,1/3,inner_jut,h,1/3,cap_jut);   % lower right serif
  392. else:
  393.  lcyrsanserif(4); lft x2'= lft x2l; bot y2'l=0; pos2'(slab,90);
  394.  rt x4'=rt x4r; y4'=y2'; pos4'(slab,90); filldraw stroke z2'e--z4'e;
  395. fi
  396. math_fit(0,.5ic#); penlabels(1,2,3,4,5,6); endchar;
  397.  
  398. cmchar "The Russian letter SHA";
  399. beginchar("X",19u#+width_adj#,cap_height#,0);
  400. italcorr cap_height#*slant-cap_serif_fit#+cap_jut#-2.5u#+min(.5cap_stem#,u#);
  401. adjust_fit(cap_serif_fit#,cap_serif_fit#);
  402. pickup tiny.nib; pos1(cap_stem,0); pos2(cap_stem,0);
  403. pos3(cap_stem,0); pos4(cap_stem,0); pos5(cap_stem,0); pos6(cap_stem,0);
  404. lft x1l=lft x2l=hround max(2u,3u-.5cap_stem); x3=x4=w-x1;
  405. top y1=top y3=h; bot y2=bot y4=0;
  406. z5=.5[z1,z3]; z6=.5[z2,z4];
  407. filldraw stroke z1e--z2e; % left stem
  408. filldraw stroke z3e--z4e; % right stem
  409. filldraw stroke z5e--z6e; % center stem
  410. if serifs: numeric inner_jut;
  411.  if rt x1r+cap_jut+.5u+1<=lft x5l-cap_jut: inner_jut=cap_jut;
  412.  else: rt x1r+inner_jut+.5u+1=lft x5l-inner_jut; fi
  413.  dish_serif(1,2,a,1/3,cap_jut,b,1/3,inner_jut);  % upper left serif
  414.  dish_serif(3,4,e,1/3,inner_jut,f,1/3,cap_jut);  % upper right serif
  415.  dish_serif(5,6,i,1/3,inner_jut,j,1/3,inner_jut); % upper center serif
  416.  inner_jut:=.5(x3l-x5r);
  417.  nodish_serif(2,1,c,1/3,cap_jut,d,1/3,inner_jut); % lower left serif
  418.  nodish_serif(6,5,k,1/3,inner_jut,m,1/3,inner_jut); % lower center serif
  419.  nodish_serif(4,3,g,1/3,inner_jut,h,1/3,cap_jut);   % lower right serif
  420. else:
  421.  lft x2'= lft x2l; bot y2'l=0; pos2'(slab,90);
  422.  rt x4'=rt x4r; y4'=y2'; pos4'(slab,90); filldraw stroke z2'e--z4'e;
  423. fi
  424. math_fit(0,.5ic#); penlabels(1,2,3,4,5,6); endchar;
  425.  
  426. cmchar "The Russian letter ERY";
  427. beginchar("Y",12.5u#,cap_height#,0);
  428. italcorr .75cap_height#*slant-.5u#;
  429. adjust_fit(cap_serif_fit#,if serifs: 5u# else: 4.25u# fi);
  430. numeric left_stem,right_curve,middle_weight;
  431. left_stem=cap_stem-hround 2stem_corr; middle_weight=.6vair+.5;
  432. pickup tiny.nib; pos1(left_stem,0); pos2(left_stem,0);
  433. lft x1l=lft x2l=hround max(2u,3u-.5left_stem); top y1=h; bot y2=0;
  434. filldraw stroke z1e--z2e; % stem
  435. penpos3(cap_band,90); penpos4(cap_band,90);
  436. penpos6(middle_weight,-90); penpos7(middle_weight,-90);
  437. penpos8(middle_weight,90); penpos9(middle_weight,90);
  438. penpos5(right_curve-stem_corr,0); penpos10(right_curve,0);
  439. penpos11(cap_band,-90); penpos12(cap_band,-90);
  440. z3r=top z1; y4=y3; y5=.5[y4,y6]; y6=y7; y7l-y8l=vair;
  441. z12r=bot z2; y11=y12; y10=.5[y11,y9]; y8=y9; .5[y7l,y8l]=.52h;
  442. x4=x6; x9=x11=x4+.5u; x7=x8=x1; x9l:=x4+.25u;
  443. x5r=hround(w-1.5u); x10r=hround(w-u);
  444. if serifs: right_curve=cap_curve-stem_corr; x4=.5[x1,w-1.5u];
  445. else: right_curve=cap_curve-3stem_corr; x4=.5[x1,w-2.5u];
  446.  x4l:=x4l-.5u; x9l:=x9l-.5u; fi
  447. x6l:=x6l-.5u; x11l:=x11l-.5u;
  448. fill stroke z8e..super_arc.e(9,10) & super_arc.e(10,11)..z12e;  % lower lobe
  449. if serifs: dish_serif(1,2,a,1/3,cap_jut,b,1/3,cap_jut);  % upper serif
  450.  nodish_serif(2,1,c,1/3,cap_jut,d,1/3,.5cap_jut); fi  % lower serif
  451. pickup tiny.nib;
  452. x80=x81=w if serifs: +2u else: +1.25u fi; top y80=h; bot y81=0; pos80(cap_stem,0); pos81(cap_stem,0);
  453. filldraw stroke z80e--z81e;
  454. if serifs: 
  455.   dish_serif(80,81,e,1/3,cap_jut,f,1/3,cap_jut);
  456.   dish_serif(81,80,g,1/3,cap_jut,h,1/3,cap_jut); 
  457. fi  
  458. math_fit(0,.5ic#); penlabels(1,2,3,4,5,6,7,8,9,10,11,12); endchar;
  459.  
  460. cmchar "The Russian letter ZE (looks like numeral 3)";
  461. beginchar("Z",11u#,cap_height#,0);
  462. italcorr cap_height#*slant-.5u#;
  463. adjust_fit(0,0);
  464. numeric top_thickness,mid_thickness,bot_thickness;
  465. top_thickness=max(fine.breadth,vround(slab-2vair_corr));
  466. mid_thickness=max(fine.breadth,vround 2/3vair);
  467. bot_thickness=max(fine.breadth,vround(slab-vair_corr));
  468. pickup fine.nib; pos2(top_thickness,90); top y2r=h+o;
  469. pos3(max(fine.breadth,.6[curve,cap_curve]-stem_corr),0);
  470. rt x3r=hround(w-1.25u);
  471. pos4(vair,-90); pos5(vair,-90);
  472. pos6(mid_thickness,90); x2=x6=x8=.5[1.5u,x7];
  473. pos7(cap_curve,0); rt x7r=hround(w-.75u); lft x5=min(hround 3u,lft x6)-eps;
  474. pos8(bot_thickness,-90); bot y8r=-o;
  475. y3=.6[top y4l,bot y2l]; y7=.5[bot y6l,top y8l];
  476. top y5l=vround(.54h+.5vair); y5r=y6l;
  477. x4=1/3[x5,x3l]; z4=z5+whatever*(150u,h);
  478. lft x1r=hround 1.25u; y1=.8h;
  479. if serifs: pos1(cap_hair,180); pos9(cap_hair,-180); else: pos1(1.5cap_hair,135); pos9(1.5cap_hair,-135); fi
  480.  lft x9r=hround .75u; y9=.2h;
  481. filldraw stroke z1e{x2-x1,10(y2-y1)}...{right}z2e & pulled_super_arc.e(2,3)(.5superpull)
  482.  & z3e{down}...z4e---z5e;  % upper bowl
  483. filldraw z5r--z6l--z6r--z5l---cycle;  % middle tip
  484. filldraw stroke pulled_super_arc.e(6,7)(.5superpull)
  485.  & pulled_super_arc.e(7,8)(.5superpull)
  486.  & z8e{left}....{up}z9e;  % lower bowl %this line added for changing bulb to barb
  487. if serifs: numeric bulb_diam[];
  488.  %bulb_diam1=flare+.5(cap_stem-stem); bulb_diam2=flare+cap_stem-stem;
  489.  %pos0(bulb_diam1,180); pos1(hair,180);
  490.  %lft x0r=hround 1.25u; y0=min(.9h-.5bulb_diam1,.75h+.5bulb_diam1);
  491.  % bulb(2,1,0);  % upper bulb
  492.  %pos10(bulb_diam2,-180); 
  493.  % bulb(8,9,10);  % lower bulb
  494. % barbs on end of strokes
  495.  path upper_arc; upper_arc=z1{x2-x1,10(y2-y1)}..{right}z2;
  496.  path lower_arc; lower_arc=z8{left}....{up}z9;
  497.  pos20(hair,0); x20r=x1l; top y20=top y2r; x1'-x1l=1.6cap_curve; y1'=y1;
  498.  numeric t; t=xpart(upper_arc intersectiontimes (z20r--z1'));
  499.  filldraw z1r--z20l--z20r--subpath(t,0) of upper_arc--cycle;
  500.  pos30(hair,0); x30r=x9l; bot y30=bot y8r; x9'-x9l=1.6cap_curve; y9'=y9;
  501.  t:=xpart(lower_arc intersectiontimes (z30r--z9'));
  502.  filldraw z9r--z30l--z30r--subpath(t,1) of lower_arc--cycle;
  503. %else: %pos1(.5[vair,flare],angle(-8u,h));
  504.  %lft x1r=hround u; bot y1l=vround .75h+o;
  505.  %y1r:=good.y y1r+eps; x1l:=good.x x1l;
  506.  %pos9(bot_thickness,angle(-2u,-h));
  507.  %lft x9r=hround .75u; top y9l=vround .25h-o;
  508.  %y9r:=good.y y9r-eps; x9l:=good.x x9l;
  509. % filldraw stroke term.e(2,1,left,1,4);  % upper terminal
  510. % filldraw stroke term.e(8,9,left,1,4); 
  511. fi  % lower terminal
  512. penlabels(0,1,2,3,4,5,6,7,8,9,10); endchar;
  513.  
  514. cmchar "The Russian letter Soft Sign";
  515. beginchar(oct"136",12.5u#,cap_height#,0);
  516. italcorr .75cap_height#*slant-.5u#;
  517. adjust_fit(cap_serif_fit#,0);
  518. numeric left_stem,right_curve,middle_weight;
  519. left_stem=cap_stem-hround 2stem_corr; middle_weight=.6vair+.5;
  520. pickup tiny.nib; pos1(left_stem,0); pos2(left_stem,0);
  521. lft x1l=lft x2l=hround max(2u,3u-.5left_stem); top y1=h; bot y2=0;
  522. filldraw stroke z1e--z2e; % stem
  523. penpos3(cap_band,90); penpos4(cap_band,90);
  524. penpos6(middle_weight,-90); penpos7(middle_weight,-90);
  525. penpos8(middle_weight,90); penpos9(middle_weight,90);
  526. penpos5(right_curve-stem_corr,0); penpos10(right_curve,0);
  527. penpos11(cap_band,-90); penpos12(cap_band,-90);
  528. z3r=top z1; y4=y3; y5=.5[y4,y6]; y6=y7; y7l-y8l=vair;
  529. z12r=bot z2; y11=y12; y10=.5[y11,y9]; y8=y9; .5[y7l,y8l]=.52h;
  530. x4=x6; x9=x11=x4+.5u; x7=x8=x1; x9l:=x4+.25u;
  531. x5r=hround(w-1.5u); x10r=hround(w-u);
  532. if serifs: right_curve=cap_curve-stem_corr; x4=.5[x1,w-1.5u];
  533. else: right_curve=cap_curve-3stem_corr; x4=.5[x1,w-2.5u];
  534.  x4l:=x4l-.5u; x9l:=x9l-.5u; fi
  535. x6l:=x6l-.5u; x11l:=x11l-.5u;
  536. fill stroke z8e..super_arc.e(9,10) & super_arc.e(10,11)..z12e;  % lower lobe
  537. if serifs: dish_serif(1,2,a,1/3,cap_jut,b,1/3,cap_jut);  % upper serif
  538.  nodish_serif(2,1,c,1/3,cap_jut,d,1/3,.5cap_jut); fi  % lower serif
  539. math_fit(0,.5ic#); penlabels(1,2,3,4,5,6,7,8,9,10,11,12); endchar;
  540.  
  541. cmchar "The Russian letter Hard Sign";
  542. beginchar(oct"137",12.5u#,cap_height#,0);
  543. italcorr .75cap_height#*slant-.5u#;
  544. adjust_fit(if serifs: 4 else: 2 fi u#+cap_serif_fit#,0);
  545. numeric left_stem,right_curve,middle_weight;
  546. left_stem=cap_stem-hround 2stem_corr; middle_weight=.6vair+.5;
  547. pickup tiny.nib; pos1(left_stem,0); pos2(left_stem,0);
  548. lft x1l=lft x2l=hround max(2u,3u-.5left_stem); top y1=h; bot y2=0;
  549. filldraw stroke z1e--z2e; % stem
  550. penpos3(cap_band,90); penpos4(cap_band,90);
  551. penpos6(middle_weight,-90); penpos7(middle_weight,-90);
  552. penpos8(middle_weight,90); penpos9(middle_weight,90);
  553. penpos5(right_curve-stem_corr,0); penpos10(right_curve,0);
  554. penpos11(cap_band,-90); penpos12(cap_band,-90);
  555. z3r=top z1; y4=y3; y5=.5[y4,y6]; y6=y7; y7l-y8l=vair;
  556. z12r=bot z2; y11=y12; y10=.5[y11,y9]; y8=y9; .5[y7l,y8l]=.52h;
  557. x4=x6; x9=x11=x4+.5u; x7=x8=x1; x9l:=x4+.25u;
  558. x5r=hround(w-1.5u); x10r=hround(w-u);
  559. if serifs: right_curve=cap_curve-stem_corr; x4=.5[x1,w-1.5u];
  560. else: right_curve=cap_curve-3stem_corr; x4=.5[x1,w-2.5u];
  561.  x4l:=x4l-.5u; x9l:=x9l-.5u; fi
  562. x6l:=x6l-.5u; x11l:=x11l-.5u;
  563. %fill stroke z3e..super_arc.e(4,5) & super_arc.e(5,6)..z7e;  % upper lobe
  564. fill stroke z8e..super_arc.e(9,10) & super_arc.e(10,11)..z12e;  % lower lobe
  565. if serifs: nodish_serif(1,2,a,1/3,.5cap_jut,b,1/3,.5cap_jut);  % upper serif
  566.  nodish_serif(2,1,c,1/3,cap_jut,d,1/3,.5cap_jut); fi  % lower serif
  567. pickup crisp.nib;
  568. top y55r=h; x55=x1; pos55(slab,90); pos56(hair,180); x56=x1-if serifs: 6 else: 3 fi u; 
  569. y56=good.y(y55l-beak)-eps;
  570. arm(55,56,q,beak_darkness**.8,-.4beak_jut);
  571. math_fit(0,.5ic#); penlabels(1,2,3,4,5,6,7,8,9,10,11,12); endchar;
  572.  
  573. %  The shape "K" is saved as a picture, to be used by the next file input.
  574. %  It is defined here to minimize storage time.
  575. cmchar "The Russian letter KA";
  576. beginchar("K",12u#,cap_height#,0);
  577. italcorr cap_height#*slant-.5u#;
  578. adjust_fit(0,.25u#);
  579. pickup tiny.nib; pos1(fudged.cap_stem,0); pos2(fudged.cap_stem,0);
  580. lft x1l=lft x2l=hround max(2u,3u-.5fudged.cap_stem); top y1=h; bot y2=0;
  581. filldraw stroke z1e--z2e; % stem
  582. if serifs:  dish_serif(1,2,a,1/3,cap_jut,b,1/3,cap_jut); % upper stem serif
  583.  dish_serif(2,1,c,1/3,cap_jut,d,1/3,cap_jut);  % lower stem serif
  584. % pickup fine.nib; pos3(vair,90); x3=x1; y3=.55h; x3'=x3; y3'=y3+1; pos3'(slab,90);
  585.  pickup fine.nib; pos3(vair,90); x3=x1; y3=.55h; z3'=z3; pos3'(varwid,90);
  586. % pos4(vair,90); x4=w-2u; top y4r=h+oo;
  587.  pos4(varwid,90); x4=w-.75flare-.125u; top y4r=h+oo; %original x4=w-2u
  588. % filldraw stroke z3'e{right}..{right}z4e;  % upper diagonal
  589.  x41=x4; y41=y3'; x42=x4-2u; y42=y4;
  590.  filldraw stroke z3'e..controls z41 and z42..z4e;  % upper diagonal
  591.  pos5(hair,0); pos6(flare,0);
  592.  rt x5r=hround(w-.125u); y5+.5flare=vround(top y4r-hair)+1; %original bot y4l-.03h
  593.  top y4'r=top y4r; x4'=x4; pos4'(hair,90);
  594.  bulb(4',5,6); % bulb
  595. % pos7(stem,0); pos8(vair,90); pos9(hair,180);
  596.  pos7(stem,0); pos8(varwid,90); pos9(hair,180);
  597.  x9+.5hair=hround(w+.5hair-eps); y9=1/3x_height;
  598.  lft x7l=hround(w-2.75u-.5stem); y7=1/2y3; x8=w-1.2u; bot y8l=-oo;
  599.  filldraw stroke z3e{right}...z7e{down}
  600.  ...z8e{right}...{up}z9e;  % lower diagonal
  601. else:
  602.  numeric right_jut,stem[],alpha[];
  603.  right_jut=.4tiny; 
  604.  pickup tiny.nib; 
  605.  stem2=max(tiny.breadth,fudged.cap_stem-3stem_corr);
  606.  stem1=max(tiny.breadth,fudged.hair if hefty:-3stem_corr fi);
  607.  top y3=h; rt x3r=hround(r-letter_fit-u-right_jut);
  608.  bot y6=0; rt x6r=hround(r-letter_fit-.75u-right_jut);
  609.  x4=x1; y4=1/3h;
  610.  alpha1=diag_ratio(1,.5(stem1-tiny),y3-y4,x3r-x4);
  611.  penpos3(alpha1*(stem1-tiny),0); penpos4(whatever,-90);
  612.  alpha2=diag_ratio(1,.5(stem2-tiny),y1-y6,x6r-x1);
  613.  penpos6(alpha2*(stem2-tiny),0);
  614.  forsuffixes $=l,r: y3'$=h; y6'$=0; z4$=z3'$+whatever*(z3-z4);
  615.   z5$=z6'$+whatever*(z1-z6)=whatever[z3,z4]; endfor
  616. %forsuffixes $=l,r: x5$:=x5$+.5u; y5$:=y5$-.5u; endfor
  617.  z5=.5[z5l,z5r];
  618.  z3'r=z3r+penoffset z3-z4 of currentpen+whatever*(z3-z4);
  619.  % we have also |z3'l=z3l+penoffset z4-z3 of currentpen+whatever*(z3-z4)|;\]
  620.  z6'r=z6r+penoffset z1-z6 of currentpen+whatever*(z1-z6);
  621.  z6'l=z6l+penoffset z6-z1 of currentpen+whatever*(z1-z6);
  622. % fill z4r{right}..diag_end(4r,3'r,1,.5,3'l,4l)..{left}z4l--cycle;  % upper diagonal
  623.  fill z4r--diag_end(4r,3'r,1,.5,3'l,4l)--z4l--cycle;  % upper diagonal
  624.  fill z5l--diag_end(5l,6'l,.5,1,6'r,5r)--z5r--cycle;  % lower diagonal
  625. fi
  626. picture K_pic; K_pic=currentpicture;
  627. math_fit(0,.5ic#); penlabels(1,2,3,4,5,6); endchar;
  628.