% % lgt2upu.mf % %% Cyrillic font container with T2 encoding beta-support % % This file is future part of lxfonts package % Version 3.4 // Patchlevel=0 % (c) O.Lapko % % This package belongs to the public domain under conditions similar to % those of D. E. Knuth specified for the Computer Modern family of fonts. % In particular, only the authors are entitled to modify this file % and to save it under the same name. % % Content: % % Uppercase Cyrillic letters 128--255 for T2 encoding % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % List of letternames and their codes in T2 % % X2 T2A T2B T2C % % G_hcrs "81 "81 - - Ghe horisontally crossed % G_dsc "82 - "82 - Ghe with descender % G_tl "83 - "83 - Ghe tail % SHHA "84 "84 "84 "84 Shha (same as lower h) % ZH_dsc "85 "85 "85 - Zhe with descender % Z_dsc "86 "86 - - Ze with descender (cedilla) % ABH_DZE "87 - "87 "87 Abkhasian dze % K_dsc "89 "89 "89 "89 Ka with descender % K_beak "8a "8a - - Ka with reversed beak % K_tl "8b - "8b - Ka with tail % L_tl "8c - "8c - El with tail % N_dsc "8d "8d "8d "8d En with descender % N_tl "8f - "8f "8f En with tail % S_dsc "91 "91 - - Es with descender (cedilla) % Y "93 "93 "93 - Straingt u (as upper Y) % Y_hcrs "94 "94 - - Straingt u horisontally crossed % H_dsc "95 "95 "95 "95 Kha with descender % H_tl "96 - "96 - Kha with tail % CH_ldsc "97 - "97 - Che with left descender % CH_rdsc "98 "98 "98 "98 Che with right descender % SCHWA "9a "9a "9a "9a Schwa % LHver_check(3,4); % like |version_check| in ec lhchar "Uppercase Cyrillic letter G_hcrs - GHE hcrossed"; cyrchar(G_hcrs,if monospace: 9u# else: 11u# fi-width_adj#, %G_width cap_height#,0); if is_small_cap: getcharcode(g_hcrs); fi italcorr cap_height#*slant-beak_jut#-.25u#; adjust_fit(cap_serif_fit#,0); % upper_g pickup tiny.nib; pos1(cap_stem,0); pos2(cap_stem,0); lft x1l=lft x2l=hround max(2u ,3u-.5cap_stem); top y1=h; bot y2=0; filldraw stroke z1e--z2e; % stem pickup crisp.nib; pos3(slab,90); pos4(hair,0); top y3r=h; x3=x1; rt x4r=hround(w-.75u); y4=good.y(y3l-beak)-eps; arm(3,4,e,beak_darkness,beak_jut); % upper arm and beak if serifs: nodish_serif(1,2,a,1/3,cap_jut,b,1/3,.5cap_jut); % upper serif dish_serif(2,1,c,1/3,cap_jut,d,1/3,1.25cap_jut); fi % lower serif %%%%% % hcross pickup crisp.nib; numeric outer_jut; outer_jut=if serifs: max(limit_dist,1.1cap_jut) else: 1.8u fi; pos5(bar,90); pos6(bar,90); top y6r=top y5r=vround (.52h+.5bar)+eps; x6=tiny.rt x1r+1.15outer_jut; x5=hround1/3u-cap_serif_fit; filldraw stroke z5e--z6e; penlabels(0,1,2,3,4,5,6); endchar; lhchar "Uppercase Cyrillic letter G_dsc - GHE descender"; cyrchar(G_dsc,if monospace: 9u# else: 11u# fi-width_adj#, %G_width cap_height#,if is_ogonek: desc_depth# else: cap_sbeak# fi); %udesc/og_depth if is_small_cap: getcharcode(g_dsc); fi italcorr cap_height#*slant-beak_jut#-.25u#; adjust_fit(cap_serif_fit#,0); % upper_g pickup tiny.nib; pos1(cap_stem,0); pos2(cap_stem,0); lft x1l=lft x2l=hround max(2u ,3u-.5cap_stem); top y1=h; bot y2=0; filldraw stroke z1e--z2e; % stem pickup crisp.nib; pos3(slab,90); pos4(hair,0); top y3r=h; x3=x1; rt x4r=hround(w-.75u); y4=good.y(y3l-beak)-eps; arm(3,4,e,beak_darkness,beak_jut); % upper arm and beak %%% if serifs: nodish_serif(1,2,a,1/3,cap_jut,b,1/3,.5cap_jut); % upper serif if is_ogonek: dish_serif(2,1,c,1/3,cap_jut,d,1/3,1.25cap_jut); fi %!!! % lower serif fi %%%%% % uppercase descender/ogonek if is_ogonek: def the_pen=if known ogonek_pen: ogonek_pen elseif serifs: tiny elseif is_bold: fisp else: fine fi enddef; % |diag_end| refers to |tiny| pen, hence |tiny| in the following equation: ogonek_pos=(x2 if not serifs: l if is_bold: +.75tiny fi\\ fi,.5the_pen) if serifs and not is_egyptian: +(.5xvair,0) fi; easy_ogonek(the_pen,5,6,7); % ogonek else: numeric right_jut; right_jut=if serifs: 1.414cap_jut else: .5cap_stem+.5u fi; if not serifs: numeric arm_thickness; arm_thickness=vround(slab-vair_corr); save slab; slab:=arm_thickness; fi % bottom.desc.slab r_serif(2,1,x,1/3,cap_jut,y,1/3,beak_darkness,right_jut,beak_jut); % lower right descender fi penlabels(0,1,2,3,4, 5,6,7); endchar; lhchar "Uppercase Cyrillic letter G_tl - GHE tail"; cyrchar(G_tl,12.5u#+width_adj#, %V_width+width_adj cap_height#,desc_depth#); if is_small_cap: getcharcode(g_tl); fi italcorr .75cap_height#*slant-.5u#; %B adjust_fit(cap_serif_fit#,0); full_w:=w; w:=11u;%G_width % upper_g pickup tiny.nib; pos1(cap_stem,0); pos2(cap_stem,0); lft x1l=lft x2l=hround max(2u ,3u-.5cap_stem); top y1=h; bot y2=0; filldraw stroke z1e--z2e; % stem pickup crisp.nib; pos3(slab,90); pos4(hair,0); top y3r=h; x3=x1; rt x4r=hround(w-.75u); y4=good.y(y3l-beak)-eps; arm(3,4,e,beak_darkness,beak_jut); % upper arm and beak if serifs: nodish_serif(1,2,a,1/3,cap_jut,b,1/3,.5cap_jut); % upper serif dish_serif(2,1,c,1/3,cap_jut,d,1/3,1.25cap_jut); fi % lower serif %%%%% pickup tiny.nib; w:=full_w; % Tail_part(2); _zero:=2; _one:=5; _two:=6; _three:=7; _four:=8; _five:=9; _six:=10; _seven:=11; _eight:=12; % pickup tiny.nib; numeric bulb_diam; bulb_diam=max(currentbreadth+eps,min(.82d-1-eps,flare+(cap_stem-stem))); penpos[_one](vair,90); penpos[_two](vair,90); penpos[_three](cap_curve if hefty:-3stem_corr fi,0); y[_three]=.5[y[_one],-d]; x[_two]=max(.5w-.25u,w-7u); x[_one]=x[_zero]; x[_three]r=hround(w-u); x[_two]l:=x[_two]-.25cap_curve; y[_one]=y[_two]=.52h; {{interim superness:=more_super; fill stroke super_arc.e([_three],[_two])..z[_one]e}}; % lobe if serifs: z[_four]=z[_three]; pos[_four](cap_curve if hefty:-3stem_corr fi,0); pos[_five](vair',-90); bot y[_five]r=-d-oo; y[_six]-.5flare=-.85d; pos[_six](cap_hair,-180); pos[_seven](bulb_diam,-180); rt x[_seven]l=max(lft x[_zero]l-jut+bulb_diam, floor x[_three]-3.5u if monospace: / expansion_factor fi); z[_six]r=z[_seven]r; x[_five]=max(rt x[_seven]l,.6[x[_four],x[_seven]r]); (x,y[_five]r)=whatever[z[_five]l,z[_four]l]; x[_five]r:=max(x,.5[x[_six]r,x[_five]]); filldraw stroke super_arc.e([_four],[_five]); bulb([_five],[_six],[_seven]); % bulb else: pickup fine.nib; z[_four]=z[_three]; pos[_four](max(fine.breadth,cap_curve if hefty:-3stem_corr fi),0); pos[_eight](vair,-90); pos[_five](flare,-105); rt x[_five]r=x[_three]-6u; bot y[_five]r=-d; y[_five]l:=good.y y[_five]l; x[_five]l:=good.y x[_five]l; bot y[_eight]r=-d-o; x[_eight]=.35[lft x[_five]r,x[_three]r]; filldraw stroke super_arc.e([_four],[_eight]) & term.e([_eight],[_five],left,.75,4); fi %%% penlabels(0,1,2,3,4,5,6,7,8,9,10,11,12); endchar; lhchar "Uppercase Cyrillic letter SHHA (as lower h)"; cyrchar(SHHA,13.5u#,cap_height#,0); %CH width if is_small_cap: getcharcode(shha); fi italcorr cap_height#*slant-.25u#; adjust_fit(cap_serif_fit#,cap_serif_fit#); pickup tiny.nib; pos1(cap_stem,0); pos2(cap_stem,0); lft x1l=lft x2l=hround max(2u,3u-.5cap_stem); top y1=h; bot y2=0; filldraw stroke z1e--z2e; % stem pos3(cap_stem,0); x3=w-x1; save thin_join; thin_join=cap_hair; full_x:=x_height; x_height:=1.15x_height; h_stroke(2,g,3,4); x_height:=full_x; % arch and right stem if serifs: dish_serif(1,2,a,1/3,cap_jut,b,1/3,cap_jut); % upper right serif numeric inner_jut; pickup tiny.nib; if rt x2r+jut+.5u+1<=lft x4l-cap_jut: inner_jut=cap_jut; else: rt x2r+jut+.5u+1=lft x4l-inner_jut; fi dish_serif(2,1,c,1/3,cap_jut,d,1/3,inner_jut); % lower right serif dish_serif(4,3,e,1/3,inner_jut,f,1/3,cap_jut); fi % lower left serif penlabels(1,2,3,4); endchar; iff not specific:% lhchar "Uppercase Cyrillic letter ZH_dsc - ZHE descender (`roman')"; cyrchar(ZH_dsc,13.5u#,cap_height#, % N_width if is_ogonek: desc_depth# else: cap_sbeak# fi); %udesc/og_depth if is_small_cap: getcharcode(zh_dsc); fi italcorr cap_height#*slant-.5u#; %K adjust_fit(w#-2max(2u#+.5fudged.cap_stem#,3u#)+cap_serif_fit#,cap_serif_fit#); %ZHr_adj % upperr_zh; if odd((r-l)-fudged.cap_stem): change_width; fi % symmetric & all three equal pickup tiny.nib; pos1(fudged.cap_stem,0); pos2(fudged.cap_stem,0); lft x1l=lft x2l=hround (.5[l,r]-.5fudged.cap_stem)-eps; % middle stem point top y1=h; bot y2=0; filldraw stroke z1e--z2e; % stem if serifs: dish_serif(1,2,a,1/3,cap_jut,b,1/3,cap_jut); % upper stem serif dish_serif(2,1,c,1/3,cap_jut,d,1/3,cap_jut); fi % lower stem serif % K_rbowl;zh%mono:+.75u numeric right_jut,stem[],alpha[]; pickup tiny.nib; right_jut=if serifs:.6cap_jut else:.4tiny fi; stem1=max(tiny.breadth,fudged.hair if hefty:-3stem_corr fi); stem2=max(tiny.breadth,fudged.cap_stem-3stem_corr); rt x3r=hround(r-letter_fit-u-right_jut if monospace:+.75u fi); %!!! rt x6r=hround(r-letter_fit-.75u-right_jut if monospace:+.75u fi); %!!! y4=1/3h; top y3=h; bot y6=0; x4=x1; penpos3(alpha1*(stem1-tiny),0); penpos4(whatever,-90); alpha1=diag_ratio(1,.5(stem1-tiny),y3-y4,x3r-x4); penpos6(alpha2*(stem2-tiny),0); alpha2=diag_ratio(1,.5(stem2-tiny),y1-y6,x6r-x1); forsuffixes $=l,r: y3'$=h; y6'$=0; z4.$=z3'$+whatever*(z3-z4); z5.$=z6'$+whatever*(z1-z6)=whatever[z3,z4]; endfor z5=.5[z5l,z5r]; z3'r=z3r+penoffset z3-z4 of currentpen+whatever*(z3-z4); % we have also |z3'l=z3l+penoffset z4-z3 of currentpen+whatever*(z3-z4)|;\] z6'r=z6r+penoffset z1-z6 of currentpen+whatever*(z1-z6); z6'l=z6l+penoffset z6-z1 of currentpen+whatever*(z1-z6); fill z4r--diag_end(4r,3'r,1,.5,3'l,4l)--z4l--cycle; % upper diagonal fill z5l--diag_end(5l,6'l,.5,1,6'r,5r)--z5r--cycle; % lower diagonal numeric inner_jut,up_inner_jut; %%% if serifs: if rt x2r+cap_jut+.5u+1<=lft x6l-cap_jut: inner_jut=cap_jut; else: rt x2r+cap_jut+.5u+1=lft x6l-inner_jut; fi if rt x1r+cap_jut+.5u+1<=lft x3l-1.2cap_jut: up_inner_jut=1.2cap_jut; else: rt x1r+cap_jut+.5u+1=lft x3l-up_inner_jut; fi dish_serif(3,4,e,2/3,up_inner_jut,f,1/2,right_jut)(dark); % upper diagonal serif if is_ogonek: dish_serif(6,5,g,1/2,inner_jut,h,1/3,right_jut)(dark); fi %!!! % lower diagonal serif fi %%% % mirror forsuffixes $ = 3r,3,3l,3'r,3'l,4r,4,4l,5l,5,5r,6l,6,6r,6'l,6'r: x.m$=l+(r-x$); y.m$=y$; endfor; fill z.m4r--diag_end(.m4r,.m3'r,1,.5,.m3'l,.m4l)--z.m4l--cycle; % upper diagonal fill z.m5l--diag_end(.m5l,.m6'l,.5,1,.m6'r,.m5r)--z.m5r--cycle; % lower diagonal %% if serifs: penpos7(alpha1*(stem1-tiny),0); penpos8(whatever,-90); penpos10(alpha2*(stem2-tiny),0); z7=z.m3; z8=z.m4; z9l=z.m5r; z9=z.m5; z9r=z.m5l; z10=z.m6; dish_serif(7,8,i,1/2,right_jut,j,2/3,up_inner_jut)(dark); % upper diagonal serif dish_serif(10,9,k,1/3,right_jut,l,1/2,inner_jut)(dark); fi % lower diagonal serif %%%%% % uppercase descender/ogonek if is_ogonek: def the_pen=if known ogonek_pen: ogonek_pen elseif serifs: tiny elseif is_bold: fisp else: fine fi enddef; % |diag_end| refers to |tiny| pen, hence |tiny| in the following equation: ogonek_pos=(x6 if not serifs: l if is_bold: +.75tiny fi\\ fi,.5the_pen) if serifs and not is_egyptian: +(.5xvair,0) fi; easy_ogonek(the_pen,11,12,13); % ogonek else: if not serifs: right_jut:=max(right_jut,hround (r-rt x6r-.65u)); fi r_serif(6,1,x,1/3,jut,y,1/3,beak_darkness,right_jut,beak_jut); % lower right descender fi penlabels(1,2,3,4,5,6,7,8,9,10, 11,12,13); endchar; lhchar "Uppercase Cyrillic letter Z_dsc - ZE descender (cedilla)"; cyrchar(Z_dsc,11u#,cap_height#,desc_depth#); if is_small_cap: getcharcode(z_dsc); fi italcorr .75cap_height#*slant-.5u#; %B adjust_fit(if monospace: .35u#,.25u# else: 0,0 fi); % upper_z; pickup fine.nib; numeric right_curve,middle_weight; middle_weight=max(fine.breadth,.6vair+.5); pos2(cap_band,90); pos8(cap_band,-90); if serifs: right_curve=cap_curve-stem_corr; pos1(cap_hair,180); pos9(cap_hair,-180); y1=.4[y5l,y2l]; else: right_curve=cap_curve-3stem_corr; pos1(1.1flare,120); pos9(flare,-120); top y1r=vround 7/8h+o; bot y9r=vround 1/7h-o; fi pos4(middle_weight,-90); pos5(middle_weight,-90); pos6(middle_weight,90); pos5'(middle_weight,90); pos3(max(fine.breadth,right_curve-stem_corr),0); pos7(max(fine.breadth,right_curve),0); top y2r=h+o; bot y8r=-o; x2=x6=x8=.5[1.5u,x7]; rt x7r=hround(w-.75u); rt x3r=hround(w-1.25u); lft x5=lft x5'=min(hround 3.5u,lft x6)+eps; y3=.5[y4l,y2l]; y7=.5[y6l,y8l]; x4=1/3[x5,x3l]; y4=y5; y5'=y6; lft x1r=hround 1.1u; lft x9r=hround.9u; top y5l-bot y5'l=vair; .5[y5l,y5'l]=.52h; if serifs: y9=max(.52[top y8l,bot y5'l],y7+1); else: y9l:=good.y y9l; x9l:=good.x x9l; fi filldraw stroke {{if not serifs:interim superness:=hein_super; fi super_arc.e(2,3)}} & super_arc.e(3,4)..z5e; % upper bowl filldraw stroke z5'e..super_arc.e(6,7) & super_arc.e(7,8); % lower bowl if serifs: filldraw stroke z1e{x2-x1,15(y2-y1)}....{right}z2e; % upper arc filldraw stroke {{interim superness:=more_super; super_arc.e(8,9)}}; % lower arc else: filldraw stroke rterm.e(2,1,left,.9,4); % upper arc filldraw stroke term.e(8,9,left,.8,4); % lower arc fi if serifs: path upper_arc; upper_arc=z1{x2-x1,15(y2-y1)}....{right}z2; pos10(.3[fine.breadth,cap_hair],0); x10l=x1r; top y10=h+o; x1'-x1l=2cap_curve; y1'=y1; numeric t; t=xpart(upper_arc intersectiontimes (z10r--z1')); filldraw z1r--z10l--z10r--subpath(t,0) of upper_arc--cycle; fi % upper serif %%%%% % uppercase cedilla/ogonek if is_ogonek: def the_pen=if known ogonek_pen: ogonek_pen elseif serifs: tiny elseif is_bold: fisp else: fine fi enddef; ogonek_pos=(x8r,0); easy_ogonek(the_pen,11,12,13); % ogonek else: uppercase_cedilla(x8,0, 11,12,13,14,15); fi penlabels(0,1,2,3,4,5,6,7,8,9,10, 11,12,13,14,15); endchar; lhchar "Uppercase Cyrillic letter ABH_DZE - Abkhasian DZE"; cyrchar(ABH_DZE,10u#,cap_height#,0); if is_small_cap: getcharcode(abh_dze); fi italcorr cap_height#*slant-.5u#; %K adjust_fit(0,.5serif_fit#); pickup if serifs: tiny.nib else: fine.nib fi; numeric arm_thickness,z_stem[]; z_stem1=max(currentbreadth,hround(if hefty:1/3[vair,hair] else: fudged.hair fi)); arm_thickness=if hefty: 2/3 else:.75 fi[slab,cap_stem]; if z_stem1y2+cap_notch_cut: y0:=y2+cap_notch_cut; fill z0+.5right{up}...{z4-z3}diag_end(3l,4l,1,1,4r,3r)--z5r --diag_end(5r,6r,1,1,6l,5l)--z5l--diag_end(2l,1l,1,1,1r,2r){z2-z1} ...{down}z0+.5left--cycle; % diagonals and stem else: fill z0--diag_end(0,4l,1,1,4r,3r)--z5r --diag_end(5r,6r,1,1,6l,5l)--z5l --diag_end(2l,1l,1,1,1r,0)--cycle; fi % diagonals and stem if serifs: numeric inner_jut; pickup tiny.nib; prime_points_inside(1,2); prime_points_inside(4,3); prime_points_inside(6,5); if rt x1'r+cap_jut+.5u+1<=lft x4'l-cap_jut: inner_jut=cap_jut; else: rt x1'r+inner_jut+.5u+1=lft x4'l-inner_jut; fi dish_serif(1',2,a,1/3,outer_jut,b,1/2,inner_jut); % upper left serif dish_serif(4',3,c,.6,inner_jut,d,1/2,outer_jut)(dark); % upper right serif dish_serif(6',5,e,1/3,cap_jut,f,1/3,cap_jut); fi % lower serif penlabels(0,1,2,3,4,5,6); endchar; lhchar "Uppercase Cyrillic letter Y_hcrs - straight U hcrossed"; cyrchar(Y_hcrs,13u#,cap_height#,0); if is_small_cap: getcharcode(y_hcrs); fi italcorr cap_height#*slant+.45u#; adjust_fit(cap_serif_fit#,cap_serif_fit#); % upper_y; numeric left_stem,right_stem,outer_jut,dy,alpha; left_stem=cap_stem-stem_corr; right_stem=min(cap_hair if hefty:-2stem_corr fi,left_stem); outer_jut=.75cap_jut; x1l=w-x4r=l+letter_fit+outer_jut+.05u; x2l=x5l=hround(.5w-.5left_stem); x3r=x5r; y1=y4=h; y2=y3=y5=.4h; dy=y1-y2; alpha=((x2l-x1l)++dy)/dy; penpos1(alpha*left_stem,0); penpos2(alpha*left_stem,0); penpos3(alpha*right_stem,0); penpos4(alpha*right_stem,0); penpos5(left_stem,0); penpos6(left_stem,0); x5=x6; y6=0; z0=whatever[z1r,z2r]=whatever[z3l,z4l]; if y0>y2+cap_notch_cut: y0:=y2+cap_notch_cut; fill z0+.5right{up}...{z4-z3}diag_end(3l,4l,1,1,4r,3r)--z5r --diag_end(5r,6r,1,1,6l,5l)--z5l--diag_end(2l,1l,1,1,1r,2r){z2-z1} ...{down}z0+.5left--cycle; % diagonals and stem else: fill z0--diag_end(0,4l,1,1,4r,3r)--z5r --diag_end(5r,6r,1,1,6l,5l)--z5l --diag_end(2l,1l,1,1,1r,0)--cycle; fi % diagonals and stem if serifs: numeric inner_jut; pickup tiny.nib; prime_points_inside(1,2); prime_points_inside(4,3); prime_points_inside(6,5); if rt x1'r+cap_jut+.5u+1<=lft x4'l-cap_jut: inner_jut=cap_jut; else: rt x1'r+inner_jut+.5u+1=lft x4'l-inner_jut; fi dish_serif(1',2,a,1/3,outer_jut,b,1/2,inner_jut); % upper left serif dish_serif(4',3,c,.6,inner_jut,d,1/2,outer_jut)(dark); % upper right serif dish_serif(6',5,e,1/3,cap_jut,f,1/3,cap_jut); fi % lower serif % hcross pickup crisp.nib; pos7(bar,90); pos8(bar,90); x7=.25w; x8=.75w; top y7r=top y8r=vround (y3-eps); filldraw stroke z7e--z8e; penlabels(0,1,2,3,4,5,6, 7,8); endchar; lhchar "Uppercase Cyrillic letter H_dsc - KHA descender"; cyrchar(H_dsc,13u#,cap_height#, if is_ogonek: desc_depth# else: cap_sbeak# fi); %udesc/og_depth if is_small_cap: getcharcode(h_dsc); fi italcorr cap_height#*slant-.25u#; adjust_fit(cap_serif_fit#,cap_serif_fit#); % upper_h; numeric stem[],outer_jut,xjut,alpha[]; stem1=cap_stem-2stem_corr; stem2=min(cap_hair,stem1); outer_jut=.75cap_jut; xjut= if serifs: (stem1-stem2)/4 else: 0 fi; x1l=l+letter_fit+.5u+outer_jut; x2r=r-letter_fit-u-outer_jut-xjut; x3l=l+letter_fit+.25u+outer_jut+xjut; x4r=r-letter_fit-.25u-outer_jut; y1=y2=h; y3=y4=0; alpha1=diag_ratio(1,stem1,h,x4r-x1l); alpha2=diag_ratio(1,stem2,h,x2r-x3l); penpos1(alpha1*stem1,0); penpos2(alpha2*stem2,0); penpos3(alpha2*stem2,0); penpos4(alpha1*stem1,0); if hefty: z0=whatever[z1,z4]=whatever[z2,z3]; x12=x34=x0; y13=y24=y0; z12=whatever[z2l,z3l]; z13=whatever[z2l,z3l]; z24=whatever[z2r,z3r]; z34=whatever[z2r,z3r]; forsuffixes $=13,24,34: z$'=.1[z$,z0]; endfor fill diag_end(12,1r,.5,1,1l,13')--z13'--diag_end(13',3l,1,.5,3r,34')--z34' --diag_end(34',4l,.5,1,4r,24')--z24' --diag_end(24',2r,1,.5,2l,12)--z12--cycle; % diagonals else: fill diag_end(4r,1r,.5,1,1l,4l) --diag_end(1l,4l,.5,1,4r,1r)--cycle; % left diagonal fill diag_end(2l,3l,.5,1,3r,2r) --diag_end(3r,2r,.5,1,2l,3l)--cycle; fi % right diagonal %%% numeric inner_jut[]; pickup tiny.nib; % moved for cyr_serif prime_points_inside(3,2); prime_points_inside(4,1); if rt x3'r+cap_jut+.5u+1<=lft x4'l-cap_jut-xjut: inner_jut2=cap_jut; else: rt x3'r+inner_jut2+.5u+1=lft x4'l-inner_jut2-xjut; fi if serifs: prime_points_inside(1,4); prime_points_inside(2,3); if rt x1'r+cap_jut+.5u+1<=lft x2'l-cap_jut-xjut: inner_jut1=cap_jut; else: rt x1'r+inner_jut1+.5u+1=lft x2'l-inner_jut1-xjut; fi dish_serif(1',4,a,1/3,outer_jut,b,2/3,inner_jut1); % upper left serif if is_ogonek: dish_serif(4',1,c,2/3,inner_jut2,d,1/3,outer_jut); % lower right serif fi dish_serif(2',3,e,2/3,inner_jut1+xjut,f,1/2,outer_jut+xjut)(dark); % upper right serif dish_serif(3',2,g,1/2,outer_jut+xjut,h,2/3,inner_jut2+xjut)(dark); fi % lower left serif %%%%% % uppercase descender/ogonek if is_ogonek: def the_pen=if known ogonek_pen: ogonek_pen elseif serifs: tiny elseif is_bold: fisp else: fine fi enddef; % |diag_end| refers to |tiny| pen, hence |tiny| in the following equation: ogonek_pos=(x4 if not serifs: l if is_bold: +.75tiny fi\\ fi,.5the_pen) if serifs and not is_egyptian: +(.5xvair,0) fi; easy_ogonek(the_pen,7,8,9); % ogonek else: numeric right_jut; right_jut=if serifs: 1.1 outer_jut else: .4tiny fi; if not serifs: numeric arm_thickness; arm_thickness=vround(slab+vair_corr); save slab; slab:=arm_thickness; fi %bottom.desc.slab r_serif(4',1,x,1/3,inner_jut2,y,1/3,beak_darkness,right_jut,beak_jut); % lower right descender fi penlabels(0,1,2,3,4,12,13,24,34); endchar; lhchar "Uppercase Cyrillic letter H_tl (looks like X)"; cyrchar(H_tl,13u#,cap_height#,desc_depth#); if is_small_cap: getcharcode(h_tl); fi italcorr cap_height#*slant-.25u#; adjust_fit(cap_serif_fit#,cap_serif_fit#); % upper_h_tail; numeric stem[],outer_jut,xjut,alpha[]; stem1=cap_stem-2stem_corr; stem2=min(cap_hair,stem1); outer_jut=.75cap_jut; xjut= if serifs: (stem1-stem2)/4 else: 0 fi; x1l=l+letter_fit+.5u+outer_jut; x2r=r-letter_fit-u-outer_jut-xjut; x3l=l+letter_fit+.25u+outer_jut+xjut; x4r=r-letter_fit-.25u-outer_jut; y1=y2=h; y3=y4=0; alpha1=diag_ratio(1,stem1,h,x4r-x1l); alpha2=diag_ratio(1,stem2,h,x2r-x3l); penpos1(alpha1*stem1,0); penpos2(alpha2*stem2,0); penpos3(alpha2*stem2,0); penpos4(alpha1*stem1,0); numeric t; t=slab+bracket; forsuffixes e=l,r: z54e=(((0,t)--(w,t)) intersectionpoint (z4e--z1e)); endfor; if hefty: z0=whatever[z1,z4]=whatever[z2,z3]; x12=x34=x0; y13=y24=y0; z12=whatever[z2l,z3l]; z13=whatever[z2l,z3l]; z24=whatever[z2r,z3r]; z34=whatever[z2r,z3r]; forsuffixes $=13,24,34: z$'=.1[z$,z0]; endfor fill diag_end(12,1r,.5,1,1l,13')--z13'--diag_end(13',3l,1,.5,3r,34')-- z34'--z54l--z54r--z24' %!!! --diag_end(24',2r,1,.5,2l,12)--z12--cycle; % diagonals else: fill diag_end(4r,1r,.5,1,1l,4l)-- z54l--z54r--cycle; %!!! left diagonal fill diag_end(2l,3l,.5,1,3r,2r) --diag_end(3r,2r,.5,1,2l,3l)--cycle; fi % right diagonal %%% if serifs: numeric inner_jut[]; pickup tiny.nib; prime_points_inside(1,4); prime_points_inside(2,3); prime_points_inside(3,2); prime_points_inside(4,1); if rt x1'r+cap_jut+.5u+1<=lft x2'l-cap_jut-xjut: inner_jut1=cap_jut; else: rt x1'r+inner_jut1+.5u+1=lft x2'l-inner_jut1-xjut; fi if rt x3'r+cap_jut+.5u+1<=lft x4'l-cap_jut-xjut: inner_jut2=cap_jut; else: rt x3'r+inner_jut2+.5u+1=lft x4'l-inner_jut2-xjut; fi dish_serif(1',4,a,1/3,outer_jut,b,2/3,inner_jut1); % upper left serif %dish_serif(4',1,c,2/3,inner_jut2,d,1/3,outer_jut); % lower right serif dish_serif(2',3,e,2/3,inner_jut1+xjut,f,1/2,outer_jut+xjut)(dark); % upper right serif dish_serif(3',2,g,1/2,outer_jut+xjut,h,2/3,inner_jut2+xjut)(dark); fi % lower left serif %%%%% % L_tail(4);X_tail _zero:=4; _one:=7; _two:=8; _three:=9; _four:=10; % % X_ pickup fine.nib; stem3=hround (max(fine.breadth,.5[stem1,x[_zero]r-x[_zero]l])); x[_one]'r=x[_zero]r; penpos[_one]'(stem3,0); pos[_one](stem3,0); z[_one]=z[_one]'; bot y[_one]=max(-1/3d-eps,-d+if serifs: vair'else: slab fi); (x[_one]'l,y54')=whatever[z4l,z4l+dir angle(z4l-if serifs:z1l else:z34'fi)]; z54'=(x[_one]'l,y54'); fill z54l{z4r-z1r} ..controls (z54').. {down}z[_one]'l--z[_one]'r{up} ..controls (z4r).. {z1r-z4r}z54r--cycle; %link % _X if serifs: numeric bulb_diam; bulb_diam=max(currentbreadth+eps,min(.82d-1-eps,flare+(cap_stem-stem))); pos[_two](vair',-90); pos[_three](hair,-180); pos[_four](bulb_diam,-180); x[_two]=.5[x[_one],x[_three]r]; bot y[_two]r=-d-oo; y[_three]-.5bulb_diam=-.85d; z[_three]r=z[_four]r; rt x[_four]l=floor x[_one]-2.5u if monospace: / expansion_factor fi;%!!! filldraw stroke pulled_arc.e([_one],[_two]);%!!! bulb([_two],[_three],[_four]); % bulb else: pos[_two](slab,-90); pos[_three](flare,-105); rt x[_three]r=x[_one]-4u; bot y[_three]r=-d;%!!! bot y[_two]r=-d-o; x[_two]=.4[x[_three]r,x[_one]r];%!!! filldraw stroke super_arc.e([_one],[_two])%!!! & term.e([_two],[_three],left,.8,4); fi %%% penlabels(0,1,2,3,4,12,13,24,34,54,54', 5,6,7',8); endchar; lhchar "Uppercase Cyrillic letter CH_ldsc - CHE left descender"; cyrchar(CH_ldsc,13.5u#,cap_height#,cap_sbeak#); if is_small_cap: getcharcode(ch_ldsc); fi italcorr cap_height#*slant-cap_serif_fit#+cap_jut#-2.5u#+min(.5cap_stem#,u#); adjust_fit(cap_serif_fit#,cap_serif_fit#); % upper_ch; pickup tiny.nib; pos1(cap_stem,0); pos2(cap_stem,0); pos3(cap_stem,0); pos4(cap_stem,0); lft x1l=lft x2l=hround max(2u,3u-.5cap_stem); x3=x4=w-x1; top y1=top y3=h; bot y2=.3[y6,h]; bot y4=0; x5l=1/3[x1,x3]; y5=y6; if serifs: y6'=y6-cap_hair+1.05cap_stem; fi x6=x6'=x3; y6=good.y (h-.52h if serifs: -.35(.5[cap_hair,.7cap_stem]) fi); filldraw stroke z1e--z2e; % left stem filldraw stroke z3e--z4e; % right stem clearpen; penpos2'(cap_stem,0); z2'=z2; numeric middle_weight; middle_weight=.5[vair,cap_band]; penpos5(middle_weight,90); penpos6(middle_weight,90); penpos6'(middle_weight,90); if serifs: if y6'-y6>=middle_weight+1+eps: fill stroke pulled_arc.e(2',5) & z5e{right}...{.75(z5-z6)+z6'}z6'e; else: fill stroke pulled_arc.e(2',5) & z5e--z6e; fi % arc numeric inner_jut; pickup tiny.nib; if rt x1r+cap_jut+.5u+1<=lft x3l-cap_jut: inner_jut=cap_jut; else: rt x1r+inner_jut+.5u+1=lft x3l-inner_jut; fi %%% dish_serif(1,2,a,1/3,cap_jut,b,1/3,inner_jut); % upper left serif dish_serif(3,4,e,1/3,inner_jut,f,1/3,cap_jut); % upper right serif %dish_serif(4,3,g,1/3,inner_jut,h,1/3,cap_jut); % lower right serif else: filldraw stroke pulled_arc.e(2',5) & z5e--z6e; fi % arc %%%%% % upper left descender numeric right_jut; right_jut= if serifs: max(limit_dist,1.1cap_jut) else: hround (w+cap_serif_fit+.5(stem-u)-rt x4r-.65u) fi; l_serif(4,3,x,1/3,beak_darkness,right_jut,beak_jut,y,1/3,cap_jut); % lower left descender penlabels(1,2,3,4,5,6); endchar; lhchar "Uppercase Cyrillic letter CH_rdsc - CHE right descender"; cyrchar(CH_rdsc,13.5u#,cap_height#, if is_ogonek: desc_depth# else: cap_sbeak# fi); %udesc/og_depth` if is_small_cap: getcharcode(ch_rdsc); fi italcorr cap_height#*slant-cap_serif_fit#+cap_jut#-2.5u#+min(.5cap_stem#,u#); adjust_fit(cap_serif_fit#, cap_serif_fit# if not serifs:+.5(cap_stem#-u#) fi); %DL_adj % upper_ch; pickup tiny.nib; pos1(cap_stem,0); pos2(cap_stem,0); pos3(cap_stem,0); pos4(cap_stem,0); lft x1l=lft x2l=hround max(2u,3u-.5cap_stem); x3=x4=w-x1; top y1=top y3=h; bot y2=.3[y6,h]; bot y4=0; x5l=1/3[x1,x3]; y5=y6; if serifs: y6'=y6-cap_hair+1.05cap_stem; fi x6=x6'=x3; y6=good.y (h-.52h if serifs: -.35(.5[cap_hair,.7cap_stem]) fi); filldraw stroke z1e--z2e; % left stem filldraw stroke z3e--z4e; % right stem clearpen; penpos2'(cap_stem,0); z2'=z2; numeric middle_weight; middle_weight=.5[vair,cap_band]; penpos5(middle_weight,90); penpos6(middle_weight,90); penpos6'(middle_weight,90); if serifs: if y6'-y6>=middle_weight+1+eps: fill stroke pulled_arc.e(2',5) & z5e{right}...{.75(z5-z6)+z6'}z6'e; else: fill stroke pulled_arc.e(2',5) & z5e--z6e; fi % arc numeric inner_jut; pickup tiny.nib; if rt x1r+cap_jut+.5u+1<=lft x3l-cap_jut: inner_jut=cap_jut; else: rt x1r+inner_jut+.5u+1=lft x3l-inner_jut; fi %%% dish_serif(1,2,a,1/3,cap_jut,b,1/3,inner_jut); % upper left serif dish_serif(3,4,e,1/3,inner_jut,f,1/3,cap_jut); % upper right serif if is_ogonek: dish_serif(4,3,g,1/3,inner_jut,h,1/3,cap_jut); % lower right serif fi else: filldraw stroke pulled_arc.e(2',5) & z5e--z6e; fi % arc %%%%% % uppercase descender/ogonek if is_ogonek: def the_pen=if known ogonek_pen: ogonek_pen elseif serifs: tiny elseif is_bold: fisp else: fine fi enddef; % |stem| is drawn by |tiny| pen, hence |tiny| in the following equation: ogonek_pos=(x4 if not serifs: l if is_bold: +.75tiny fi\\ fi,.5the_pen) if serifs and not is_egyptian: +(.5xvair,0) fi; easy_ogonek(the_pen,7,8,9); % ogonek else: numeric right_jut; right_jut= if serifs: max(limit_dist,1.1cap_jut) else: hround (w+cap_serif_fit+.5(stem-u)-rt x4r-.65u) fi; if not serifs: numeric arm_thickness; arm_thickness=vround(slab-vair_corr); save slab; slab:=arm_thickness; fi % bottom.desc.slab r_serif(4,3,x,1/3,cap_jut,y,1/3,beak_darkness,right_jut,beak_jut); % lower right descender fi penlabels(1,2,3,4,5,6, 7,8,9); endchar; lhchar "Uppercase Cyrillic letter SCHWA"; cyrchar(SCHWA,11.25u#+max(.75u#,.5cap_curve#),cap_height#,0); if is_small_cap: getcharcode(schwa); fi italcorr .7cap_height#*slant-.5u#; %O adjust_fit(0 if monospace: +\\-.25u#,-.25u#+ else:,fi\\ 0); % upper_schwa;`large e' shape (ecfonts) numeric left_curve,right_curve; left_curve=right_curve+3stem_corr=cap_curve if not serifs: -1.5stem_corr fi; if right_curve