home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1999 April / VPR9904A.BIN / Wintex / Ams / jamstex.lzh / AMSFONTS / SOURCES / CYRILLIC / SERB.MF < prev    next >
Text File  |  1993-02-25  |  26KB  |  546 lines

  1. %% @metafontfile{
  2. %%     filename="serb.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="546",
  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 is serb.mf containing serbian and other letters with offsets
  32. %of 8 between upper and lower case
  33.  
  34. %  The letter "ZHE" is first in this file because it uses the picture "K"
  35. %  saved from the end of the previous file.
  36. cmchar "The Russian letter ZHE";
  37. beginchar(oct"021",12u#,cap_height#,0);
  38. italcorr cap_height#*slant+.25u#;
  39. adjust_fit(6u#+cap_serif_fit#,cap_serif_fit#); slantswitch;
  40. pickup tiny.nib; pos1(fudged.cap_stem,0); pos2(fudged.cap_stem,0);
  41. lft x1l=lft x2l=hround max(2u,3u-.5fudged.cap_stem); top y1=h; bot y2=0;
  42. filldraw stroke z1e--z2e; % stem
  43. if serifs:  dish_serif(1,2,a,1/3,cap_jut,b,1/3,cap_jut); % upper stem serif
  44.  dish_serif(2,1,c,1/3,cap_jut,d,1/3,cap_jut);  % lower stem serif
  45. % pickup fine.nib; pos3(vair,90); x3=x1; y3=.55h; z3'=z3; pos3'(slab,90);
  46.  pickup fine.nib; pos3(vair,90); x3=x1; y3=.55h; z3'=z3; pos3'(varwid,90);
  47. % pos4(vair,90); x4=w-2u; top y4r=h+oo;
  48.  pos4(varwid,90); x4=w-.75flare-.125u; top y4r=h+oo;
  49. % filldraw stroke z3'e{right}..{right}z4e;  % upper diagonal
  50.  x41=x4; y41=y3'; x42=x4-2u; y42=y4;
  51.  filldraw stroke z3'e..controls z41 and z42..z4e;  % upper diagonal
  52.  pos5(hair,0); pos6(flare,0);
  53.  rt x5r=hround(w-.125u); y5+.5flare=vround(top y4r-hair)+1;
  54.  top y4'r=top y4r; x4'=x4; pos4'(hair,90);
  55.  bulb(4',5,6); % bulb
  56. % pos7(stem,0); pos8(vair,90); pos9(hair,180);
  57.  pos7(stem,0); pos8(varwid,90); pos9(hair,180);
  58.  x9+.5hair=hround(w+.5hair-eps); y9=1/3x_height;
  59.  lft x7l=hround(w-2.75u-.5stem); y7=1/2y3; x8=w-1.2u; bot y8l=-oo;
  60.  filldraw stroke z3e{right}...z7e{down}
  61.  ...z8e{right}...{up}z9e;  % lower diagonal
  62. else:
  63.  numeric right_jut,stem[],alpha[];
  64.  right_jut=.4tiny; 
  65.  pickup tiny.nib; 
  66.  stem2=max(tiny.breadth,fudged.cap_stem-3stem_corr);
  67.  stem1=max(tiny.breadth,fudged.hair if hefty:-3stem_corr fi);
  68.  top y3=h; rt x3r=hround(r-letter_fit-u-right_jut);
  69.  bot y6=0; rt x6r=hround(r-letter_fit-.75u-right_jut);
  70.  x4=x1; y4=1/3h;
  71.  alpha1=diag_ratio(1,.5(stem1-tiny),y3-y4,x3r-x4);
  72.  penpos3(alpha1*(stem1-tiny),0); penpos4(whatever,-90);
  73.  alpha2=diag_ratio(1,.5(stem2-tiny),y1-y6,x6r-x1);
  74.  penpos6(alpha2*(stem2-tiny),0);
  75.  forsuffixes $=l,r: y3'$=h; y6'$=0; z4$=z3'$+whatever*(z3-z4);
  76.   z5$=z6'$+whatever*(z1-z6)=whatever[z3,z4]; endfor
  77.  z5=.5[z5l,z5r];
  78.  z3'r=z3r+penoffset z3-z4 of currentpen+whatever*(z3-z4);
  79.  % we have also |z3'l=z3l+penoffset z4-z3 of currentpen+whatever*(z3-z4)|;\]
  80.  z6'r=z6r+penoffset z1-z6 of currentpen+whatever*(z1-z6);
  81.  z6'l=z6l+penoffset z6-z1 of currentpen+whatever*(z1-z6);
  82.  fill z4r--diag_end(4r,3'r,1,.5,3'l,4l)--z4l--cycle;  % upper diagonal
  83.  fill z5l--diag_end(5l,6'l,.5,1,6'r,5r)--z5r--cycle;  % lower diagonal
  84. fi
  85. picture V; %transform t;
  86. %t=identity reflectedabout(z1,z2);
  87. %V=currentpicture transformed t;
  88. %addto currentpicture also V;
  89. mirror(x1);
  90. addto currentpicture also K_pic;
  91. %  !!!!! note that this requires K_pic be set as current by previous K definition
  92. %  
  93. picture K_pic; %release resources held by K_pic
  94. endchar;
  95.  
  96. cmchar "The Serbian letter Soft N (looks like Hb)";
  97. beginchar(oct"000",19u#,cap_height#,0);
  98. italcorr cap_height#*slant-cap_serif_fit#+cap_jut#-2.5u#+min(.5cap_stem#,u#);
  99. adjust_fit(cap_serif_fit#,0);
  100. w:=13u;
  101. pickup tiny.nib; pos1(cap_stem,0); pos2(cap_stem,0);
  102. pos3(cap_stem,0); pos4(cap_stem,0);
  103. lft x1l=lft x2l=hround max(2u,3u-.5cap_stem); x3=x4=w-x1;
  104. top y1=top y3=h; bot y2=bot y4=0;
  105. filldraw stroke z1e--z2e; % left stem
  106. filldraw stroke z3e--z4e; % right stem
  107. penpos5(cap_bar,90); penpos6(cap_bar,90);
  108. x5=x1; x6=x3; y5=y6=.52h;
  109. fill stroke z5e--z6e;  % bar
  110. if serifs: numeric inner_jut;
  111.  if rt x1r+cap_jut+.5u+1<=lft x3l-cap_jut: inner_jut=cap_jut;
  112.  else: rt x1r+inner_jut+.5u+1=lft x3l-inner_jut; fi
  113.  dish_serif(1,2,a,1/3,cap_jut,b,1/3,inner_jut);  % upper left serif
  114.  dish_serif(2,1,c,1/3,cap_jut,d,1/3,inner_jut); % lower left serif
  115.  dish_serif(3,4,e,1/3,inner_jut,f,1/3,cap_jut);  % upper rt serif
  116.  nodish_serif(4,3,g,1/3,inner_jut,h,1/3,cap_jut); fi  % lower rt serif
  117. % now the b part
  118. w:=19u; numeric middle_weight;
  119.   middle_weight=if serifs: .6vair+.5 else: cap_bar fi;
  120. z88=z6; penpos88(middle_weight,90); penpos89(middle_weight,90);
  121. y89=y88; x89=x91= if serifs: .5[x3,w-1.5u]+.5u else: .5[x3,w-2.5u] +.5u fi;
  122. numeric right_curve; 
  123. if serifs: right_curve=cap_curve-stem_corr;
  124. else: right_curve=cap_curve-3stem_corr; fi
  125. x89l:=x89-.25u; penpos90(right_curve,0); y90=.5[y89,y91]; x90r=hround(w-u);
  126. bot y92r=0; x92=x4; penpos92(cap_band,-90); y91=y92; penpos91(cap_band,-90);
  127. filldraw stroke z88e..super_arc.e(89,90)&super_arc.e(90,91)..z92e;
  128. math_fit(0,.5ic#); penlabels(1,2,3,4,5,6); endchar;
  129.  
  130. cmchar "The Serbian letter Soft L";
  131. beginchar(oct"001",19u#,cap_height#,0);
  132. adjust_fit(0,0); w:=13u;
  133. pickup tiny.nib; pos1(cap_stem,0); pos2(cap_stem,0);
  134. lft x1l=lft x2l=hround(w-3u); top y1=h; bot y2=0;
  135. filldraw stroke z1e--z2e;
  136. if serifs:
  137.   numeric inner_jut; inner_jut=.5(x1-x5);
  138.   x4=u+.5dot_size; x3=x4+.5dot_size; bot y3r=0; pos3(1.5cap_hair,-90); 
  139.   x5=.42[x4,x1]; top y5=h; pos5(1.5cap_hair,0); pos4(dot_size,-180);
  140.   pos10(hair,-180);
  141.   filldraw stroke z3e{right}...{up}z5e;
  142.   y4=dot_size; bulb(3,10,4);
  143.   nodish_serif(2,1,a,1/3,cap_jut,b,1/3,cap_jut);
  144.   nodish_serif(1,2,c,1/3,inner_jut,d,1/3,cap_jut);
  145. %  pickup crisp.nib; 
  146.   top y6=h;  x6-.75cap_jut=rt x1r; pos6(slab,90);
  147.   x5'+.5cap_jut=lft x5l; top y5'=h; pos5'(slab,90);
  148. %  filldraw stroke z5'e--z6e;
  149.   x9=x5; bot y9=0; pos9(cap_hair,0);
  150.   nodish_serif(5,9,aa,1/3,cap_jut,ab,1/3,inner_jut);  % upper left serif
  151. else:
  152.   x5r=hround u; bot y5r=vround(.06h-o); bot y4r=-o; x4r=.35[x5,x3r];
  153.   x3=x5+3flare; top y3=h; lft x3'=lft x3l; top y3'r=h; rt x1'r=rt x1r;
  154.   top y1'r=h; pos3'(slab,90); pos1'(slab,90); pos5(flare,-120); pos4(vair,-90);
  155.   pos3(hair,0);
  156.   filldraw stroke z5e...{right}z4e...{up}z3e;
  157.   filldraw stroke z3'e--z1'e;
  158. fi
  159. % now the b part
  160. w:=19u; numeric middle_weight; middle_weight=.6vair+.5;
  161. x88=x1; y88=.52h; penpos88(middle_weight,90); penpos89(middle_weight,90);
  162. y89=y88; x89=x91= if serifs: .5[x1,w-1.5u]+.5u else: .5[x1,w-2.5u] +.5u fi;
  163. numeric right_curve; 
  164. if serifs: right_curve=cap_curve-stem_corr; else: right_curve=cap_curve-3stem_corr; fi
  165. x89l:=x89-.25u; penpos90(right_curve,0); y90=.5[y89,y91]; x90r=hround(w-u);
  166. x92=x2; bot y92r=0; penpos92(cap_band,-90); y91=y92; penpos91(cap_band,-90);
  167. filldraw stroke z88e..super_arc.e(89,90)&super_arc.e(90,91)..z92e;
  168. endchar;
  169.  
  170. cmchar "The Serbian letter Hard DJ";
  171. beginchar(oct"002",13u#+width_adj#,cap_height#,if serifs: 1.75cap_stem#
  172.   else: .5desc_depth# fi);
  173. italcorr cap_height#*slant-cap_serif_fit#+cap_jut#-2.5u#+min(.5cap_stem#,u#);
  174. adjust_fit(cap_serif_fit#,cap_serif_fit#);
  175. pickup tiny.nib; pos1(cap_stem,0); pos2(cap_stem,0);
  176. pos3(cap_stem,0); pos4(cap_stem,0);
  177. lft x1l=lft x2l=hround max(2u,3u-.5cap_stem); x3=x4=w-x1;
  178. top y1=top y3=h; bot y2=bot y4=0;
  179. filldraw stroke z1e--z2e; % left stem
  180. filldraw stroke z3e--z4e; % right stem
  181. if serifs: numeric inner_jut;
  182.  if rt x1r+cap_jut+.5u+1<=lft x3l-cap_jut: inner_jut=cap_jut;
  183.  else: rt x1r+inner_jut+.5u+1=lft x3l-inner_jut; fi
  184.  dish_serif(1,2,c,1/3,cap_jut,d,1/3,inner_jut); % upper left serif
  185.  dish_serif(3,4,g,1/3,inner_jut,h,1/3,cap_jut);   % upper left serif
  186.  inner_jut:=.5(x3l-x1r);
  187.  nodish_serif(2,1,a,1/3,cap_jut,b,1/3,inner_jut);  % lower left serif
  188.  nodish_serif(4,3,e,1/3,inner_jut,f,1/3,cap_jut);  % lower left serif 
  189. else:
  190.  lft x1'= lft x1l; bot y1'l=0; pos1'(slab,90);
  191.  rt x3'=rt x3r; y3'=y1'; pos3'(slab,90); filldraw stroke z1'e--z3'e;
  192. fi
  193. x90=.5[x2,x4]; y90=0; x91=x90; y91=-d; pos90(cap_stem,0); pos91(cap_stem,0);
  194. filldraw stroke z90e--z91e; 
  195. math_fit(0,.5ic#); penlabels(1,2,3,4,5,6); endchar;
  196.  
  197. cmchar "The Russian letter Reverse E (looks like backwards C)";
  198. if serifs: beginchar(oct"003",13u#,cap_height#,0);
  199.  italcorr cap_height#*slant-.5u#;
  200.  adjust_fit(0,0); slantswitch;
  201.  pickup fine.nib; pos1(cap_hair,0); pos2(cap_band,90);
  202.  pos3(cap_curve,180); pos4(cap_band,270); pos5(hair,360);
  203.  rt x1r=rt x5r=hround(w-u); lft x3r=hround u; x2=x4=.55[x3,x1];
  204.  top y2r=h+o; bot y4r=-o; y3=.5[y2,y4];
  205.  bot y1=min(vround .675h,bot y2l-eps);
  206.  y5=max(good.y .95(h-y1),y4l+eps);
  207.  (x2l',y2l)=whatever[z2r,z1l]; x2l:=min(x2l',x2l+.5u);
  208.  (x4l',y4l)=whatever[z4r,z5l]; x4l:=min(x4l',x4l+.5u);
  209.  filldraw stroke z1e{x2-x1,10(y2-y1)}
  210.   ...pulled_arc.e(2,3) & pulled_arc.e(3,4)...{up}z5e; % arc
  211.  pos6(.3[fine.breadth,cap_hair],0); x6r=x1r; top y6=h+o;
  212.  x1r-x1'=2cap_curve-fine; y1'=y1;
  213.  path upper_arc; upper_arc=z1{x2-x1,10(y2-y1)}..z2{left};
  214.  numeric t; t=xpart(upper_arc intersectiontimes (z6l--z1'));
  215.  filldraw z1r--z6r--z6l--subpath(t,0) of upper_arc--cycle; % barb
  216. else: beginchar(oct"003",11.5u#,cap_height#,0);
  217.  italcorr cap_height#*slant-.5u#;
  218.  adjust_fit(0,0); slantswitch;
  219.  pickup fine.nib; pos1(1.2flare,80); pos2(slab,90);
  220.  pos3(cap_curve,180); pos4(slab,270); pos5(flare,275);
  221.  rt x1r=hround(w-1.1u); x2=x4=.5w+1.25u;
  222.  lft x3r=hround max(u,2u-.5cap_curve); rt x5r=hround(w-.9u);
  223.  top y1r=vround .95h+o; top y2r=h+o; y3=.5h;
  224.  bot y4r=-o; bot y5r=vround .08h-o; y5l:=good.y y5l; x5l:=good.x x5l;
  225.  x1'=.65w;
  226.  filldraw stroke rterm.e(2,1,right,.9,4) & super_arc.e(2,3)
  227.   & super_arc.e(3,4) & term.e(4,5,right,.8,4); fi % arc and terminals
  228. z90=z3l; x91=x1; y91=y90; pos90(bar,90); pos91(bar,90); 
  229. if serifs: z92=.625[z90,z91]; pos92(if serifs: 2.5 fi bar,90);
  230.   filldraw stroke z90e{1,1}..{1,-1}z92e..{1,1}z91e;
  231. else: filldraw stroke z90e--z91e; fi
  232. mirror(.5w);
  233. math_fit(-.3cap_height#*slant-.5u#,.5ic#);
  234. penlabels(1,1',2,3,4,5,6); endchar;
  235.  
  236. cmchar "The Ukrainian letter YE (looks like C with mid-line)";
  237. if serifs: beginchar(oct"005",13u#,cap_height#,0);
  238.  italcorr cap_height#*slant-.5u#;
  239.  adjust_fit(0,0);
  240.  pickup fine.nib; pos1(cap_hair,0); pos2(cap_band,90);
  241.  pos3(cap_curve,180); pos4(cap_band,270); pos5(hair,360);
  242.  rt x1r=rt x5r=hround(w-u); lft x3r=hround u; x2=x4=.55[x3,x1];
  243.  top y2r=h+o; bot y4r=-o; y3=.5[y2,y4];
  244.  bot y1=min(vround .675h,bot y2l-eps);
  245.  y5=max(good.y .95(h-y1),y4l+eps);
  246.  (x2l',y2l)=whatever[z2r,z1l]; x2l:=min(x2l',x2l+.5u);
  247.  (x4l',y4l)=whatever[z4r,z5l]; x4l:=min(x4l',x4l+.5u);
  248.  filldraw stroke z1e{x2-x1,10(y2-y1)}
  249.   ...pulled_arc.e(2,3) & pulled_arc.e(3,4)...{up}z5e; % arc
  250.  pos6(.3[fine.breadth,cap_hair],0); x6r=x1r; top y6=h+o;
  251.  x1r-x1'=2cap_curve-fine; y1'=y1;
  252.  path upper_arc; upper_arc=z1{x2-x1,10(y2-y1)}..z2{left};
  253.  numeric t; t=xpart(upper_arc intersectiontimes (z6l--z1'));
  254.  filldraw z1r--z6r--z6l--subpath(t,0) of upper_arc--cycle; % barb
  255. else: beginchar(oct"005",11.5u#,cap_height#,0);
  256.  italcorr cap_height#*slant-.5u#;
  257.  adjust_fit(0,0);
  258.  pickup fine.nib; pos1(1.2flare,80); pos2(slab,90);
  259.  pos3(cap_curve,180); pos4(slab,270); pos5(flare,275);
  260.  rt x1r=hround(w-1.1u); x2=x4=.5w+1.25u;
  261.  lft x3r=hround max(u,2u-.5cap_curve); rt x5r=hround(w-.9u);
  262.  top y1r=vround .95h+o; top y2r=h+o; y3=.5h;
  263.  bot y4r=-o; bot y5r=vround .08h-o; y5l:=good.y y5l; x5l:=good.x x5l;
  264.  x1'=.65w;
  265.  filldraw stroke rterm.e(2,1,right,.9,4) & super_arc.e(2,3)
  266.   & super_arc.e(3,4) & term.e(4,5,right,.8,4); fi % arc and terminals
  267. z90=z3l; x91=x1; y91=y90; pos90(bar,90); pos91(bar,90); 
  268. if serifs: z92=.625[z90,z91]; pos92(if serifs: 2.5 fi bar,90);
  269.   filldraw stroke z90e{1,1}..{1,-1}z92e..{1,1}z91e;
  270. else: filldraw stroke z90e--z91e; fi
  271. math_fit(-.3cap_height#*slant-.5u#,.5ic#);
  272. penlabels(1,1',2,3,4,5,6); endchar;
  273.  
  274. cmchar "The Russian letter YU (looks like IO)";
  275. beginchar(oct"020",14u#-width_adj#,cap_height#,0);
  276. italcorr .7cap_height#*slant-.5u#;
  277. adjust_fit(6.5u#,0);
  278. penpos1(vair',90); penpos3(vround(vair+1.5vair_corr),-90);
  279. penpos2(cap_curve,180); penpos4(cap_curve,0);
  280. if monospace: x2r=hround 1.5u;
  281.  interim superness:=sqrt superness;  % make |"O"|, not |"0"|
  282. else: x2r=hround u; fi
  283. x4r=w-x2r; x1=x3=.5w; y1r=h+o; y3r=-o;
  284. y2=y4=.5h-vair_corr; y2l:=y4l:=.52h;
  285. penstroke pulled_super_arc.e(1,2)(.5superpull)
  286.  & pulled_super_arc.e(2,3)(.5superpull)
  287.  & pulled_super_arc.e(3,4)(.5superpull)
  288.  & pulled_super_arc.e(4,1)(.5superpull) & cycle;  % bowl
  289. pickup tiny.nib;
  290. x80=x81=-3u; top y80=h; bot y81=0; pos80(cap_stem,0); pos81(cap_stem,0);
  291. filldraw stroke z80e--z81e;
  292. if serifs: 
  293.   dish_serif(80,81,e,1/3,cap_jut,f,1/3,cap_jut);
  294.   dish_serif(81,80,g,1/3,cap_jut,h,1/3,cap_jut); 
  295. fi  
  296. x82=x80; y82=y2; x83=x2; y83=y82; pos82(cap_bar,90); pos83(cap_bar,90);
  297. filldraw stroke z82e--z83e;
  298. math_fit(-.3cap_height#*slant-.5u#,ic#-.5u#); penlabels(1,2,3,4); endchar;
  299.  
  300. cmchar "The Russian letter Short I";
  301. beginchar(oct"022",14u#+width_adj#,cap_height#+3dot_size#,0);
  302. italcorr cap_height#*slant-cap_serif_fit#+cap_jut#-2.5u#+min(.5cap_stem#,u#);
  303. adjust_fit(cap_serif_fit#,cap_serif_fit#); h:=cap_height;
  304. pickup tiny.nib; pos1(cap_stem,0); pos2(cap_stem,0);
  305. pos3(cap_stem,0); pos4(cap_stem,0);
  306. lft x1l=lft x2l=hround max(2u,3u-.5cap_stem); x3=x4=w-x1;
  307. top y1=top y3=h; bot y2=bot y4=0;
  308. filldraw stroke z1e--z2e; % left stem
  309. filldraw stroke z3e--z4e; % right stem
  310. if serifs: penpos5(.85cap_stem,90); penpos6(.85cap_stem,90); else: penpos5(cap_stem,90); penpos6(cap_stem,90); fi
  311. x5=x1r; x6=x3l; if serifs: y5=.1h; y6=.9h; else: bot y5l=0; top y6r=h; fi
  312. fill stroke z5e--z6e;  % bar
  313. if serifs: numeric inner_jut;
  314.  if rt x1r+cap_jut+.5u+1<=lft x3l-cap_jut: inner_jut=cap_jut;
  315.  else: rt x1r+inner_jut+.5u+1=lft x3l-inner_jut; fi
  316.  dish_serif(1,2,a,1/3,cap_jut,b,1/3,inner_jut);  % upper left serif
  317.  dish_serif(2,1,c,1/3,cap_jut,d,1/3,inner_jut); % lower left serif
  318.  dish_serif(3,4,e,1/3,inner_jut,f,1/3,cap_jut);  % upper left serif
  319.  dish_serif(4,3,g,1/3,inner_jut,h,1/3,cap_jut); fi  % lower left serif
  320. x51=.5w; y51=h; h:=body_height+2dot_size; nucyrbrev(51,q);
  321. math_fit(0,.5ic#); penlabels(1,2,3,4,5,6); endchar;
  322.  
  323. % for shape, see Knizhnay Shrift p 58  Bodoni, Parma 1818
  324. cmchar "The Old Russian letter IZHITSA (looks like V)";
  325. beginchar(oct"024",13u#,cap_height#,0);
  326. italcorr cap_height#*slant+.25u#;
  327. adjust_fit(cap_serif_fit#,cap_serif_fit#);
  328. numeric left_stem,right_stem,outer_jut,alpha;
  329. left_stem=cap_stem-stem_corr;
  330. right_stem=min(cap_hair if hefty:-2stem_corr fi,left_stem);
  331. outer_jut=.75cap_jut;
  332. x1l=w-x4r-1.5u=l+letter_fit+outer_jut+.25u; y1=y4+.1h+cap_hair=h;
  333. x2-x1=x4-x3; x2l+apex_corr=x3l; y2=y3=-apex_o;
  334. alpha=diag_ratio(2,right_stem,y1-y2,x4r-x1l-apex_corr);
  335. penpos1(alpha*left_stem,0); penpos2(alpha*left_stem,0);
  336. penpos3(alpha*right_stem,0); penpos4(alpha*right_stem,0);
  337. z0=whatever[z1r,z2r]=whatever[z3l,z4l];
  338. x5=x4+ if serifs:1.5 else: 2.25 fi u; top y5r=h+oo; penpos5(cap_hair,90); 
  339. rt x6r-.25flare=hround(w-.5u-.5); y6+.55flare=bot y5l; penpos6(hair,0);
  340. penpos7(flare,0); if serifs: bulb(5,6,7); fi
  341. if y0>cap_notch_cut: y0:=cap_notch_cut; message "y0>cap_notch_cut";
  342.   fill z0+.5right{up}...{z4-z3}z4l...{right}z5r--z5l{left}
  343.     ...z4r{z3-z4}--z3r...z3l--diag_end(2l,1l,1,1,1r,2r){z2-z1}
  344.     ...{down}z0+.5left--cycle; % left and right diagonals
  345. else: fill z0--z4l{z4-z3}...{right}z5r--z5l{left}
  346.     ...{z3-z4}z4r--z3r{-10,-1}...{-10,1}z3l
  347.     --diag_end(2l,1l,1,1,1r,0)--cycle; fi % left and right diagonals
  348. if serifs: numeric inner_jut; pickup tiny.nib;
  349.  prime_points_inside(1,2); prime_points_inside(4,3);
  350.  if rt x1'r+cap_jut+.5u+1<=lft x4'l-cap_jut: inner_jut=cap_jut;
  351.  else: rt x1'r+inner_jut+.5u+1=lft x4'l-inner_jut; fi
  352.  dish_serif(1',2,a,1/3,outer_jut,b,1/2,inner_jut);  % left serif
  353. fi 
  354. math_fit(.75u#-cap_height#*slant,ic#-4u#); penlabels(0,1,2,3,4); endchar;
  355.  
  356. cmchar "The Old Russian letter FITA (looks like Theta)";
  357. beginchar(oct"025",14u#,cap_height#,0);
  358. italcorr .7cap_height#*slant-.5u#;
  359. adjust_fit(0,0);
  360. numeric light_curve; light_curve=hround(cap_curve-2stem_corr);
  361. penpos1(vair,90); penpos3(vround(vair+.5vair_corr),-90);
  362. penpos2(light_curve,180); penpos4(light_curve,0);
  363. if monospace: x2r=hround 4.5u;
  364.  interim superness:=sqrt superness;  % make |"O"|, not |"0"|
  365. else: x2r=hround 2.5u; fi
  366. x4r=w-x2r; x1=x3=.5w; y1r=h+o; y2=y4=.5h-vair_corr; y3r=-o;
  367. penstroke pulled_super_arc.e(1,2)(.5superpull)
  368.  & pulled_super_arc.e(2,3)(.5superpull)
  369.  & pulled_super_arc.e(3,4)(.5superpull)
  370.  & pulled_super_arc.e(4,1)(.5superpull) & cycle;  % bowl
  371. pickup crisp.nib; pos5(cap_vstem,90); pos6(cap_vstem,90);
  372. lft x5=w-rt x6=hround .5u; y5=y6=.5[y1l,y3l];
  373. filldraw stroke z5e--z6e;  % bar
  374. if serifs: pos7(hair,0); pos8(hair,0); pos9(hair,0); pos10(hair,0);
  375.  x7l=x8l=x5; x9r=x10r=x6;
  376.  y7=y5r; y9=y6r; y5l-y8=y6l-y10=vround .075h;
  377.  filldraw stroke z7e--z8e;  % left serif
  378.  filldraw stroke z9e--z10e; fi  % right serif
  379. math_fit(-.3cap_height#*slant-.5u#,ic#-.5u#);
  380. penlabels(1,2,3,4,5,6,7,8,9,10); endchar;
  381.  
  382. cmchar "The Macedonian letter ZELO (looks like S)";
  383. beginchar(oct"026",10u#,cap_height#,0);
  384. italcorr cap_height#*slant-u#;
  385. adjust_fit(0,0);
  386. numeric theta; theta=90-angle(50u,h); slope:=-h/50u;  % angle at middle
  387. numeric s_slab; s_slab=if serifs:slab else:vround .2[slab,cap_stem] fi;
  388. numeric ess'; ess'=max(fine.breadth,cap_ess);
  389. pickup fine.nib; pos2(max(fine.breadth,s_slab-vround vair_corr),-90);
  390. pos0(ess',theta); pos7(s_slab,-90);
  391. x2+x7=2x0=w; x7-x2=if serifs: u else: 0 fi; top y2l=h+o; bot y7r=-o;
  392. y0=.52h; lft x3l=hround u; rt x6r=hround(w-u);
  393. x3r-x3l=x6r-x6l=hround .5[s_slab,ess']-fine;
  394. ellipse_set(2l,3l,4l,0l); ellipse_set(2r,3r,4r,0r); y3=y3r;
  395. ellipse_set(7l,6l,5l,0l); ellipse_set(7r,6r,5r,0r); y6=y6r;
  396. filldraw stroke super_arc.e(2,3) & z3e{down}
  397.  ..z4e---z5e..z6e{down} & super_arc.e(6,7);  % main stroke
  398. if serifs: pos1(hair,180); pos8(hair,180);
  399.  rt x1l=hround(w-1.5u); lft x8r=hround u;
  400.  bot y1=vround 2/3h+1; top y8=vround 1/3h-1;
  401.  filldraw stroke z1e{x2-x1,10(y2-y1)}....{left}z2e;  % upper arc
  402.  filldraw stroke z7e{left}....{up}z8e;  % lower arc
  403.  path upper_arc, lower_arc;
  404.  upper_arc=z1{x2-x1,10(y2-y1)}....{left}z2;
  405.  lower_arc=z7{left}....{up}z8;
  406.  pos10(.3[fine.breadth,cap_hair],0); pos9(.3[fine.breadth,cap_hair],0);
  407.  x10r=x1l; top y10=top y2l; x9l=x8r; bot y9=bot y7r;
  408.  x1l-x1'=x8'-x8r=1.6cap_curve-fine; y1'=y1; y8'=y8;
  409.  numeric t; t=xpart(upper_arc intersectiontimes(z10l--z1'));
  410.  filldraw z1l--z10r--z10l--subpath(t,0) of upper_arc--cycle;  % upper barb
  411.  t:=xpart(lower_arc intersectiontimes(z9r--z8'));
  412.  filldraw z8r--z9l--z9r--subpath(t,1) of lower_arc--cycle;  % lower barb
  413. else: pos1(1.2flare,-100); pos8(1.2flare,-100);
  414.  x1l=good.x(x1l+w-1.75u-rt x1); lft x8r=hround .8u;
  415.  top y1l=vround .93h+o; bot y8r=vround .1h-o;
  416.  filldraw stroke term.e(2,1,right,.9,4);  % upper arc and terminal
  417.  filldraw stroke term.e(7,8,left,1,4); fi  % lower arc and terminal
  418. math_fit(0,.5ic#); penlabels(0,1,1',2,3,4,5,6,7,8,8',9,10); endchar;
  419.  
  420. cmchar "The Russian letter YA (looks like backward R)";
  421. beginchar(oct"027",if serifs: 12u#+.5max(2u#,cap_curve#)
  422.  else:12.5u#-.5width_adj# fi,cap_height#,0);
  423. italcorr .75cap_height#*slant- if serifs: 1.75 else: .5 fi\\ u#;
  424. adjust_fit(0,cap_serif_fit#); slantswitch;
  425. pickup tiny.nib; pos1(cap_stem',0); pos2(cap_stem',0);
  426. lft x1l=lft x2l=hround max(2u,3u-.5cap_stem'); top y1=h; bot y2=0;
  427. filldraw stroke z1e--z2e; % stem
  428. penpos3(cap_band,90); penpos4(cap_band,90);
  429. penpos5(cap_curve if hefty:-3stem_corr fi,0);
  430. penpos6(vair,-90); penpos7(vair,-90);
  431. z3r=top z1; y4=y3; y5=.5[y4l,y6l]; y6=y7;
  432. x7=x2; y7l=vround(.5h+.5vair); x4=x6;
  433. if serifs: x4=.5w-.5u; x5r=hround(w-2.25u);
  434. else: x4=.5w+.5u; x5r=hround(w-u); fi
  435. x4l:=x6l:=x4-.125cap_curve;
  436. fill stroke z3e..pulled_arc.e(4,5) & pulled_arc.e(5,6)..z7e;  % lobe
  437. if serifs: pos6'(vair,-90); pos0(cap_stem,180);
  438.  pos8(cap_curve,180); pos9(vair,-90); pos10(hair,0);
  439.  z6'=z6; lft x0r=lft x8r=hround(x5-2/3u-.5cap_curve);
  440.  y8=1/3[y2,y7]; y0=3/5[y2,y7]; x9=.5[x8l,x10r];
  441.  bot y9r=-o; rt x10r=hround(w-.05u); y10=1/4[y2,y7];
  442.  filldraw stroke z6'e{right}..z0e---z8e....z9e{right}..z10e{up};  % tail
  443.  nodish_serif(1,2,a,1/3,cap_jut,b,1/3,.5cap_jut);  % upper serif
  444.  dish_serif(2,1,c,1/3,cap_jut,d,1/3,cap_jut);  % lower serif
  445. else: penpos8(cap_stem-2stem_corr,0); penpos9(cap_stem,0);
  446.  x8=x6+.5u; y8=y6; x9r=hround(w-.5u); y9=0;
  447.  fill z8l--diag_end(8l,9l,.5,1,9r,8r)--z8r--cycle; fi  % tail
  448. mirror(.5w);
  449. math_fit(0,.75ic#); penlabels(0,1,2,3,4,5,6,7,8,9,10); endchar;
  450.  
  451. endinput;                    %%%%%%%%%%%%%%%%%%%%
  452.  
  453. cmchar "The Ukrainian letter Hard G (looks like Gamma)";
  454. beginchar(oct"225",11.5u#-width_adj#,body_height#,0);
  455. italcorr cap_height#*slant-beak_jut#-.25u#;
  456. adjust_fit(cap_serif_fit#,0);
  457. pickup tiny.nib; pos1(cap_stem,0); pos2(cap_stem,0);
  458. lft x1l=lft x2l=hround max(2u,3u-.5cap_stem); top y1=cap_height; bot y2=0;
  459. filldraw stroke z1e--z2e; % stem
  460. pickup crisp.nib; pos3(slab,90); pos4(hair,0);
  461. top y3r=cap_height; x3=x1; rt x4r=hround(w-.75u); y4=good.y(y3l+beak)+eps;
  462. if serifs: armup(3,4,e,beak_darkness,beak_jut);  % upper arm and beak
  463. else: x21=x4; y21=y3; rt x22r=rt x21; x22'=x22; y22'=top y21r; y22=top y21r+slab; pos21(slab,90); pos22(slab,0); pos22'(slab,0);
  464.   filldraw stroke z3e--z21e; filldraw stroke z22e--z22'e;
  465. fi
  466. pos5(cap_bar,-90); pos6(hair,0);
  467. top y5l=vround(.5[y2,y1]+.5cap_bar); x5=x1;
  468. pos0(cap_bar,90); pos7(hair,0);
  469. z0=z5; x6=x7; y6-y5l=y0l-y7;
  470. if serifs: rt x6r=hround(w-4u+.5hair); y6=good.y(y5l+.6beak)+eps;
  471.  rt x9r=hround(w-.5u);
  472. else: rt x6r=hround(w-1.5u); y6=y5l+eps; rt x9r=hround(w-.75u); fi
  473. %arm(5,6,f,beak_darkness,0); arm(0,7,g,beak_darkness,0);  % middle arm and serif
  474. if serifs: nodish_serif(1,2,a,1/3,cap_jut,b,1/3,.5cap_jut);  % upper serif
  475.  dish_serif(2,1,c,1/3,cap_jut,d,1/3,1.25cap_jut); fi  % lower serif
  476. math_fit(0,ic#-2.5u#); penlabels(0,1,2,3,4,5,6,7,8,9); endchar;
  477.  
  478. cmchar "The letter A modified";
  479. beginchar(oct"255",13u#+2cap_stem#,cap_height#,0);
  480. adjust_fit(cap_serif_fit#,cap_serif_fit#);
  481. numeric left_stem,right_stem,outer_jut,alpha;
  482. right_stem=cap_stem-stem_corr;
  483. left_stem=min(cap_hair if hefty: -3stem_corr fi,right_stem);
  484. outer_jut=.8cap_jut; x1l=w-x4r=l+letter_fit+outer_jut+.5u; y1=y4=0;
  485. x2-x1=x4-x3; x3r=x2r+apex_corr; y2=y3=h+apex_o+apex_oo;
  486. alpha=diag_ratio(2,left_stem,y2-y1,x4r-x1l-apex_corr);
  487. penpos1(alpha*left_stem,0); penpos2(alpha*left_stem,0);
  488. penpos3(alpha*right_stem,0); penpos4(alpha*right_stem,0);
  489. z0=whatever[z1r,z2r]=whatever[z3l,z4l];
  490. if y0<h-cap_notch_cut: y0:=h-cap_notch_cut;
  491.  fill z0+.5right{down}...{z4-z3}diag_end(3l,4l,1,1,4r,3r)
  492.   --diag_end(4r,3r,1,1,2l,1l)--diag_end(2l,1l,1,1,1r,2r){z2-z1}
  493.   ...{up}z0+.5left--cycle; % left and right diagonals
  494. else: fill z0--diag_end(0,4l,1,1,4r,3r)--diag_end(4r,3r,1,1,2l,1l)
  495.   --diag_end(2l,1l,1,1,1r,0)--cycle; fi % left and right diagonals
  496. penpos5(whatever,angle(z2-z1)); z5=whatever[z1,z2];
  497. penpos6(whatever,angle(z3-z4)); z6=whatever[z3,z4]; y6=y5;
  498. if hefty: y5r else: y5 fi =.5y0;
  499. y5r-y5l=y6r-y6l=cap_band; penstroke z5e--z6e; % bar line
  500. if serifs: numeric inner_jut; pickup tiny.nib;
  501.  prime_points_inside(1,2); prime_points_inside(4,3);
  502.  if rt x1'r+cap_jut+.5u+1<=lft x4'l-cap_jut: inner_jut=cap_jut;
  503.  else: rt x1'r+inner_jut+.5u+1=lft x4'l-inner_jut; fi
  504.  dish_serif(1',2,a,1/2,outer_jut,b,.6,.6inner_jut)(dark);  % left serif
  505.  dish_serif(4',3,c,1/2,.6inner_jut,d,1/3,outer_jut); fi  % right serif
  506. x99=.5[x5,x6]; y99=y5; pos99(.5cap_stem,0); pos98(.5cap_stem,0);
  507. x98=x99; bot y98=0; filldraw stroke z98e--z99e;
  508. if serifs: dish_serif(98,99,e,1/3,.6inner_jut,f,1/3,.6inner_jut); fi
  509. penlabels(0,1,2,3,4,5,6); endchar;
  510.  
  511. cmchar "The Old Bulgarian letter YUS";
  512. beginchar(oct"322",18u#,cap_height#,0);
  513. italcorr cap_height#*slant+.25u#;
  514. adjust_fit(cap_serif_fit#,cap_serif_fit#);
  515. pickup tiny.nib;
  516. x1l=w-x2r=.2w;
  517. pos1(cap_stem,0); pos2(cap_hair,0); top y1=h; y2=y1;
  518. x3=.5[x1,x2]; x4=x3; bot y4=0; pos3(cap_stem,0); pos4(cap_stem,0);
  519. pos5(cap_stem,0); x5=x3;
  520. bot y5=.52h; %top y5=x_height; 
  521. z3l=whatever[z1l,z5l]; z3r=whatever[z5r,z2r];
  522. x5'r=x5r; y5'=y5; pos5'(cap_hair,0);
  523. filldraw stroke z1e--z5e;
  524. filldraw stroke z5'e--z2e; filldraw stroke z3e--z4e;
  525. if serifs: pos0(cap_stem,180); pos8(cap_curve,180); pos9(vair,-90); pos10(hair,0);
  526.   x7=x3; y7r=bot y5; x6=1/3[x4,x8]; y6=y7; pos6(vair,-90); pos7(vair,-90);
  527.   x11=w-x6; pos11(vair,-90); y11=y6;
  528.   pos12(cap_stem,0); pos13(cap_curve,0); pos14(vair,-90); pos15(hair,180);
  529.   lft x0r=lft x8r=hround(w-3.5u-.5cap_curve); x12r=x13r=w-x8r;
  530.   y8=y13=1/3[y4,y7]; y0=y12=3/6[y4,y7]; x9=.5[x8l,x10r]; x14=w-x9;
  531.   bot y9r=-o; y14=y9; rt x10r=hround(w-.05u); x15=w-x10; y10=y15=1/4[y4,y7];
  532.   filldraw stroke
  533.     z15e{down}..{right}z14e....z13e---z12e..{right}z11e--z6e{right}..z0e---z8e
  534.     ....z9e{right}..{up}z10e;
  535.  dish_serif(4,3,c,1/3,.75cap_jut,d,1/3,.75cap_jut); 
  536. else:
  537.   penpos9(cap_stem,0); penpos14(cap_stem,180); x9r=hround(w-.5u); x14=w-x9;
  538.   y9=y14=0; penpos10(cap_stem,0); penpos15(cap_stem,180); penpos13(cap_stem,90);
  539.   top y13r=.52h; x13=x4; x10=x13+.2w; y10=y15=.8y13; x15=w-x10;
  540.   fill z13l{right}...{z9l-z10l}z10l--diag_end(10l,9l,.5,1,9r,10r)--z10r{z10r-z9r}...{left}z13r--cycle;
  541.   fill z13l{left}...{z14l-z15l}z15l--diag_end(15l,14l,.5,1,14r,15r)--z15r{z15r-z14r}...{right}z13r--cycle;
  542. fi
  543. x20=x1r; x21=x2l; top y20r=top y21r=h; pos20(slab,90); pos21(slab,90);
  544. filldraw stroke z20e--z21e;
  545. endchar;
  546.