| 1 |
% Based on the Computer Modern source file csc.mf by D E Knuth. |
| 2 |
|
| 3 |
% Edited by Ariel Barton to produce better sans serif symbols |
| 4 |
|
| 5 |
% Date: 2013/04/21 |
| 6 |
|
| 7 |
% Caps and Small Caps in Computer Modern Roman |
| 8 |
|
| 9 |
font_coding_scheme:="The letters I, i, Pi, Xi"; |
| 10 |
spanish_shriek=oct"016"; spanish_query=oct"017"; |
| 11 |
|
| 12 |
mode_setup; font_setup; |
| 13 |
cmchar "The letter I"; % Added serifs |
| 14 |
beginchar("I", |
| 15 |
if known I_cap_jut: (cap_stem#+2I_cap_jut#+2u#), |
| 16 |
else: max(6u#,4u#+cap_stem#), fi |
| 17 |
cap_height#,0); |
| 18 |
italcorr cap_height#*slant-.25u#; |
| 19 |
adjust_fit(cap_serif_fit#,cap_serif_fit#); |
| 20 |
pickup tiny.nib; pos1(cap_stem,0); pos2(cap_stem,0); |
| 21 |
lft x1l=lft x2l=hround(.5w-.5cap_stem); top y1=h; bot y2=0; |
| 22 |
filldraw stroke z1e--z2e; % stem |
| 23 |
if serifs: dish_serif(1,2,a,1/3,1.05cap_jut,b,1/3,1.05cap_jut); % upper serif |
| 24 |
dish_serif(2,1,c,1/3,1.05cap_jut,d,1/3,1.05cap_jut); fi % lower serif |
| 25 |
if known I_cap_jut: if I_cap_jut > 0: |
| 26 |
pos3(slab,90); pos4(slab,90); |
| 27 |
rt x4r=(w-u); x3=w-x4; |
| 28 |
top y4r = top y3r = h; |
| 29 |
filldraw stroke z4e--z3e; |
| 30 |
pos5(slab,90); pos6(slab,90); |
| 31 |
x5=x3; x6=x4; y5=y6; bot y5l=0; |
| 32 |
filldraw stroke z5e--z6e; |
| 33 |
fi fi |
| 34 |
math_fit(0,.5ic#); penlabels(1,2,3,4,5,6); endchar; |
| 35 |
|
| 36 |
cmchar "Uppercase Greek Pi"; |
| 37 |
beginchar(oct"005",13u#+width_adj#,cap_height#,0); |
| 38 |
italcorr |
| 39 |
if hefty: cap_height#*slant |
| 40 |
else: cap_height#*slant-cap_serif_fit#+I_cap_jut#-2.5u#+min(.5cap_stem#,u#) fi; |
| 41 |
adjust_fit(cap_serif_fit#,cap_serif_fit#); pickup tiny.nib; |
| 42 |
h:=vround(h-stem_corr); |
| 43 |
pos1(cap_stem,0); pos2(cap_stem,0); pos3(cap_stem,0); pos4(cap_stem,0); |
| 44 |
lft x1l=lft x2l=hround if hefty: u+I_cap_jut else: max(2u,3u-.5cap_stem) fi; |
| 45 |
x3=x4=w-x1; |
| 46 |
top y1=top y3=h; bot y2=bot y4=0; |
| 47 |
filldraw stroke z1e--z2e; % left stem |
| 48 |
filldraw stroke z3e--z4e; % right stem |
| 49 |
penpos5(cap_bar,90); penpos6(cap_bar,90); |
| 50 |
x5=x1; x6=x3; y5r=y6r=h; |
| 51 |
fill stroke z5e--z6e; % bar |
| 52 |
if serifs: numeric inner_jut; |
| 53 |
if rt x1r+cap_jut+.5u+1<=lft x3l-cap_jut: inner_jut=cap_jut; |
| 54 |
else: rt x1r+inner_jut+.5u+1=lft x3l-inner_jut; fi |
| 55 |
nodish_serif(1,2,a,1/3,cap_jut,b,1/3,eps); % upper left serif |
| 56 |
dish_serif(2,1,c,1/3,cap_jut,d,1/3,inner_jut); % lower left serif |
| 57 |
nodish_serif(3,4,e,1/3,eps,f,1/3,cap_jut); % upper right serif |
| 58 |
dish_serif(4,3,g,1/3,inner_jut,h,1/3,cap_jut); % lower right serif |
| 59 |
else: |
| 60 |
nodish_serif(1,2,a,1/3,I_cap_jut,b,1/3,eps); % upper left serif |
| 61 |
nodish_serif(3,4,e,1/3,eps,f,1/3,I_cap_jut); % upper right serif |
| 62 |
fi |
| 63 |
math_fit(0,.5ic#); penlabels(1,2,3,4,5,6); endchar; |
| 64 |
|
| 65 |
cmchar "Uppercase Greek Xi"; |
| 66 |
beginchar(oct"004",12u#,cap_height#,0); |
| 67 |
italcorr cap_height#*slant-.35u#; |
| 68 |
adjust_fit(0,0); |
| 69 |
h:=vround(h-2stem_corr); |
| 70 |
numeric shaved_stem; shaved_stem=hround .9[vair,.85cap_stem]; |
| 71 |
if shaved_stem<crisp.breadth: shaved_stem:=crisp.breadth; fi |
| 72 |
pickup crisp.nib; pos1(shaved_stem,90); pos2(if hefty: vair else: hair fi,0); |
| 73 |
top y1r=h; x1=.5w; rt x2r=hround(w-.85u); y2=good.y(y1l-4/9I_beak)-eps; |
| 74 |
pos3(if hefty: vair else: hair fi,180); x3=w-x2; y3=y2; |
| 75 |
pos4(shaved_stem,-90); pos5(if hefty: vair else: hair fi,0); |
| 76 |
bot y4r=0; x4=.5w; rt x5r=hround(w-.75u); y5=good.y(y4l+.5I_beak)+eps; |
| 77 |
pos6(if hefty: vair else: hair fi,180); x6=w-x5; y6=y5; |
| 78 |
begingroup save serifs; boolean serifs; serifs = true; |
| 79 |
arm(1,2,a,.4beak_darkness,.3 beak_jut); % upper right arm and beak |
| 80 |
arm(1,3,b,.4beak_darkness,-.3 beak_jut); % upper left arm and beak |
| 81 |
arm(4,5,c,.4beak_darkness,.3beak_jut); % lower right arm and beak |
| 82 |
arm(4,6,d,.4beak_darkness,-.3beak_jut); % lower left arm and beak |
| 83 |
endgroup; |
| 84 |
pos7(shaved_stem,90); pos8(shaved_stem,90); |
| 85 |
lft x7=w-rt x8=hround if serifs: 2.5 else: 2 fi\\ u; |
| 86 |
top y7r=top y8r=vround(.52h+.5shaved_stem); |
| 87 |
filldraw stroke z7e--z8e; % middle bar |
| 88 |
if serifs: numeric xjut; |
| 89 |
if bot y2>top y7r+.75cap_jut: xjut=.5cap_jut; |
| 90 |
else: bot y2=top y7r+1.5xjut; fi |
| 91 |
pos11(hair,0); pos12(hair,0); y11=y12; |
| 92 |
pos13(hair,0); pos14(hair,0); y13=y14; |
| 93 |
lft x11l=lft x13l=w-rt x12r=w-rt x14r=hround 2.5u; |
| 94 |
top y11-bot y13=shaved_stem+2xjut; .5[y11,y13]=y7; |
| 95 |
filldraw stroke z11e--z13e; filldraw stroke z12e--z14e; fi % middle serifs |
| 96 |
math_fit(0,.5ic#); penlabels(1,2,3,4,5,6,7,8,11,12,13,14); endchar; |
| 97 |
|
| 98 |
font_slant slant; font_x_height x_height#; |
| 99 |
if monospace: font_normal_space 9u#; % no stretching or shrinking |
| 100 |
font_quad 18u#; |
| 101 |
font_extra_space 9u#; |
| 102 |
else: font_normal_space 6u#+2letter_fit#; |
| 103 |
font_normal_stretch 3u#; font_normal_shrink 2u#; |
| 104 |
font_quad 18u#+4letter_fit#; |
| 105 |
font_extra_space 2u#; |
| 106 |
k#:=-.5u#; kk#:=-1.5u#; kkk#:=-2u#; % three degrees of kerning |
| 107 |
ligtable "I": "I" kern -k#; fi % Richard III |
| 108 |
% ligature programs for |"-"|, |"`"|, and |"'"| are in the {\tt comlig} file |
| 109 |
|
| 110 |
%%% fine lower |
| 111 |
forsuffixes $= u, width_adj, cap_serif_fit, letter_fit, |
| 112 |
body_height, cap_height, x_height, bar_height, comma_depth, |
| 113 |
flare, cap_hair, stem, cap_stem, cap_curve, cap_ess, |
| 114 |
cap_jut, beak_jut, beak, slab, cap_bar, cap_band, cap_notch_cut, |
| 115 |
o, apex_o, I_cap_jut, I_beak: $.#:=lower.$.#; endfor |
| 116 |
fudge:=lower.fudge; |
| 117 |
font_setup; % now try again with |lower| settings |
| 118 |
|
| 119 |
cmchar "The letter I"; % Added serifs |
| 120 |
beginchar("i", |
| 121 |
if known I_cap_jut: (cap_stem#+2I_cap_jut#+2u#), |
| 122 |
else: max(6u#,4u#+cap_stem#), fi |
| 123 |
cap_height#,0); |
| 124 |
italcorr cap_height#*slant-.25u#; |
| 125 |
adjust_fit(cap_serif_fit#,cap_serif_fit#); |
| 126 |
pickup tiny.nib; pos1(cap_stem,0); pos2(cap_stem,0); |
| 127 |
lft x1l=lft x2l=hround(.5w-.5cap_stem); top y1=h; bot y2=0; |
| 128 |
filldraw stroke z1e--z2e; % stem |
| 129 |
if serifs: dish_serif(1,2,a,1/3,1.05cap_jut,b,1/3,1.05cap_jut); % upper serif |
| 130 |
dish_serif(2,1,c,1/3,1.05cap_jut,d,1/3,1.05cap_jut); fi % lower serif |
| 131 |
if known I_cap_jut: if I_cap_jut > 0: |
| 132 |
pos3(slab,90); pos4(slab,90); |
| 133 |
rt x4r=(w-u); x3=w-x4; |
| 134 |
top y4r = top y3r = h; |
| 135 |
filldraw stroke z4e--z3e; |
| 136 |
pos5(slab,90); pos6(slab,90); |
| 137 |
x5=x3; x6=x4; y5=y6; bot y5l=0; |
| 138 |
filldraw stroke z5e--z6e; |
| 139 |
fi fi |
| 140 |
math_fit(0,.5ic#); penlabels(1,2,3,4,5,6); endchar; |
| 141 |
|
| 142 |
|
| 143 |
if not monospace: |
| 144 |
k#:=-.5u#; kk#:=-1.5u#; kkk#:=-2u#; % three degrees of kerning |
| 145 |
ligtable "i": "i" kern -k#; fi % skiing |
| 146 |
bye. |