| 1 |
% mathematical symbols by Anthony Phan. |
| 2 |
% file: mathsymb.mf (various mathematical symbols) |
| 3 |
% last modification: May 16, 2005. |
| 4 |
% Only known charcodes will be generated. |
| 5 |
|
| 6 |
def horizontal_rules_list=math_axis, |
| 7 |
-body_depth,-desc_depth,x_height,cap_height,asc_height,body_height, |
| 8 |
math_axis-0.5spread1,math_axis-0.5spread2,math_axis-0.5spread3, |
| 9 |
math_axis-0.5spread4, |
| 10 |
math_axis+0.5spread1,math_axis+0.5spread2,math_axis+0.5spread3, |
| 11 |
math_axis+0.5spread4, |
| 12 |
enddef; |
| 13 |
|
| 14 |
%%% !!! marked signs are to be revised |
| 15 |
|
| 16 |
use_rule1; |
| 17 |
|
| 18 |
% standard |
| 19 |
|
| 20 |
beginchar(hex"20",6u#+2letter_fit#,0,0); |
| 21 |
"Normal space"; |
| 22 |
endchar; |
| 23 |
|
| 24 |
% hex"00" |
| 25 |
|
| 26 |
beginchar(currentlocation,arithmetic_bounds); |
| 27 |
"Top dot plus sign"; |
| 28 |
pickup tiny.nib; |
| 29 |
pos1(rth,0); pos2(rth,0); pos3(rth,90); pos4(rth,90); |
| 30 |
lft x1l=hround 0.5(w-rth); x2=x1; |
| 31 |
lft x3=Appr; x1-x3=x4-x1=y1-y3=y3-y2; y3=y4=math_axis; |
| 32 |
filldraw stroke z1e..z2e; filldraw stroke z3e..z4e; |
| 33 |
pickup null.nib; |
| 34 |
adjust_dot5((x1,y3+6.5u+0.5dtsz),dtsz,true,false); dot(5,5'); |
| 35 |
penlabels(1,2,3,4); |
| 36 |
endchar; |
| 37 |
|
| 38 |
beginchar(currentlocation,arithmetic_bounds); |
| 39 |
"Top dot minus sign"; |
| 40 |
pickup tiny.nib; |
| 41 |
lft x1=Appr; rt x2=w-Appr; |
| 42 |
y2=y1=math_axis; pos1(rth,90); pos2(rth,90); |
| 43 |
filldraw stroke z1e..z2e; penlabels(1,2); |
| 44 |
adjust_dot3((0.5[x1,x2],y1+math_spread[0.5x_height,0.6x_height]), |
| 45 |
dtsz,true,false); dot(3,3'); |
| 46 |
endchar; |
| 47 |
|
| 48 |
beginchar(currentlocation,arithmetic_bounds); |
| 49 |
"Top dot times sign"; |
| 50 |
pickup rule.nib; x0=good.x 0.5w; |
| 51 |
pickup tiny.nib; rt x0'=w-Appr; y0=y0'=math_axis; |
| 52 |
z1-z0=z0-z2=(z0'-z0) rotated 45; z3-z0=z0-z4=(z0'-z0) rotated -45; |
| 53 |
pos1(rth+2eps,-45); pos2(rth+2eps,-45); |
| 54 |
pos3(rth+2eps,45); pos4(rth+2eps,45); |
| 55 |
filldraw stroke z1e..z2e; filldraw stroke z4e..z3e; |
| 56 |
pickup null.nib; |
| 57 |
adjust_dot5((x0,y0+5.5u+0.5dtsz),dtsz,true,false); dot(5,5'); |
| 58 |
penlabels(1,2,3,4); |
| 59 |
endchar; |
| 60 |
|
| 61 |
beginchar(currentlocation,arithmetic_bounds); |
| 62 |
"Bot dot minus sign"; |
| 63 |
pickup tiny.nib; |
| 64 |
lft x1=Appr; rt x2=w-Appr; |
| 65 |
y2=y1=math_axis; pos1(rth,90); pos2(rth,90); |
| 66 |
filldraw stroke z1e..z2e; penlabels(1,2); |
| 67 |
adjust_dot3((0.5[x1,x2],y1-math_spread[0.5x_height,0.6x_height]), |
| 68 |
dtsz,true,false); dot(3,3'); |
| 69 |
endchar; |
| 70 |
|
| 71 |
beginchar(currentlocation,3u#+2appr#,cap_height#,0); |
| 72 |
"Cap centered dot"; |
| 73 |
pickup null.nib; |
| 74 |
adjust_dot1((0.5w,0.5h),1.2dtsz,false,false); |
| 75 |
dot(1,1'); |
| 76 |
endchar; |
| 77 |
|
| 78 |
beginchar(currentlocation,7u#+2appr#,v_center(7u#)); |
| 79 |
"Small box"; |
| 80 |
pickup tiny.nib; |
| 81 |
a:=sqrt(3.14159)*0.5*max(7u,dtsz+rth0); |
| 82 |
top y1r=top y2r=vround(math_axis+0.5a); |
| 83 |
bot y3r=bot y4r=top y1r-vround a; |
| 84 |
lft x1r=lft x4r=hround 0.5(w-a); |
| 85 |
rt x2r=rt x3r=lft x1r+hround a; |
| 86 |
rt x1l-lft x1r=rt x2r-lft x2l |
| 87 |
=rt x3r-lft x3l=rt x4l-lft x4r=rth0; |
| 88 |
top y1r-bot y1l=top y2r-bot y2l |
| 89 |
=top y3l-bot y3r=top y4l-bot y4r=rth0; |
| 90 |
filldraw stroke z1e--z2e--z3e--z4e--z1e; |
| 91 |
penlabels(1,2,3,4); |
| 92 |
endchar; |
| 93 |
|
| 94 |
beginchar(currentlocation,arithmetic_bounds); |
| 95 |
"Large asterisk"; |
| 96 |
autorounded; |
| 97 |
interim stress:=0.5; pickup null.nib; |
| 98 |
numeric b,c,dag_curve,dag_stem; spread:=12u; |
| 99 |
b=2.6hair; c=0.625b; dag_curve=round 1.1cap_curve; dag_stem=hair; |
| 100 |
% |
| 101 |
x0=hround(0.5w-0.5dag_curve)+0.5dag_curve; |
| 102 |
y0=0.5[-d,h]; |
| 103 |
for $=1 upto 6: z[$]=b*dir($*60+30)+z0; |
| 104 |
z[$]'=c*dir($*60+60)+z0; endfor |
| 105 |
filldraw for $=1 upto 6: dagger_stroke[$](round(0.5spread-b)+eps, |
| 106 |
dag_curve,dag_stem,dir($*60+30))...z[$]'...endfor cycle; |
| 107 |
labels(0,1',2',3',4',5',6'); |
| 108 |
endchar; |
| 109 |
|
| 110 |
beginchar(currentlocation,arithmetic_bounds); |
| 111 |
"Large co-asterisk"; |
| 112 |
autorounded; |
| 113 |
interim stress:=0.5; |
| 114 |
pickup null.nib; |
| 115 |
numeric b,c,dag_curve,dag_stem; spread:=12u; |
| 116 |
b=2.6hair; c=0.625b; dag_curve=round 1.1cap_curve; dag_stem=hair; |
| 117 |
% |
| 118 |
x0=hround(0.5w-0.5dag_curve)+0.5dag_curve; |
| 119 |
y0=0.5[-d,h]; |
| 120 |
for $=1 upto 6: z[$]=b*dir($*60-60)+z0; |
| 121 |
z[$]'=c*dir($*60-30)+z0; endfor |
| 122 |
filldraw for $=1 upto 6: dagger_stroke[$](round(0.5spread-b)+eps, |
| 123 |
dag_curve,dag_stem,dir($*60-60))...z[$]'...endfor cycle; |
| 124 |
labels(0,1',2',3',4',5',6'); |
| 125 |
endchar; |
| 126 |
|
| 127 |
% beginchar(currentlocation,arithmetic_bounds); |
| 128 |
% "Top dot truc sign"; |
| 129 |
% pickup tiny.nib; |
| 130 |
% pos1(rth,0); pos2(rth,0); pos3(rth,90); pos4(rth,90); |
| 131 |
% top y1=top y3r=top y4r=h; bot y2=-d; |
| 132 |
% lft x1l=hround 0.5(w-rth); x2=x1; |
| 133 |
% lft x3=Appr; x1-x3=x4-x1; filldraw stroke z1e..z2e; |
| 134 |
% filldraw stroke z3e..z4e; pickup null.nib; |
| 135 |
% adjust_dot5((x1,h+u+0.5dtsz),dtsz,true,false); dot(5,5'); |
| 136 |
% penlabels(1,2,3,4); |
| 137 |
% endchar; |
| 138 |
|
| 139 |
% beginchar(currentlocation,arithmetic_bounds); |
| 140 |
% "Top dot curT sign"; |
| 141 |
% pickup tiny.nib; |
| 142 |
% pos1(rth,0); pos2(rth,0); pos3(rth,90); pos4(rth,90); |
| 143 |
% bot y1=bot y3l=bot y4l=-d; top y2=h; |
| 144 |
% lft x1l=hround 0.5(w-rth); x2=x1; |
| 145 |
% lft x3=appr; x1-x3=x4-x1; filldraw stroke z2e..z1e; |
| 146 |
% filldraw stroke z3e..z4e; pickup null.nib; |
| 147 |
% adjust_dot5((x1,h+u+0.5dtsz),dtsz,true,false); dot(5,5'); |
| 148 |
% penlabels(1,2,3,4); |
| 149 |
% endchar; |
| 150 |
|
| 151 |
beginchar(currentlocation,arithmetic_bounds); |
| 152 |
"Top circ plus sign"; |
| 153 |
pickup tiny.nib; |
| 154 |
pos1(rth,0); pos2(rth,0); pos3(rth,90); pos4(rth,90); |
| 155 |
lft x1l=hround 0.5(w-rth); x2=x1; |
| 156 |
lft x3=Appr; x1-x3=x4-x1=y1-y3=y3-y2; y3=y4=math_axis; |
| 157 |
filldraw stroke z1e..z2e; % stem |
| 158 |
filldraw stroke z3e..z4e; % crossbar |
| 159 |
pickup rule.nib0; |
| 160 |
adjust_dot5((x1,y3+6u+0.5rth0+1.5u),3u+rth0,true,false); |
| 161 |
full_dot:=false; dot(5,5'); |
| 162 |
penlabels(1,2,3,4); |
| 163 |
endchar; |
| 164 |
|
| 165 |
beginchar(currentlocation,arithmetic_bounds); |
| 166 |
"Plus circle sign"; |
| 167 |
pickup tiny.nib; |
| 168 |
pos1(rth,0); pos2(rth,0); pos3(rth,90); pos4(rth,90); |
| 169 |
lft x1l=hround 0.5(w-rth); x2=x1; |
| 170 |
lft x3=Appr; x1-x3=x4-x1=y1-y3=y3-y2; y3=y4=math_axis; |
| 171 |
filldraw stroke z1e..z2e; % stem |
| 172 |
filldraw stroke z3e..z4e; % crossbar |
| 173 |
pickup rule.nib; z0=(x1,y3); |
| 174 |
rt x5=ceiling rt 0.75[Appr,w-Appr]+eps; y5=y0; |
| 175 |
z5-z0=z0-z7; z6-z0=z0-z8=(z5-z0) rotated 90; |
| 176 |
draw superellipse(z5,z6,z7,z8,superness); |
| 177 |
penlabels(1,2,3,4); labels(5,6,7,8); |
| 178 |
endchar; |
| 179 |
|
| 180 |
beginchar(currentlocation,arithmetic_bounds); |
| 181 |
"Convolution sign"; |
| 182 |
numeric darkness; darkness=0.8; |
| 183 |
pickup rule.nib; x0=good.x 0.5w; |
| 184 |
pickup tiny.nib; rt x1=w-Appr; y0=y1=y1'=y1''=math_axis; |
| 185 |
x1'=min(x0+2.5rth,0.5[x0,x1]); x1''=min(x0+1.25rth,0.25[x0,x1]); |
| 186 |
forsuffixes $=,': |
| 187 |
z1$-z0=z0-z2$; z3$-z0=z0-z4$=(z1$-z0) rotated 45; |
| 188 |
z5$-z0=z0-z6$=(z1$-z0) rotated 90; |
| 189 |
z7$-z0=z0-z8$=(z1$-z0) rotated -45; |
| 190 |
pos1$(rth,90); pos2$(rth,90); pos3$(rth,135); pos4$(rth,135); |
| 191 |
pos5$(rth,0); pos6$(rth,0); pos7$(rth,45); pos8$(rth,45); |
| 192 |
penlabels(1$,2$,3$,4$,5$,6$,7$,8$); |
| 193 |
endfor |
| 194 |
z1''-z0=z0-z2''; z3''-z0=z0-z4''=(z1''-z0) rotated 45; |
| 195 |
z5''-z0=z0-z6''=(z1''-z0) rotated 90; |
| 196 |
z7''-z0=z0-z8''=(z1''-z0) rotated -45; |
| 197 |
pos1''(darkness*rth,90); pos2''(darkness*rth,90); |
| 198 |
pos3''(darkness*rth,135); pos4''(darkness*rth,135); |
| 199 |
pos5''(darkness*rth,0); pos6''(darkness*rth,0); |
| 200 |
pos7''(darkness*rth,45); pos8''(darkness*rth,45); |
| 201 |
penlabels(1'',2'',3'',4'',5'',6'',7'',8''); |
| 202 |
filldraw stroke z2e---z2'e...z2''e---z1''e...z1'e---z1e; |
| 203 |
filldraw stroke z4e---z4'e...z4''e---z3''e...z3'e---z3e; |
| 204 |
filldraw stroke z5e---z5'e...z5''e---z6''e...z6'e---z6e; |
| 205 |
filldraw stroke z8e---z8'e...z8''e---z7''e...z7'e---z7e; |
| 206 |
endchar; |
| 207 |
|
| 208 |
beginchar(currentlocation,arithmetic_bounds); |
| 209 |
"Divide on times sign"; |
| 210 |
numeric darkness; darkness=0.8; |
| 211 |
pickup rule.nib; x0=good.x 0.5w; |
| 212 |
pickup tiny.nib; rt x1=w-Appr; y0=y1=y1'=y1''=math_axis; |
| 213 |
x1'=min(x0+2.5rth,0.5[x0,x1]); x1''=min(x0+1.25rth,0.25[x0,x1]); |
| 214 |
z1-z0=z0-z2; z1'-z0=z0-z2'; z1''-z0=z0-z2''; |
| 215 |
z3-z0=z0-z4=(z1-z0) rotated 45; z7-z0=z0-z8=(z1-z0) rotated 135; |
| 216 |
pos1(rth,90); pos2(rth,90); pos1'(rth,90); pos2'(rth,90); |
| 217 |
pos3(rth,135); pos4(rth,135); pos7(rth,225); pos8(rth,225); |
| 218 |
pos1''(darkness*rth,90); pos2''(darkness*rth,90); |
| 219 |
filldraw stroke z2e---z2'e...z2''e---z1''e...z1'e---z1e; |
| 220 |
filldraw stroke z4e..z3e; filldraw stroke z8e..z7e; |
| 221 |
pickup null.nib; |
| 222 |
adjust_dot5((x0,y0+5.5u-0.5dtsz),dtsz,true,false); dot(5,5'); |
| 223 |
adjust_dot6((x0,y0-5.5u+0.5dtsz),dtsz,true,false); dot(6,6'); |
| 224 |
penlabels(1,1',1'',2,2',2'',3,4,7,8); |
| 225 |
endchar; |
| 226 |
|
| 227 |
beginchar(currentlocation,7u#+2appr#,v_center(7u#)); |
| 228 |
"Small full diamond"; |
| 229 |
pickup tiny.nib; |
| 230 |
a:=sqrt(3.14159)*0.5*max(7u,dtsz+rth0)-0.5rth0; |
| 231 |
y2=y4=good.y math_axis; x1=x3=good.x 0.5w; |
| 232 |
y1-y2=y2-y3=vround(0.5a*sqrt(2)-tiny)+eps; |
| 233 |
x2-x1=x1-x4=hround(0.5a*sqrt(2)-tiny)+eps; |
| 234 |
fill z1--z2--z3--z4--cycle; |
| 235 |
labels(1,2,3,4); |
| 236 |
endchar; |
| 237 |
|
| 238 |
beginchar(currentlocation,7u#+2appr#,v_center(7u#)); |
| 239 |
"Small full box"; |
| 240 |
pickup tiny.nib; |
| 241 |
a:=sqrt(3.14159)*0.5*max(7u-rth0,dtsz); |
| 242 |
top y1=top y2=vround(math_axis+0.5a); |
| 243 |
bot y3=bot y4=top y1-vround a; |
| 244 |
lft x1=lft x4=hround 0.5(w-a); |
| 245 |
rt x2=rt x3=lft x1+hround a; |
| 246 |
filldraw z1--z4--z3--z2--cycle; |
| 247 |
labels(1,2,3,4); |
| 248 |
endchar; |
| 249 |
|
| 250 |
beginchar(currentlocation,arithmetic_bounds); |
| 251 |
"Big five star"; |
| 252 |
pickup tiny.nib; |
| 253 |
draw_star.a((0.5w,math_axis),5,6u+o,0.1,90,false); |
| 254 |
labels(a); |
| 255 |
endchar; |
| 256 |
|
| 257 |
beginchar(currentlocation,arithmetic_bounds); |
| 258 |
"Big six star"; |
| 259 |
pickup tiny.nib; |
| 260 |
draw_star.a((0.5w,math_axis),6,6u+o,0.3,90,false); |
| 261 |
labels(a); |
| 262 |
endchar; |
| 263 |
|
| 264 |
% hex"10" |