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

  1. %% @metafontfile{
  2. %%     filename="cyrpunc.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="782",
  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. % cyrpunc punctuation and digits for cyrillic
  32.  
  33. cmchar "Exclamation point";
  34. beginchar("!",5u#+width_adj#,asc_height#,0);
  35. italcorr asc_height#*slant-2u#-.5width_adj#+.5dot_size#;
  36. adjust_fit(0,0);
  37. pickup tiny.nib; pos3(dot_size,0); pos4(dot_size,90);
  38. lft x3l=hround(.5w-.5dot_size); bot y4l=0; z3=z4; dot(3,4);  % dot
  39. numeric bot_width;
  40. bot_width=if hefty:max(hround .8dot_size,fine.breadth) else: hair fi;
  41. pickup fine.nib; pos1(dot_size,0); pos2(bot_width,0);
  42. x1=x2=x3; bot y2=.25[top y4r,x_height]+1;
  43. if square_dots: top y1=h;
  44.  filldraw stroke z1e--z2e;  % stem
  45. else: top z0=(x1,h+o); y1+.5dot_size=h+o;
  46.  filldraw z1r...z0...z1l---z2l--z2r---cycle; fi  % stem and bulb
  47. penlabels(0,1,2,3,4); endchar;
  48.  
  49. cmchar "Per cent sign";
  50. beginchar("%",9u#+max(6u#,2fudge*(hair#+stem#)),
  51.   body_height#,body_height#-asc_height#);
  52. italcorr if hefty: .4asc_height#*slant-.5u# else: h#*slant-u# fi;
  53. adjust_fit(0,0); pickup fine.nib;
  54. numeric left_curve,right_curve;
  55. left_curve=hround 5/6[fudged.hair,fudged.stem];
  56. right_curve=max(fine.breadth,hround(fudged.hair if hefty:-2stem_corr fi));
  57. pos1(vair,90); pos2(left_curve,180); pos3(vair,270); pos4(right_curve,360);
  58. top y1r=h; lft x2r=hround u; rt x4r=hround(.5w-1.5u);
  59. bot y3r=floor(if monospace: .7 else: .5 fi\\ asc_height);
  60. x1=x3=.5[x2,x4]; y2=y4=.5[y1,y3];
  61. filldraw stroke pulled_super_arc.e(1,2)(superpull)
  62.  & pulled_super_arc.e(2,3)(superpull);  % left half of upper bowl
  63. filldraw stroke super_arc.e(3,4) & super_arc.e(4,1); % right half of upper bowl
  64. pos5(vair,90); pos6(left_curve,180); pos7(vair,270); pos8(right_curve,360);
  65. bot y7r=-d; rt x8r=hround(w-u); lft x6r=hround(.5w+1.5u);
  66. top y5r=vround(if monospace: .3 else: .5 fi\\ asc_height);
  67. x5=x7=.5[x6,x8]; y6=y8=.5[y5,y7];
  68. filldraw stroke pulled_super_arc.e(5,6)(superpull)
  69.  & pulled_super_arc.e(6,7)(superpull);  % left half of lower bowl
  70. filldraw stroke super_arc.e(7,8) & super_arc.e(8,5); % right half of lower bowl
  71. pickup rule.nib; top y9=h; bot y10=-d;
  72. if hefty: x9=good.x(x5-eps); x10=good.x(x1+eps);
  73.  draw z9--z10;  % diagonal
  74. else: rt x9=hround(w-2.5u); lft x10=hround 2.5u; draw z9--z10;  % diagonal
  75.  pickup fine.nib; pos9(rule_thickness,angle(z9-z10)+90);
  76.  pos11(vair,angle(z1r-z4r)-90); pos12(vair,angle(z9-z10)+90);
  77.  path p; p=super_arc.r(1,4); z11r=point 2/3 of p; z12r=z9r;
  78.  filldraw stroke z11e{direction 2/3 of p}...{z9-z10}z12e; fi  % link
  79. penlabels(1,2,3,4,5,6,7,8,9,10,11,12); endchar;
  80.  
  81. cmchar "Apostrophe";
  82. beginchar("'",5u#,asc_height#,0);
  83. italcorr asc_height#*slant+.5dot_size#-2u#;
  84. adjust_fit(0,0);
  85. x1-.5dot_size=hround(.5w-.5dot_size); y1+.5dot_size=h;
  86. if monospace: comma(1,a,dot_size,.28u,vround 1.5comma_depth);  % large comma
  87. else: comma(1,a,dot_size,.25u,comma_depth); fi  % comma with increased jut
  88. penlabels(1); endchar;
  89.  
  90. cmchar "Left parenthesis";
  91. beginchar("(",7u# if monospace: -u# fi,body_height#,paren_depth#);
  92. italcorr body_height#*slant-.5u#;
  93. adjust_fit(0,0); pickup fine.nib;
  94. pos1(vair,0); pos2(.75[hair,stem],0); pos3(vair,0);
  95. rt x1r=rt x3r=hround(w-u); lft x2l=hround(x1-4u if monospace: +4/3u fi);
  96. top y1=h; y2=.5[y1,y3]=math_axis;
  97. filldraw stroke z1e{3(x2e-x1e),y2-y1}...z2e
  98.  ...{3(x3e-x2e),y3-y2}z3e;  % arc
  99. penlabels(1,2,3); endchar;
  100.  
  101. cmchar "Right parenthesis";
  102. beginchar(")",7u# if monospace: -u# fi,body_height#,paren_depth#);
  103. italcorr math_axis#*slant-.5u#;
  104. adjust_fit(0,0); pickup fine.nib;
  105. pos1(vair,0); pos2(.75[hair,stem],0); pos3(vair,0);
  106. lft x1l=lft x3l=hround u; rt x2r=hround(x1+4u if monospace: -4/3u fi);
  107. top y1=h; y2=.5[y1,y3]=math_axis;
  108. filldraw stroke z1e{3(x2e-x1e),y2-y1}...z2e
  109.  ...{3(x3e-x2e),y3-y2}z3e;  % arc
  110. penlabels(1,2,3); endchar;
  111.  
  112. cmchar "Asterisk";
  113. beginchar("*",9u#,
  114.   if low_asterisk:math_axis#+.5x_height# else: body_height# fi,0);
  115. italcorr h#*slant-.75u#;
  116. adjust_fit(0,0);
  117. numeric ast_flare; ast_flare=hround .7[thin_join,stem];
  118. x0=.5w; y0=h-.5x_height;
  119. for d=-150 step 60 until 150: z[d]=z0+.5dir d xscaled 7.5u yscaled x_height;
  120.  numeric theta; theta=angle(z[d]-z0);
  121.  fill z0+.5(0,-thin_join)rotated theta
  122.   ---z[d]+.5(-ast_flare,-ast_flare)rotated theta
  123.   ..z[d]..z[d]+.5(-ast_flare,ast_flare)rotated theta
  124.   ---z0+.5(0,thin_join)rotated theta--cycle; endfor  % diagonal at angle |d|
  125. labels(0,[-150],[-90],[-30],30,90,150); endchar;
  126.  
  127. cmchar "Comma";
  128. numeric dot_diam#; dot_diam#=if monospace: 5/4 fi\\ dot_size#;
  129. define_whole_blacker_pixels(dot_diam);
  130. beginchar(",",5u#,dot_diam#,comma_depth#);
  131. adjust_fit(0,0);
  132. x1-.5dot_diam=hround(.5w-.5dot_diam); y1-.5dot_diam=0;
  133. comma(1,a,dot_diam,.2u,comma_depth);  % dot and tail
  134. penlabels(1); endchar;
  135.  
  136. cmchar "Hyphen";
  137. beginchar("-",6u#,x_height#,0);
  138. italcorr .5x_height#*slant-.5u#;
  139. adjust_fit(0,0);
  140. numeric thickness; thickness=if hefty:bar else:.75[hair,stem] fi;
  141. pickup crisp.nib; pos1(thickness,90); pos2(thickness,90);
  142. top y1r=top y2r=vround(.5h+.5thickness); rt x2=hround(w-u)+eps;
  143. if monospace: x2=w-x1 else: lft x1=hround .2u-eps fi;
  144. filldraw stroke z1e--z2e;  % bar
  145. penlabels(1,2); endchar;
  146.  
  147. cmchar "Period";
  148. numeric dot_diam#; dot_diam#=if monospace: 5/4 fi\\ dot_size#;
  149. define_whole_blacker_pixels(dot_diam);
  150. beginchar(".",5u#,dot_diam#,0);
  151. adjust_fit(0,0); pickup fine.nib;
  152. pos1(dot_diam,0); pos2(dot_diam,90);
  153. lft x1l=hround(.5w-.5dot_diam); bot y2l=0; z1=z2; dot(1,2);  % dot
  154. penlabels(1,2); endchar;
  155.  
  156. cmchar "Virgule (slash)";
  157. beginchar("/",9u#,body_height#,paren_depth#);
  158. italcorr body_height#*slant-.5u#;
  159. adjust_fit(0,0); pickup rule.nib;
  160. rt x1=hround(w-u)+eps; top y1=h+eps;
  161. lft x2=hround u-eps; bot y2=-d-eps;
  162. draw z1--z2;  % diagonal
  163. penlabels(1,2); endchar;
  164.  
  165. cmchar "Colon";
  166. numeric dot_diam#; dot_diam#=if monospace: 5/4 fi\\ dot_size#;
  167. define_whole_blacker_pixels(dot_diam);
  168. beginchar(":",5u#,x_height#,0);
  169. italcorr x_height#*slant+.5dot_diam#-2u#;
  170. adjust_fit(0,0); pickup fine.nib;
  171. pos1(dot_diam,0); pos2(dot_diam,90);
  172. lft x1l=hround(.5w-.5dot_diam); top y2r=h; z1=z2; dot(1,2);  % upper dot
  173. pos3(dot_diam,0); pos4(dot_diam,90);
  174. x3=x1; bot y4l=0; z3=z4; dot(3,4);  % lower dot
  175. penlabels(1,2,3,4); endchar;
  176.  
  177. cmchar "Semicolon";
  178. numeric dot_diam#; dot_diam#=if monospace: 5/4 fi\\ dot_size#;
  179. define_whole_blacker_pixels(dot_diam);
  180. beginchar(";",5u#,x_height#,comma_depth#);
  181. italcorr x_height#*slant+.5dot_diam#-2u#;
  182. adjust_fit(0,0); pickup fine.nib;
  183. pos1(dot_diam,0); pos2(dot_diam,90);
  184. lft x1l=hround(.5w-.5dot_diam); top y2r=h; z1=z2; dot(1,2);  % upper dot
  185. x3-.5dot_diam=hround(.5w-.5dot_diam); y3-.5dot_diam=0;
  186. comma(3,a,dot_diam,.05u,comma_depth);  % lower dot and tail
  187. penlabels(1,2,3); endchar;
  188.  
  189. cmchar "Question mark";
  190. beginchar("?",8.5u#,asc_height#,0);
  191. italcorr .8asc_height#*slant;
  192. adjust_fit(0,0);
  193. pickup tiny.nib; pos7(dot_size,0); pos8(dot_size,90);
  194. lft x7l=hround(.5w-.25u-.5dot_size); bot y8l=0; z7=z8; dot(7,8);  % dot
  195. numeric bot_width;
  196. bot_width=if hefty:max(hround .8dot_size,fine.breadth) else: hair fi;
  197. pickup fine.nib; pos2(vair,90); pos3(curve,0);
  198. pos4(vair,-90); pos5(bot_width,0); pos6(bot_width,0);
  199. x2=x4=x5=x6=x7; rt x3r=hround(w-u); bot y6=1+.25[top y8r,x_height];
  200. top y2r=h+oo; y3=.75[y6,y2]; y4=.5[y6,y2]; y5=.1[y6,y2];
  201. {{interim superness:=more_super;
  202. filldraw stroke pulled_super_arc.e(2,3)(superpull)
  203.  & subpath (0,1) of super_arc.e(3,4) .. z5e---z6e\\}};  % arc and stem
  204. if serifs: pos1(hair,180); pos0(flare,180);
  205.  lft x1r=hround u; y1=y3; bulb(2,1,0);  % bulb
  206. else: pos1(Vround 5/7[vair,flare],110);
  207.  lft x1r=hround u; top y1r=vround .9[y6,top y2r];
  208.  filldraw stroke term.e(2,1,left,1,4); fi  % terminal
  209. penlabels(0,1,2,3,4,5,6,7,8); endchar;
  210.  
  211. cmchar "Left bracket";
  212. numeric wd#; wd#=max(5u#,4.5u#+.5if hefty:stem# else:rule_thickness# fi);
  213. beginchar("[",wd#,body_height#,paren_depth#);
  214. italcorr body_height#*slant;
  215. adjust_fit(0,0);
  216. numeric top_thickness,side_thickness;
  217. if hefty: top_thickness=vair;
  218.  side_thickness=max(crisp.breadth,stem-2stem_corr);
  219. else: top_thickness=side_thickness=rule_thickness; fi;
  220. pickup crisp.nib; pos1(side_thickness,0); pos2(side_thickness,0);
  221. top y1=h; bot y2=-d; lft x1l=lft x2l=hround(2.5u-.5side_thickness)-1-eps;
  222. filldraw stroke z1e--z2e;  % stem
  223. pos3(top_thickness,90); pos4(top_thickness,90);
  224. pos5(top_thickness,90); pos6(top_thickness,90);
  225. x3=x5=x1l; rt x4=rt x6=ceiling(w-.4u)+eps; y3r=y4r=y1; y5l=y6l=y2;
  226. filldraw stroke z3e--z4e;  % upper bar
  227. filldraw stroke z5e--z6e;  % lower bar
  228. penlabels(1,2,3,4,5,6); endchar;
  229.  
  230. cmchar "Right bracket";
  231. numeric wd#; wd#=max(5u#,4.5u#+.5if hefty:stem# else:rule_thickness# fi);
  232. beginchar("]",wd#,body_height#,paren_depth#);
  233. italcorr body_height#*slant-2u#+.5if hefty:stem# else:rule_thickness# fi;
  234. adjust_fit(0,0);
  235. numeric top_thickness,side_thickness;
  236. if hefty: top_thickness=vair;
  237.  side_thickness=max(crisp.breadth,stem-2stem_corr);
  238. else: top_thickness=side_thickness=rule_thickness; fi;
  239. pickup crisp.nib; pos1(side_thickness,0); pos2(side_thickness,0);
  240. top y1=h; bot y2=-d; rt x1r=rt x2r=hround(w-2.5u+.5side_thickness)+1+eps;
  241. filldraw stroke z1e--z2e;  % stem
  242. pos3(top_thickness,90); pos4(top_thickness,90);
  243. pos5(top_thickness,90); pos6(top_thickness,90);
  244. x3=x5=x1r; lft x4=lft x6=floor .4u-eps; y3r=y4r=y1; y5l=y6l=y2;
  245. filldraw stroke z3e--z4e;  % upper bar
  246. filldraw stroke z5e--z6e;  % lower bar
  247. penlabels(1,2,3,4,5,6); endchar;
  248.  
  249. cmchar "Reverse apostrophe";
  250. beginchar("`",5u#,asc_height#,0);
  251. italcorr asc_height#*slant+.5dot_size#-2u#;
  252. adjust_fit(0,0);
  253. x1-.5dot_size=hround(.5w-.5dot_size); y1+.5dot_size=h-comma_depth;
  254. if monospace: ammoc(1,a,dot_size,.28u,vround 1.5comma_depth);  % large ammoc
  255. else: ammoc(1,a,dot_size,.25u,comma_depth); fi  % normal ammoc
  256. penlabels(1); endchar;
  257.  
  258. cmchar "The numeral 0";
  259. beginchar("0",9u#,fig_height#,0);
  260. italcorr fig_height#*slant-.5u#;
  261. adjust_fit(0,0);
  262. penpos1(vair,90); penpos3(vair,-90); penpos2(curve,180); penpos4(curve,0);
  263. if not monospace: interim superness:=sqrt(more_super*hein_super); fi
  264. x2r=hround max(.7u,1.45u-.5curve); x4r=w-x2r; x1=x3=.5w;
  265. y1r=h+o; y3r=-o; y2=y4=.5h-vair_corr; y2l:=y4l:=.52h;
  266. penstroke pulled_arc.e(1,2) & pulled_arc.e(2,3)
  267.  & pulled_arc.e(3,4) & pulled_arc.e(4,1) & cycle;  % bowl
  268. penlabels(1,2,3,4); endchar;
  269.  
  270. cmchar "The numeral 1";
  271. beginchar("1",9u#,fig_height#,0);
  272. italcorr fig_height#*slant-.5u#;
  273. adjust_fit(0,0);
  274. numeric light_stem; light_stem=hround .4[stem',cap_stem'];
  275. pickup tiny.nib;
  276. pos1(light_stem,0); pos2(light_stem,0);
  277. lft x1l=lft x2l=hround(.5(w+.5u)-.5cap_stem'); top y1=h+o; bot y2=0;
  278. filldraw stroke z1e--z2e;  % stem
  279. if not serifs: save slab; slab=bar; fi
  280. dish_serif(2,1,a,1/3,min(2.25u,lft x2l-1.5u),
  281.   b,1/3,min(2.25u,w-1.25u-rt x2r)); % serif
  282. pickup crisp.nib; pos3(slab,-90); pos4(bar,-90);
  283. top y3l=h+o; top y4l=if monospace: .8 else: .9 fi\\ h+o;
  284. lft x4=max(1.25u,tiny.lft x1l-2.35u);
  285. tiny.rt x1r=lft x3+.25[tiny,hair];
  286. erase fill z3l{x4l-x3l,3(y4l-y3l)}...z4l{left}
  287.  --(x4l,h+o+1)--(x3l,h+o+1)--cycle; % erase excess at top
  288. filldraw stroke z3e{x4e-x3e,3(y4e-y3e)}..z4e{left};  % point
  289. penlabels(1,2,3,4); endchar;
  290.  
  291. cmchar "The numeral 2";
  292. beginchar("2",9u#,fig_height#,0);
  293. italcorr fig_height#*slant-.5u#;
  294. adjust_fit(0,0);
  295. numeric arm_thickness, hair_vair; hair_vair=.25[vair,hair];
  296. arm_thickness=Vround(if hefty:slab+2stem_corr else:.4[stem,cap_stem] fi);
  297. pickup crisp.nib; pos7(arm_thickness,-90); pos8(hair,0);
  298. bot y7r=0; lft x7=hround .9u; rt x8r=hround(w-.9u); y8=good.y(y7l+beak/2)+eps;
  299. arm(7,8,a,.3beak_darkness,beak_jut);  % arm and beak
  300. pickup fine.nib; pos2(slab,90); pos3(.4[curve,cap_curve],0);
  301. top y2r=h+o; x2=.5(w-.5u); rt x3r=hround(w-.9u); y3+.5vair=.75h;
  302. if serifs: numeric bulb_diam; bulb_diam=hround(flare+2/3(cap_stem-stem));
  303.  pos0(bulb_diam,180); pos1(cap_hair,180);
  304.  lft x1r=hround .9u; y1-.5bulb_diam=2/3h;
  305.  (x,y2l)=whatever[z1l,z2r]; x2l:=x; bulb(2,1,0);  % bulb and arc
  306. else: x2l:=x2l-.25u; pos1(flare,angle(-9u,h));
  307.  lft x1r=hround .75u; bot y1l=vround .7h; y1r:=good.y y1r+eps; x1l:=good.x x1l;
  308.  filldraw stroke term.e(2,1,left,.9,4); fi  % terminal and arc
  309. pos4(.25[hair_vair,cap_stem],0);
  310. pos5(hair_vair,0); pos6(hair_vair,0);
  311. y5=arm_thickness; y4=.3[y5,y3]; top y6=min(y5,slab,top y7l);
  312. lft x6l=crisp.lft x7; z4l=whatever[z6l,(x3l,bot .58h)]; z5l=whatever[z6l,z4l];
  313. erase fill z4l--z6l--lft z6l--(lft x6l,y4l)--cycle;  % erase excess at left
  314. filldraw stroke z2e{right}..tension atleast .9 and atleast 1
  315.  ..z3e{down}.. z4e---z5e--z6e;  % stroke
  316. penlabels(0,1,2,3,4,5,6,7,8); endchar;
  317.  
  318. cmchar "The numeral 3";
  319. beginchar("3",9u#,fig_height#,0);
  320. italcorr fig_height#*slant-.5u#;
  321. adjust_fit(0,0);
  322. numeric top_thickness,mid_thickness,bot_thickness;
  323. top_thickness=max(fine.breadth,vround(slab-2vair_corr));
  324. mid_thickness=max(fine.breadth,vround 2/3vair);
  325. bot_thickness=max(fine.breadth,vround(slab-vair_corr));
  326. pickup fine.nib; pos2(top_thickness,90); top y2r=h+o;
  327. pos3(max(fine.breadth,.6[curve,cap_curve]-stem_corr),0);
  328. rt x3r=hround(w-1.25u);
  329. pos4(vair,-90); pos5(vair,-90);
  330. pos6(mid_thickness,90); x2=x6=x8=.5[1.5u,x7];
  331. pos7(cap_curve,0); rt x7r=hround(w-.75u); lft x5=min(hround 3u,lft x6)-eps;
  332. pos8(bot_thickness,-90); bot y8r=-o;
  333. y3=.6[top y4l,bot y2l]; y7=.5[bot y6l,top y8l];
  334. top y5l=vround(.54h+.5vair); y5r=y6l;
  335. x4=1/3[x5,x3l]; z4=z5+whatever*(150u,h);
  336. filldraw stroke pulled_super_arc.e(2,3)(.5superpull)
  337.  & z3e{down}...z4e---z5e;  % upper bowl
  338. filldraw z5r--z6l--z6r--z5l---cycle;  % middle tip
  339. filldraw stroke pulled_super_arc.e(6,7)(.5superpull)
  340.  & pulled_super_arc.e(7,8)(.5superpull);  % lower bowl
  341. if serifs: numeric bulb_diam[];
  342.  bulb_diam1=flare+.5(cap_stem-stem); bulb_diam2=flare+cap_stem-stem;
  343.  pos0(bulb_diam1,180); pos1(hair,180);
  344.  lft x0r=hround 1.25u; y0=min(.9h-.5bulb_diam1,.75h+.5bulb_diam1);
  345.  bulb(2,1,0);  % upper bulb
  346.  pos10(bulb_diam2,-180); pos9(cap_hair,-180);
  347.  lft x10r=hround .75u; y10=max(.1h+.5bulb_diam2,.3h-.5bulb_diam2);
  348.  bulb(8,9,10);  % lower bulb
  349. else: pos1(.5[vair,flare],angle(-8u,h));
  350.  lft x1r=hround u; bot y1l=vround .75h+o;
  351.  y1r:=good.y y1r+eps; x1l:=good.x x1l;
  352.  pos9(bot_thickness,angle(-2u,-h));
  353.  lft x9r=hround .75u; top y9l=vround .25h-o;
  354.  y9r:=good.y y9r-eps; x9l:=good.x x9l;
  355.  filldraw stroke term.e(2,1,left,1,4);  % upper terminal
  356.  filldraw stroke term.e(8,9,left,1,4); fi  % lower terminal
  357. penlabels(0,1,2,3,4,5,6,7,8,9,10); endchar;
  358.  
  359. cmchar "The numeral 4";
  360. beginchar("4",9u#,fig_height#,0);
  361. italcorr fig_height#*slant-.5u#;
  362. adjust_fit(0,0);
  363. numeric light_stem, light_stem', diag_stem, alpha, cut; cut=.75notch_cut;
  364. light_stem=hround .4[fudged.stem,fudged.cap_stem];
  365. light_stem'=hround max(tiny.breadth,light_stem-2stem_corr);
  366. diag_stem=max(tiny.breadth,.4[vair,fudged.hair]);
  367. pickup crisp.nib; pos5(cap_bar,90); pos6(cap_bar,90);
  368. lft x5=hround .5u; rt x6=hround(w-.5u);
  369. top y5r=vround(if serifs: 5/18[slab,h-light_stem]+1
  370.  else:.35(h-light_stem) fi+.5cap_bar);
  371. z4l=top lft z5r; y2=y2'=y5=y6; x1r=x2r=hround(w-3u+.5light_stem);
  372. penpos1(light_stem',0); penpos2(light_stem',0); y1=y3=h+apex_o+apex_oo;
  373. x3r+apex_corr=x1r; alpha=diag_ratio(1,diag_stem,y3-y4l,x3r-x4l);
  374. penpos3(alpha*diag_stem,0); penpos4(alpha*diag_stem,0);
  375. x0=x1l; z0=whatever[z3r,z4r];
  376. x5'=x5; z5''=z5'+penoffset z4-z3 of currentpen=whatever[z4l,z3l];
  377. fill diag_end(2r,1r,1,.5,3l,4l)---z5''...lft z5'
  378.  ---lft z5l -- (x4r,y5l) -- z4r
  379.  if y0<h-cut:{z3r-z4r}...{up}(x1l-1,h-cut)
  380.   --(x1l,h-cut) else: -- z0 fi
  381.  --z2l--z2r--cycle;  % diagonal and upper stem
  382. filldraw stroke z5e--z6e;  % bar
  383. pickup tiny.nib; pos7(light_stem,0); rt x7r=x1r; bot y7=0;
  384. pos2'(light_stem,0); x2'=x7;
  385. filldraw stroke z2'e--z7e;  % lower stem
  386. if serifs: dish_serif(7,2',a,1/3,1.75u,
  387.   b,1/3,min(1.75u,w-.5u-rt x7r)); fi  % serif
  388. penlabels(0,1,2,3,4,5,6,7); endchar;
  389.  
  390. cmchar "The numeral 5";
  391. beginchar("5",9u#,fig_height#,0);
  392. italcorr fig_height#*slant-.5u#;
  393. adjust_fit(0,0);
  394. numeric bot_thickness,light_hair;
  395. bot_thickness=max(fine.breadth,vround(slab-vair_corr));
  396. light_hair=hround(cap_hair if hefty: -\\2stem_corr fi);
  397. pickup tiny.nib; pos5(vair,180); pos6(vair,90);
  398. bot y5=vround(.53h-vair); top y6r=max(vround .61803h+o,top y6r+y5+eps-y6l);
  399. pos3(light_hair,0); pos4(light_hair,0);
  400. lft x3l=max(1.35u,2.1u-.5light_hair); x3=x4=x5; y4=y5;
  401. top y3=h if not hefty: +\\o fi;
  402. filldraw stroke z3e--z4e;  % thin stem
  403. penpos7(cap_stem-fine,0); penpos8(bot_thickness-fine,-90);
  404. fine.rt x7r=hround(w-.9u); x8=.5[u,x7]; x6=.5[x5,x7];
  405. erase fill z5--bot z5--(x6,bot y5)--z6{left}
  406.  ..tension .9 and 1..{x5-x6,3(y5-y6)}cycle; % erase excess in middle
  407. filldraw stroke z6e{left}..tension .9 and 1..{x5-x6,3(y5-y6)}z5e;  % link
  408. pickup fine.nib; pos6'(vair,90); z6'=z6;
  409. y7=.5[y6,y8]; bot y8r=-o;
  410. filldraw stroke pulled_arc.e(6',7) & pulled_arc.e(7,8);  % bowl
  411. if serifs: pos9(hair,-180); y9=.5y5; lft x9r=hround .9u;
  412.  pos10(flare+1/3(cap_stem-stem),-180); bulb(8,9,10);  % bulb
  413. else: pos9(3/7[bot_thickness,flare],angle(-7u,-h));
  414.  lft x9r=hround(tiny.lft x3l-.75u); bot y9r=vround .15h-o;
  415.  x9l:=good.x x9l; y9l:=good.y y9l;
  416.  filldraw stroke term.e(8,9,left,1,4); fi  % terminal
  417. if hefty: pickup crisp.nib; pos1(slab,90); pos2(hair,0);
  418.  top y1r=h; x1=x4; rt x2r=hround(w-1.5u); y2=y1l-eps;
  419.  arm(1,2,a,0,0);  % arm
  420. else: numeric flag_breadth; flag_breadth=7/8[vair,cap_curve];
  421.  pos1(flag_breadth,90); pos2(flag_breadth,60);
  422.  pos0(vair,90); top y1r=tiny.top y3; top y2r=vround .95h+o; y0r=y1r;
  423.  lft x1=tiny.lft x3l; x2r=.5[x1,x0]; rt x0=hround(w-1.6u);
  424.  erase fill top z1r--z1r...{right}z2r
  425.   --(x2r,top y1r)--cycle; % erase excess at top
  426.  filldraw stroke z1e...{right}z2e...z0e; fi  % flag
  427. penlabels(0,1,2,3,4,5,6,7,8,9,10); endchar;
  428.  
  429. cmchar "The numeral 6";
  430. beginchar("6",9u#,fig_height#,0);
  431. italcorr fig_height#*slant-.5u#;
  432. adjust_fit(0,0);
  433. numeric top_thickness,bot_thickness,side_thickness,pull;
  434. top_thickness=max(fine.breadth,vround(slab-2vair_corr));
  435. bot_thickness=max(fine.breadth,vround(slab-vair_corr));
  436. side_thickness=max(fine.breadth,hround 1/3[curve,cap_curve]);
  437. pull=min(.25,1.5superpull);
  438. pickup fine.nib; pos2(top_thickness,-270);
  439. pos3(side_thickness,-180); pos4(bot_thickness,-90);
  440. pos5(side_thickness,0); pos6(vair,90);
  441. lft x3r=w-rt x5r=hround max(.75u,1.5u-.5side_thickness);
  442. x4=x6-.1u=x2-u=.5w;
  443. top y2r=h+o; y3=.5[y2,y4]; bot y4r=-o;
  444. y5=.5[y4,y6]; top y6=vround 5/8h+o;
  445. path p; p=pulled_super_arc.l(3,4)(pull);
  446. numeric t; t=xpart(p intersectiontimes((x3r,y5)--(x4,y5)));
  447. pos7(thin_join,180); z7l=point t of p;
  448. (x,y6r)=whatever[z7l,z6l]; x6r:=min(x,.5[x5r,x6]);
  449. filldraw stroke pulled_super_arc.e(2,3)(pull)
  450.  & {{interim superness:=more_super; pulled_super_arc.e(3,4)(pull)}}
  451.  & {{less_tense; pulled_super_arc.e(4,5)(pull) & pulled_super_arc.e(5,6)(pull)}}
  452.  & z6e{left}...{direction t of p}z7e;  % arc and bowl
  453. if serifs: pos1(hair,-360); pos0(flare,-360);
  454.  rt x0r=max(rt x2+eps,hround(w-1.2u));
  455.  y0=vround min(.9h-.5flare,.85h+.5flare)+o;
  456.  {{less_tense; bulb(2,1,0)}};  % arc and bulb
  457. else: pos1(vround .1[top_thickness,flare],90);
  458.  top y1r=vround .97h+o; rt x1=hround(x5-.5);
  459.  filldraw stroke term.e(2,1,right,.9,4); fi  % terminal
  460. penlabels(0,1,2,3,4,5,6,7); endchar;
  461.  
  462. cmchar "The numeral 7";
  463. beginchar("7",9u#,fig_height#,0);
  464. italcorr fig_height#*slant-.5u#;
  465. adjust_fit(0,0);
  466. numeric arm_thickness, bot_width, top_shift, top_hair;
  467. if hefty: arm_thickness=Vround(slab+2stem_corr); top_shift=0;
  468.  bot_width=hround .51[curve,cap_curve]; top_hair=.4[thin_join,bot_width];
  469. else: arm_thickness=Vround .4[stem,cap_stem]; top_shift=.5u;
  470.  bot_width=flare; top_hair=cap_hair; fi
  471. if top_hair<tiny.breadth: top_hair:=tiny.breadth; fi
  472. pickup crisp.nib; pos2(arm_thickness,90); pos1(hair,180);
  473. top y2r=h; rt x2=hround(w-.75u+top_shift);
  474. lft x1r=hround(.75u+.5top_shift); y1=good.y(y2l-beak/2)-eps;
  475. arm(2,1,a,.3beak_darkness,-beak_jut);  % arm and beak
  476. pos3(hair,180); y3=good.y(y2r+beak/6)+eps; z3r=whatever[z1r,z.a0];
  477. penpos2'(eps,-90); z2'=z2r;
  478. arm(2',3,b,beak_darkness,x3r-x.a0);  % upward extension of beak
  479. pickup tiny.nib; pos4(top_hair,0); pos6(bot_width,0);
  480. bot y4=max(h-arm_thickness,h-slab,bot y2l); rt x4r=crisp.rt x2;
  481. lft x6l=hround(3.5u+top_shift-.5bot_width);
  482. if serifs: y6-.5bot_width=-o; filldraw z6l{down}..{up}z6r--cycle;  % bulb
  483. else: bot y6=-oo; fi
  484. if hefty: erase fill rt z4r--z4r...{down}z6r
  485.   --(rt x4r,y6)--cycle;  % erase excess at top
  486.  filldraw stroke z4e...{down}z6e;  % stroke
  487. else: pos5(top_hair,0); y5=2/3h; z5=whatever[z4,(.75u,y6)];
  488.  erase fill rt z4r--z4r--z5r--(rt x4r,y5)--cycle;  % erase excess at top
  489.  filldraw stroke z4e---z5e...{down}z6e; fi  % stroke
  490. penlabels(1,2,3,4,5,6); endchar;
  491.  
  492. cmchar "The numeral 8";
  493. beginchar("8",9u#,fig_height#,0);
  494. italcorr fig_height#*slant-.5u#;
  495. adjust_fit(0,0);
  496. numeric top_thickness,mid_thickness,bot_thickness,upper_side,lower_side,theta;
  497. top_thickness=max(fine.breadth,vround(slab-2vair_corr));
  498. bot_thickness=max(fine.breadth,vround(slab-vair_corr));
  499. x0=.5w; y0=.54h;
  500. if hefty: mid_thickness=vround 2/3vair; upper_side=hround(stem-3stem_corr);
  501.  lower_side=hround min(.5[curve,cap_curve]-stem_corr,upper_side+.25u);
  502.  penpos1(top_thickness,90); penpos2(upper_side,180);
  503.  penpos3(mid_thickness,270); penpos8(upper_side,360);
  504.  penpos4(mid_thickness,90); penpos7(lower_side,180);
  505.  penpos6(bot_thickness,270); penpos5(lower_side,360);
  506.  penpos0(vair,90); z3l=z0r; z4l=z0l;
  507.  x1=x6=.5w; x2r=w-x8r=hround u; x7r=w-x5r=hround .75u;
  508.  top y1r=h+o; bot y6r=-o; y2=y8=.5[y1l,y3l]; y7=y5=.5[y4l,y6l];
  509.  filldraw stroke pulled_arc.e(1,2)
  510.   & pulled_arc.e(2,3);  % left half of upper bowl
  511.  filldraw stroke pulled_arc.e(4,5)
  512.   & pulled_arc.e(5,6);  % right half of lower bowl
  513.  filldraw stroke pulled_arc.e(6,7)
  514.   & pulled_arc.e(7,4);  % left half of lower bowl
  515.  filldraw stroke pulled_arc.e(3,8)
  516.   & pulled_arc.e(8,1);  % right half of upper bowl
  517. else: pickup fine.nib; theta=90-angle(18u,h); slope:=-h/18u;
  518.  upper_side=max(fine.breadth,hround(.5[hair,stem]-stem_corr));
  519.  lower_side=hround(.5[hair,stem]+stem_corr);
  520.  pos1(top_thickness,-90); pos6(bot_thickness,-90);
  521.  x1=x6=.5w; top y1l=h+o; bot y6r=-o; pos0(cap_stem,theta);
  522.  lft x2l=w-rt x8l=hround 1.25u; lft x7r=w-rt x5r=hround .75u;
  523.  x2r-x2l=upper_side-fine; x5r-x5l=lower_side-fine;
  524.  ellipse_set(1l,2l,3l,0l); ellipse_set(1r,2r,3r,0r);
  525.  ellipse_set(6l,5l,4l,0l); ellipse_set(6r,5r,4r,0r);
  526.  numeric tau; tau=max(.8,.20710678/(superness-.5));
  527.  filldraw stroke z1e{left}..tension atleast tau..z2e{down}
  528.   ..z3e---z4e..z5e{down}..tension atleast tau..z6e{left};  % S stroke
  529.  pos7(lower_side,180); pos8(upper_side,180);
  530.  y7=.5[y5l,y5r]; y8=.5[y2l,y2r]; pos9(vair,90); z9=z0;
  531.  filldraw stroke z1e{right}..tension atleast tau..z8e{down}
  532.   ..tension atleast tau and atleast 1..{-18u,-.618h}z9e; % upper right stroke
  533.  filldraw stroke z6e{left}..tension atleast tau..z7e{up}
  534.   ..tension atleast tau and atleast 1..{18u,.5h}z9e; fi % lower left stroke
  535. penlabels(0,1,2,3,4,5,6,7,8,9); endchar;
  536.  
  537. cmchar "The numeral 9";
  538. beginchar("9",9u#,fig_height#,0);
  539. italcorr fig_height#*slant-.5u#;
  540. adjust_fit(0,0);
  541. numeric top_thickness,bot_thickness,side_thickness,pull;
  542. top_thickness=max(fine.breadth,vround(slab-2vair_corr));
  543. bot_thickness=max(fine.breadth,vround(slab-vair_corr));
  544. side_thickness=max(fine.breadth,hround 1/3[curve,cap_curve]);
  545. pull=min(.25,1.5superpull);
  546. pickup fine.nib; pos2(bot_thickness,-90);
  547. pos3(side_thickness,0); pos4(top_thickness,90);
  548. pos5(side_thickness,180); pos6(vair,270);
  549. w-rt x3r=lft x5r=hround max(.75u,1.5u-.5side_thickness);
  550. x4-.1u=x6+.1u=x2+.75u=.5w;
  551. bot y2r=-o; y3=.5[y2,y4]; top y4r=h+o;
  552. y5=.5[y4,y6]; bot y6=vround 3/8h-o;
  553. path p; p=pulled_super_arc.l(3,4)(pull);
  554. numeric t; t=xpart(p intersectiontimes((x3r,y5)--(x4,y5)));
  555. pos7(thin_join,360); z7l=point t of p;
  556. (x,y6r)=whatever[z7l,z6l]; x6r:=max(x,.5[x5r,x6]);
  557. filldraw stroke pulled_super_arc.e(2,3)(pull)
  558.  & {{interim superness:=more_super; pulled_super_arc.e(3,4)(pull)}}
  559.  & {{less_tense; pulled_super_arc.e(4,5)(pull) & pulled_super_arc.e(5,6)(pull)}}
  560.  & z6e{right}...{direction t of p}z7e;  % arc and bowl
  561. if serifs: pos1(hair,-180); pos0(flare,-180);
  562.  lft x0r=min(lft x2-eps,hround 1.2u);
  563.  y0=vround max(.1h+.5flare,.15h-.5flare)-o;
  564.  {{less_tense; bulb(2,1,0)}};  % arc and bulb
  565. else: pos1(.1[bot_thickness,flare],-120);
  566.  bot y1r=vround .07h-o; lft x1r=hround 1.3u;
  567.  filldraw stroke term.e(2,1,left,.9,4); fi  % terminal
  568. penlabels(0,1,2,3,4,5,6,7); endchar;
  569.  
  570. cmchar "Umlaut (double dot) accent";
  571. numeric dot_diam#,dot_diam;
  572. dot_diam#=max(dot_size#,cap_curve#);
  573. beginchar(oct"040",9u#,min(asc_height#,10/7x_height#+.5dot_diam#),0);
  574. dot_diam=max(tiny.breadth,hround(max(dot_size,cap_curve)-2stem_corr));
  575. italcorr h#*slant+.5dot_diam#-2.25u#;
  576. adjust_fit(0,0);
  577. pickup tiny.nib; pos1(dot_diam,0); pos2(dot_diam,90);
  578. x1=x2=2.75u; top y2r=h+1;
  579. if bot y2l<x_height+o+slab: y2l:=min(y2r-eps,x_height+o+slab+.5tiny); fi
  580. y1=.5[y2l,y2r]; dot(1,2);  % left dot
  581. pos3(dot_diam,0); penpos4(y2r-y2l,90); y3=y4=y1; x3=x4=w-x1;
  582. dot(3,4);  % right dot
  583. penlabels(1,2,3,4); endchar;
  584.  
  585. cmchar "Closing quotes";
  586. beginchar(oct"042",7u#+max(2u#,dot_size#),asc_height#,0);
  587. italcorr asc_height#*slant+dot_size#-4.1u#;
  588. adjust_fit(0,0);
  589. x1-.5dot_size=hround .6u; y2+.5dot_size=h;
  590. x2-x1=hround(1.5u+max(2u,dot_size)); y2=y1;
  591. comma(1,a,dot_size,.25u,comma_depth); % left dot and tail
  592. comma(2,b,dot_size,.25u,comma_depth); % right dot and tail
  593. penlabels(1,2); endchar;
  594.  
  595. cmchar "Cyrillic breve";
  596. beginchar(oct"044",8u#,x_height#+1.75dot_size#,0);
  597. italcorr h#*slant+.5vair#-1.5u#;
  598. adjust_fit(0,0);
  599. pickup crisp.nib; pos1(vair,-180); pos3(vair,0);
  600. top y1=top y3=h; lft x1r=hround(.5u-.5vair); rt x3r=hround(w-.5u+.5vair);
  601. numeric mid_thickness; mid_thickness=vround 1/3[vair,stem];
  602. pos2(mid_thickness,-90); x2=.5w;
  603. bot y2r=vround(x_height+.5dot_size);
  604. filldraw stroke z1e{down}...z2e{right}...{up}z3e;  % stroke
  605. pos11(dot_size,0); pos12(dot_size,90); pos13(dot_size,0); pos14(dot_size,90);
  606. lft x11l=lft x1r; rt x13r=rt x3r; y11=y12=y13=y14=h;
  607. x12=x11; x14=x13; dot(11,12); 
  608. % ngb changes:
  609. if altaccent: % relax
  610. else: dot(13,14); fi
  611. penlabels(1,2,3,11,13); endchar;
  612.  
  613. %cmchar "Cyrillic breve";
  614. %beginchar(oct"044",9u#,min(asc_height#,2x_height#),0);
  615. %italcorr h#*slant+.5vair#-1.5u#;
  616. %adjust_fit(0,0);
  617. %pickup crisp.nib; pos1(vair,-180); pos3(vair,0);
  618. %top y1=top y3=h; lft x1r=hround(.5w-4u-.5vair); rt x3r=hround(.5w+4u+.5vair);
  619. %numeric mid_thickness; mid_thickness=vround 1/3[vair,stem];
  620. %pos2(mid_thickness,-90); x2=.5w;
  621. %bot y2r=vround max(x_height+o+tiny,1/3[x_height,h]+o-.5mid_thickness);
  622. %filldraw stroke z1e{down}...z2e{right}...{up}z3e;  % stroke
  623. %pos11(dot_size,0); pos12(dot_size,90); pos13(dot_size,0); pos14(dot_size,90);
  624. %lft x11l=lft x1r; rt x13r=rt x3r; y11=y12=y13=y14=h;
  625. %x12=x11; x14=x13; dot(11,12); dot(13,14);
  626. %penlabels(1,2,3,11,13); endchar;
  627.  
  628. cmchar "Acute accent";
  629. beginchar(oct"046",9u#,min(asc_height#,2x_height#),0);
  630. italcorr h#*slant-if serifs: 1.5 fi u#;
  631. adjust_fit(0,0);
  632. if serifs: pickup crisp.nib; x1+.5stem=hround(w-2u); x2=2/3[x1,w-x1];
  633.  y1+.5stem=h+eps; y2=max(2/3[h,x_height],x_height+o+hair);
  634.  numeric theta; theta=angle(z2-z1)+90;
  635.  pos1(stem,theta); pos2(hair,theta);
  636.  filldraw circ_stroke z1e--z2e;  % diagonal
  637. else: pickup fine.nib; pos1(stem,0); pos2(vair,0);
  638.  rt x1r=hround(w-1.5u); lft x2l=hround(.5w-.25u-.5vair);
  639.  top y1=h; bot y2=vround 2/3[h,x_height];
  640.  filldraw stroke z1e--z2e; fi  % diagonal
  641. penlabels(1,2); endchar;
  642.  
  643. cmchar "open cyrillic quote (looks like <<)";
  644. beginchar(oct"074",10u#,x_height#,0);
  645. adjust_fit(if monospace:-u#,-u# else: 0,0 fi); pickup rule.nib;
  646. lft x2=hround u-epsilon; x1=x3=.55w;
  647. y1=h; y3=0; y2=.5[y1,y3];
  648. draw z1--z2--z3;  % left diagonals
  649. x4=w-x2; y4=.9[y3,y1]; y6=.1[y3,y1];
  650. x5-x2=x6-x3=x4-x1; y5=y2;
  651. draw z4--z5--z6;  % right diagonals
  652. z2'=z2; x2':=x2-.625rule_thickness;
  653. z5'=z5; x5':=x5+.625rule_thickness;
  654. draw z1--z2'--z3;  % left diagonals
  655. draw z4--z5'--z6;  % right diagonals
  656. labels(1,2,3,4,5,6); endchar;
  657.  
  658. cmchar "close cyrillic quote (looks like >>)";
  659. beginchar(oct"076",10u#,x_height#,0);
  660. adjust_fit(if monospace:-u#,-u# else: 0,0 fi); pickup rule.nib;
  661. %lft x2=.55w; x1=x3=hround u-epsilon;
  662. %y1=.9h; y3=.1h; y2=.5[y1,y3];
  663. %y4=h; y6=0; y5=.5[y4,y6];
  664. %draw z1--z2--z3;  % left diagonals
  665. %x4=w-x2; 
  666. %x5-x2=x6-x3=x4-x1;
  667. %draw z4--z5--z6;  % right diagonals
  668. %z2'=z2; x2':=x2-.625rule_thickness;
  669. %z5'=z5; x5':=x5+.625rule_thickness;
  670. %draw z1--z2'--z3;  % left diagonals
  671. %draw z4--z5'--z6;  % right diagonals
  672. %labels(1,2,3,4,5,6); 
  673. slantswitch;
  674. pickup rule.nib;
  675. lft x2=hround u-epsilon; x1=x3=.55w;
  676. y1=h; y3=0; y2=.5[y1,y3];
  677. draw z1--z2--z3;  % left diagonals
  678. x4=w-x2; y4=.9[y3,y1]; y6=.1[y3,y1];
  679. x5-x2=x6-x3=x4-x1; y5=y2;
  680. draw z4--z5--z6;  % right diagonals
  681. z2'=z2; x2':=x2-.625rule_thickness;
  682. z5'=z5; x5':=x5+.625rule_thickness;
  683. draw z1--z2'--z3;  % left diagonals
  684. draw z4--z5'--z6;  % right diagonals
  685. mirror(.5w);
  686. endchar;
  687.  
  688. cmchar "Breve accent";
  689. beginchar(oct"100",9u#,min(asc_height#,2x_height#),0);
  690. italcorr h#*slant+.5vair#-1.5u#;
  691. adjust_fit(0,0);
  692. pickup crisp.nib; pos1(vair,-180); pos3(vair,0);
  693. top y1=top y3=h; lft x1r=w-rt x3r=hround(2u-.5vair);
  694. numeric mid_thickness; mid_thickness=vround 1/3[vair,stem];
  695. pos2(mid_thickness,-90); x2=.5w;
  696. bot y2r=vround max(x_height+o+tiny,1/3[x_height,h]+o-.5mid_thickness);
  697. filldraw stroke z1e{down}...z2e{right}...{up}z3e;  % stroke
  698. penlabels(1,2,3); endchar;
  699.  
  700. cmchar "Opening quotes";
  701. beginchar(oct"134",7u#+max(2u#,dot_size#),asc_height#,0);
  702. italcorr asc_height#*slant-.1u#;
  703. adjust_fit(0,0);
  704. x2+.5dot_size=hround(w-.6u); y1+.5dot_size=h-comma_depth;
  705. x2-x1=hround(1.5u+max(2u,dot_size)); y2=y1;
  706. ammoc(1,a,dot_size,.25u,comma_depth); % left dot and tail
  707. ammoc(2,b,dot_size,.25u,comma_depth); % right dot and tail
  708. penlabels(1,2); endchar;
  709.  
  710. cmchar "En dash";
  711. beginchar(oct"173",9u#,x_height#,0);
  712. italcorr .61803x_height#*slant+.5u#;
  713. adjust_fit(0,0);
  714. pickup crisp.nib; pos1(vair,90); pos2(vair,90);
  715. top y1r=top y2r=vround(.61803h+.5vair); lft x1=-eps; rt x2=w+eps;
  716. filldraw stroke z1e--z2e;  % bar
  717. penlabels(1,2); endchar;
  718.  
  719. cmchar "Em dash";
  720. beginchar(oct"174",18u#,x_height#,0);
  721. italcorr .61803x_height#*slant+.5u#;
  722. adjust_fit(letter_fit#,letter_fit#);
  723. pickup crisp.nib; pos1(vair,90); pos2(vair,90);
  724. top y1r=top y2r=vround(.61803h+.5vair); lft x1=-eps; rt x2=w+eps;
  725. filldraw stroke z1e--z2e;  % bar
  726. penlabels(1,2); endchar;
  727.  
  728. cmchar "The symbol No.";
  729. beginchar(oct"175",15u#+width_adj#,cap_height#,0);
  730. italcorr cap_height#*slant-cap_serif_fit#+cap_jut#-2.5u#+min(.5cap_stem#,u#);
  731. adjust_fit(cap_serif_fit#,cap_serif_fit#); w:=if serifs: 10u else: 11u fi;
  732. numeric thin_stem; thin_stem=hround(fudged.hair+stem_corr);
  733. pickup tiny.nib; pos1(thin_stem,0); pos2(thin_stem,0);
  734. pos3(thin_stem,0); pos4(thin_stem,0);
  735. pickup tiny.nib; top y1=h; 
  736. if serifs: top y3=.79h; bot y2=.21h; else: top y3=h; bot y2=0; fi
  737. bot y4=0;
  738. x1=x2; x3=x4; x1l=w-x3r;
  739. rt x3r=hround min(w-2u,w-3u+.5fudged.cap_stem);
  740. x91=x2-.75flare; bot y91r=-oo; x92=w-x91; top y92l=h+oo;
  741. pos91(thin_stem,-90); pos92(thin_stem,-90);
  742. if serifs: filldraw stroke z1e--z2e & pulled_arc.e(2,91); % left stem
  743.   filldraw stroke z4e--z3e & pulled_arc.e(3,92); % right stem
  744.   else: filldraw stroke z1e--z2e; filldraw stroke z4e--z3e;
  745. fi
  746. if hefty: penpos5(fudged.cap_stem,0); penpos6(fudged.cap_stem,0);
  747.  x5l=x1; x6r=x4; y5=h; y6=0;
  748.  numeric upper_notch,lower_notch;
  749.  upper_notch=h-cap_notch_cut; lower_notch=cap_notch_cut;
  750.  x1'=rt x1r; z1'=whatever[z5l,z6l]; x4'=lft x4l; z4'=whatever[z5r,z6r];
  751.  fill z5l..
  752.   if y1'<upper_notch: {right}(x1'+1,upper_notch){down}... fi
  753.   {z6-z5}diag_in(5l,6l,1,6r)--z6r..
  754.   if y4'>lower_notch: {left}(x4'-1,lower_notch){up}... fi
  755.   {z5-z6}diag_in(6r,5r,1,5l)--cycle;  % diagonal
  756. else: penpos5(whatever,0); penpos6(whatever,90);
  757.  z5l=z1l; z6l=z4l;
  758.  z7=z6l+(max(eps,cap_stem-3stem_corr-tiny),0) rotated (angle(z5l-z6l)-90);
  759.  z5r=z7+whatever*(z5l-z6l); z6r=z7+whatever*(z5l-z6l);
  760.  filldraw stroke z5e..z6e; fi  % diagonal
  761. if serifs: if hefty: serif(1,2,a,1/3,-cap_jut); % upper left serif
  762.  else: serif(5,6,a,1/3,-cap_jut); fi  % upper left serif
  763. fi
  764. pickup tiny.nib;
  765. if serifs:
  766.   x93=x2-1.5flare; y93=.75flare; pos95(flare+(cap_stem-stem),-180);
  767.   x94=x3+1.5flare; y94=h-y93; pos96(flare+(cap_stem-stem),0);
  768.   pos92'(thin_stem,90); z92'=z92;
  769.   pos93(cap_hair,-180); pos94(cap_hair,0); bulb(91,93,95); bulb(92',94,96);
  770. fi
  771. w:=15u;
  772. penpos71(vair,90); penpos73(vair',-90);
  773. penpos72(.8curve,180); penpos74(.8curve,0);
  774. x72r=hround max(.5u,1.25u-.4curve)+9.5u;
  775. x74r=w-x72r+9u; x71=x73=12u; y71r=h-3u+vround 1.5oo; y73r=x_height-3u-oo;
  776. y72=y74=.5[h,x_height]-3u-vair_corr; y72l:=y74l:=.52[h,x_height]-3u;
  777. penstroke pulled_arc.e(71,72) & pulled_arc.e(72,73)
  778.  & pulled_arc.e(73,74) & pulled_arc.e(74,71) & cycle;  % bowl
  779. x81=lft x72r; x82=rt x74r; y81=y82=.8x_height-3u; pos81(bar,90); pos82(bar,90);
  780. filldraw stroke z81e--z82e;
  781. math_fit(0,max(.5ic#-.5u#,0)); penlabels(1,1',2,3,4,4',5,6,7); endchar;
  782.