| 1 |
% mathematical symbols by Anthony Phan. |
| 2 |
% file: mathltlk.mf (mathematical letter-like 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 |
enddef; |
| 9 |
|
| 10 |
use_rule1; |
| 11 |
|
| 12 |
%turningcheck:=0; |
| 13 |
|
| 14 |
% |
| 15 |
% A |
| 16 |
% |
| 17 |
|
| 18 |
beginchar(for_all,8.2u#+2appr#,cap_height#,0); |
| 19 |
"Universal quantifier"; |
| 20 |
pickup tiny.nib; |
| 21 |
lft x1l=w-rt x3r=appr-hround 0.5u; x2=x4=0.5[x1l,x3r]; |
| 22 |
top y1l=top y3r=h; bot y2=bot y4=-o; |
| 23 |
adjust_slanted_bar(1l,2,1,2l)(0.5(rth-tiny),1); |
| 24 |
adjust_slanted_bar(3r,4,3,4r)(0.5(rth-tiny),-1); |
| 25 |
forsuffixes $=1,2,3,4: z$r-z$=z$-z$l; endfor |
| 26 |
z5=whatever[z1r,z2r]; z5=whatever[z3l,z4l]; |
| 27 |
top y6r-bot y6l=top y7r-bot y7l=rth; |
| 28 |
top y6r=top y7r=vround(x_height+0.5rth); |
| 29 |
forsuffixes $=r,l: z6$=whatever[z1,z2]; z7$=whatever[z3,z4]; endfor |
| 30 |
filldraw z1l--z2l--z4r--z3r--z3l--z5--z1r--cycle; |
| 31 |
filldraw stroke z6e..z7e; penlabels(1,2,3,4,5,6,7); |
| 32 |
endchar; |
| 33 |
|
| 34 |
% |
| 35 |
% C |
| 36 |
% |
| 37 |
|
| 38 |
beginchar(complement,5.5u#+2appr#,cap_height#,0); |
| 39 |
"Complement"; |
| 40 |
autorounded; pickup tiny.nib; |
| 41 |
pos1(rth,0); pos2(rth,0); |
| 42 |
pos7(rth,0); pos8(rth,0); |
| 43 |
h-bot y1=top y8+d=vround 0.25(h+d); |
| 44 |
y3+0.5rth=h+o; y6-0.5rth=-d-o; |
| 45 |
rt x1r=w-appr; x1=x2=x7=x8; |
| 46 |
x4=x5=appr+0.5rth; x3=x6=0.5[x1,x4]; |
| 47 |
y2=y4=max(y3-x1+x3,1/6[y1,y3]); |
| 48 |
y5=y7=min(y6+x1-x3,1/6[y8,y6]); |
| 49 |
filldraw stroke z1e..z2e; filldraw stroke z7e..z8e; |
| 50 |
pickup rule.nib; |
| 51 |
draw z2 up_to_left z3 left_to_down |
| 52 |
z4..z5 down_to_right z6 right_to_up z7; |
| 53 |
penlabels(1,2,7,8); labels(3,4,5,6); |
| 54 |
endchar; |
| 55 |
|
| 56 |
% |
| 57 |
% E |
| 58 |
% |
| 59 |
|
| 60 |
beginchar(there_exists,6.5u#+appr#+Appr#,cap_height#,0); |
| 61 |
"Existential quantifier"; |
| 62 |
pickup tiny.nib; |
| 63 |
pos1(rth,90); pos4(rth,-90); pos5(rth,90); pos6(rth,90); |
| 64 |
y2l=y1l; y2r=y1r; y3l=y4l; y3r=y4r; top y1r=h; bot y4r=0; |
| 65 |
top y5r=top y6r=vround 0.5(h+rth); |
| 66 |
x2r-x2l=x3r-x3l=rth-tiny; |
| 67 |
lft x1=lft x4=lft x5-hround 0.15u=appr; |
| 68 |
rt x2r=rt x3r=w-Appr; x6=0.5[x2l,x2r]; filldraw stroke z5e..z6e; |
| 69 |
filldraw stroke z1e--z2e--z3e--z4e; penlabels(1,2,3,4,5,6); |
| 70 |
endchar; |
| 71 |
|
| 72 |
beginchar(there_not_exists,6.5u#+appr#+Appr#, |
| 73 |
min(body_height#,cap_height#+asc_depth#),asc_depth#); |
| 74 |
"Not existential quantifier"; |
| 75 |
pickup tiny.nib; |
| 76 |
pos1(rth,90); pos4(rth,-90); pos5(rth,90); pos6(rth,90); |
| 77 |
y2l=y1l; y2r=y1r; y3l=y4l; y3r=y4r; top y1r=cap_height; bot y4r=0; |
| 78 |
top y5r=top y6r=vround 0.5(cap_height+rth); |
| 79 |
x2r-x2l=x3r-x3l=rth-tiny; |
| 80 |
lft x1=lft x4=lft x5-hround 0.15u=appr; |
| 81 |
rt x2r=rt x3r=w-Appr; x6=0.5[x2l,x2r]; filldraw stroke z5e..z6e; |
| 82 |
filldraw stroke z1e--z2e--z3e--z4e; |
| 83 |
lft x8l-appr=w-Appr-rt x7r=hround u; |
| 84 |
bot y8l=-d-eps; y7r-y1r=y4r-y8l; |
| 85 |
adjust_slanted_bar(8l,7r,8r,7l)(rth-tiny,-1); |
| 86 |
filldraw stroke z7e..z8e; penlabels(1,2,3,4,5,6,7,8); |
| 87 |
endchar; |
| 88 |
|
| 89 |
% |
| 90 |
% F |
| 91 |
% |
| 92 |
|
| 93 |
beginchar(F_inverse,6.5u#+appr#+Appr#,cap_height#,0); |
| 94 |
"F inverse"; |
| 95 |
pickup tiny.nib; |
| 96 |
pos1(rth,0); pos3(rth,-90); pos4(rth,90); pos5(rth,90); |
| 97 |
y2l=y3l; y2r=y3r; top y1=h; bot y3r=0; |
| 98 |
top y4r=top y5r=vround 0.5(h+rth); |
| 99 |
lft x3=lft x4-hround 0.15u=appr; rt x1r=w-Appr; |
| 100 |
x1r=x2r; x1l=x2l; x5=x1; filldraw stroke z4e..z5e; |
| 101 |
filldraw stroke z1e--z2e--z3e; penlabels(1,2,3,4,5); |
| 102 |
endchar; |
| 103 |
|
| 104 |
% |
| 105 |
% G |
| 106 |
% |
| 107 |
|
| 108 |
beginchar(G_inverse,11.2u#+2appr#,cap_height#,0); |
| 109 |
"G inverse (game)"; |
| 110 |
pickup tiny.nib; |
| 111 |
top y2r=h+o; bot y4r=-o; y3=y0=0.5[y2r,y4r]; |
| 112 |
top y7r=vround y3; |
| 113 |
rt x3r=w-appr; rt x3r-lft x0r=hround 13u; |
| 114 |
x2=x4=0.5[x0r,x3r]; lft x6r=appr; x6l-x6r=rth-tiny; |
| 115 |
pos0(rth,180); pos2(rth,90); pos3(rth,0); pos4(rth,-90); |
| 116 |
pos7(rth,90); rt x7=hround x2; |
| 117 |
path tmp_path.r,tmp_path.l; numeric t[].r,t[].l; |
| 118 |
forsuffixes $=r,l: y6$=y7$; |
| 119 |
tmp_path.$=z0$ up_to_right z2$ right_to_down z3$ |
| 120 |
down_to_left z4$ left_to_up z0$; |
| 121 |
t2$=xpart(tmp_path.$ intersectiontimes (z6$..(x6$,y4$))); |
| 122 |
z5$=point t2$ of tmp_path.$; |
| 123 |
endfor |
| 124 |
t1r=xpart(tmp_path.r intersectiontimes (z6r..(x6r,y2r))); |
| 125 |
z1r=point t1r of tmp_path.r; y1=y3; |
| 126 |
z1-z1r=whatever*(direction t1r of tmp_path.r rotated -90); |
| 127 |
t1l=xpart(tmp_path.l intersectiontimes (z1r..z1)); |
| 128 |
z1l=point t1l of tmp_path.l; |
| 129 |
filldraw stroke subpath (t1e,t2e) of tmp_path.e--z6e--z7e; |
| 130 |
penlabels(0,1,2,3,4,5,6,7); |
| 131 |
endchar; |
| 132 |
|
| 133 |
% |
| 134 |
% O |
| 135 |
% |
| 136 |
|
| 137 |
beginchar(empty_set,min(15.2u#,asc_height#+asc_depth#)+2appr#, |
| 138 |
asc_height#,asc_depth#); |
| 139 |
"The empty set"; |
| 140 |
pickup rule.nib; |
| 141 |
a:=w-2appr; |
| 142 |
lft x3=w-rt x1=appr+hround(a/16.5)-eps; |
| 143 |
lft x5=appr; rt x6=w-appr; |
| 144 |
y2=good.y(math_axis+x1-0.5w)+eps; |
| 145 |
y6=good.y(math_axis+x6-0.5w); |
| 146 |
0.5[y2,y4]=0.5[y5,y6]=math_axis; |
| 147 |
x2=x4=0.5[x1,x3]; y1=y3=0.5[y2,y4]; |
| 148 |
draw superellipse(z1,z2,z3,z4,1/sqrt 2); |
| 149 |
draw z5..z6; labels(1,2,3,4,5,6); |
| 150 |
endchar; |
| 151 |
|
| 152 |
beginchar(diameter_sign,12u#+2appr#,fig_height#,0); |
| 153 |
"Diameter sign"; |
| 154 |
pickup rule.nib; |
| 155 |
top y2=top y6-o=h; bot y4=bot y5+o=-d; |
| 156 |
lft x3=appr; rt x1=w-appr; |
| 157 |
lft x5=appr+hround u; rt x6=w-appr-hround u; |
| 158 |
x2=x4=0.5[x1,x3]; y1=y3=0.5[y2,y4]; |
| 159 |
draw superellipse(z1,z2,z3,z4,1/sqrt 2); |
| 160 |
draw z5..z6; labels(1,2,3,4,5,6); |
| 161 |
endchar; |
| 162 |
|
| 163 |
% |
| 164 |
% T |
| 165 |
% |
| 166 |
|
| 167 |
beginchar(top_sign,11.2u#+2appr#,cap_height#,0); |
| 168 |
"Top sign"; |
| 169 |
pickup tiny.nib; |
| 170 |
pos1(rth,0); pos2(rth,0); pos3(rth,90); pos4(rth,90); |
| 171 |
top y1=top y3r=top y4r=cap_height; bot y2=-o; |
| 172 |
lft x1l=hround 0.5(w-rth); |
| 173 |
x2=x1; lft x3=appr; x1-x3=x4-x1; |
| 174 |
filldraw stroke z1e..z2e; % stem |
| 175 |
filldraw stroke z3e..z4e; % crossbar |
| 176 |
penlabels(1,2,3,4); |
| 177 |
endchar; |
| 178 |
|
| 179 |
beginchar(not_top_sign,11.2u#+2appr#,cap_height#,0); |
| 180 |
"Not top sign"; |
| 181 |
pickup tiny.nib; |
| 182 |
pos1(rth,0); pos2(rth,0); pos3(rth,90); pos4(rth,90); |
| 183 |
top y1=top y3r=top y4r=cap_height; bot y2=-o; |
| 184 |
lft x1l=hround 0.5(w-rth); |
| 185 |
x2=x1; lft x3=appr; x1-x3=x4-x1; |
| 186 |
filldraw stroke z1e..z2e; % stem |
| 187 |
filldraw stroke z3e..z4e; % crossbar |
| 188 |
lft x5r=lft x5l=appr; rt x6r=rt x6l=w-appr; |
| 189 |
h-top y6r=bot y5l+d=hround 0.15(h+d)-eps; |
| 190 |
numeric a,b; a=rth-tiny; b=abs(z6r-z5l); |
| 191 |
y5r-y5l=y6r-y6l=a/(((x6r-x5l)/b)*((b+-+a)/b)+((y6r-y5l)/b)*(a/b)); |
| 192 |
filldraw stroke z5e..z6e; |
| 193 |
penlabels(1,2,3,4,5,6); |
| 194 |
endchar; |
| 195 |
|
| 196 |
beginchar(bot_sign,11.2u#+2appr#,cap_height#,0); |
| 197 |
"Bot sign"; |
| 198 |
pickup tiny.nib; |
| 199 |
pos1(rth,0); pos2(rth,0); pos3(rth,90); pos4(rth,90); |
| 200 |
bot y2=bot y3l=bot y4l=0; top y1=cap_height+o; |
| 201 |
lft x1l=hround 0.5(w-rth); x2=x1; |
| 202 |
lft x3=appr; x1-x3=x4-x1; |
| 203 |
filldraw stroke z1e..z2e; % stem |
| 204 |
filldraw stroke z3e..z4e; % crossbar |
| 205 |
penlabels(1,2,3,4); |
| 206 |
endchar; |
| 207 |
|
| 208 |
beginchar(not_bot_sign,11.2u#+2appr#,cap_height#,0); |
| 209 |
"Not bot sign"; |
| 210 |
pickup tiny.nib; |
| 211 |
pos1(rth,0); pos2(rth,0); pos3(rth,90); pos4(rth,90); |
| 212 |
bot y2=bot y3l=bot y4l=0; top y1=cap_height+o; |
| 213 |
lft x1l=hround 0.5(w-rth); x2=x1; |
| 214 |
lft x3=appr; x1-x3=x4-x1; |
| 215 |
filldraw stroke z1e..z2e; % stem |
| 216 |
filldraw stroke z3e..z4e; % crossbar |
| 217 |
lft x5r=lft x5l=appr; rt x6r=rt x6l=w-appr; |
| 218 |
h-top y6r=bot y5l+d=hround 0.15(h+d)-eps; |
| 219 |
numeric a,b; a=rth-tiny; b=abs(z6r-z5l); |
| 220 |
y5r-y5l=y6r-y6l=a/(((x6r-x5l)/b)*((b+-+a)/b)+((y6r-y5l)/b)*(a/b)); |
| 221 |
filldraw stroke z5e..z6e; |
| 222 |
penlabels(1,2,3,4,5,6); |
| 223 |
endchar; |
| 224 |
|
| 225 |
% |
| 226 |
% EPSILONS |
| 227 |
% |
| 228 |
|
| 229 |
% use_rule2; |
| 230 |
|
| 231 |
rth:=ceiling((1/3[rth1#,rth2#])*hppp); |
| 232 |
pickup pencircle scaled rth; |
| 233 |
math_axis:=good.x(math_axis#*hppp); |
| 234 |
|
| 235 |
beginchar(belong_to,7.5u#+2appr#,v_center(spread3#)); |
| 236 |
"Belong to"; |
| 237 |
pickup tiny.nib; |
| 238 |
pos2(rth,90); pos6(rth,90); pos3(rth,90); pos4(rth,270); |
| 239 |
y3=y6=math_axis; |
| 240 |
y2-y3=y3-y4=vround(0.5spread3-0.5rth+0.5[oo,o])+eps; |
| 241 |
top y1r=vround(y3+0.5spread3); y1r-y3=y3-y5r; |
| 242 |
rt x1r=rt x5r+hround 0.6u=w-appr; x3=appr-ho+0.5rth; |
| 243 |
x2r=0.5[x1r,x3]; x4=0.5[x5r,x3]; |
| 244 |
z1'-z1r=(z2r-z1r) xscaled 0.35; z5'-z5r=(z4r-z5r) xscaled 0.325; |
| 245 |
pos1(rth,angle(z1'-z1r)-90); pos5(rth,angle(z5r-z5')-90); |
| 246 |
x6=good.x x1l; |
| 247 |
filldraw stroke z2e{right}...z1e{z1r-z1'}; |
| 248 |
filldraw stroke z5e{z5'-z5r}...z4e{left}; |
| 249 |
filldraw stroke z3e..z6e; |
| 250 |
pickup pencircle scaled rth; |
| 251 |
draw z2..controls 0.625[z2,(x3,y2)] and 0.65[z3,(x3,y2)].. |
| 252 |
z3..controls 0.65[z3,(x3,y4)] and 0.625[z4,(x3,y4)]..z4; |
| 253 |
penlabels(1,2,3,4,5,6,7,1',5'); |
| 254 |
tmp_picture:=currentpicture; |
| 255 |
endchar; |
| 256 |
|
| 257 |
beginchar(not_belong_to,7.5u#+2appr#,asc_height#,asc_depth#); |
| 258 |
"Not belong sign"; |
| 259 |
currentpicture:=tmp_picture; |
| 260 |
pickup tiny.nib; |
| 261 |
lft x2l=w-rt x1r=appr+hround u; |
| 262 |
top y1r=h+eps; 0.5[y1r,y2l]=math_axis; |
| 263 |
adjust_slanted_bar(2l,1r,2r,1l)(rth-tiny,-1); |
| 264 |
filldraw stroke z1e..z2e; penlabels(1,2); |
| 265 |
endchar; |
| 266 |
|
| 267 |
beginchar(var_not_belong_to,7.5u#+2appr#,asc_height#,asc_depth#); |
| 268 |
"Variant not belong sign"; |
| 269 |
currentpicture:=tmp_picture; |
| 270 |
pickup tiny.nib; |
| 271 |
pos1(rth,0); pos2(rth,0); |
| 272 |
top y1l=h+eps; 0.5[y1l,y2l]=math_axis; |
| 273 |
lft x1l=lft x2l=vround 0.5(w-rth); |
| 274 |
filldraw stroke z1e..z2e; penlabels(1,2); |
| 275 |
endchar; |
| 276 |
|
| 277 |
beginchar(belong_to_bar,7.5u#+2appr#, |
| 278 |
math_axis#+0.5spread3#+spread1#+0.5rth#, |
| 279 |
0.5spread3#-math_axis#); |
| 280 |
"Variant not reverse belong sign"; |
| 281 |
currentpicture:=tmp_picture; |
| 282 |
pickup tiny.nib; |
| 283 |
pos1(rth,90); pos2(rth,90); top y1r=top y2r=h; |
| 284 |
lft x1l=appr; rt x2=w-appr; |
| 285 |
filldraw stroke z1e..z2e; penlabels(1,2); |
| 286 |
endchar; |
| 287 |
|
| 288 |
beginchar(rev_belong_to,7.5u#+2appr#,v_center(spread3#)); |
| 289 |
"Reverse belong to"; |
| 290 |
pickup tiny.nib; |
| 291 |
pos2(rth,-90); pos6(rth,90); pos3(rth,90); pos4(rth,90); |
| 292 |
y3=y6=math_axis; |
| 293 |
y3-y2=y4-y3=vround(0.5spread3-0.5rth+0.5[oo,o])+eps; |
| 294 |
top y5r=vround(y3+0.5spread3); y1r-y3=y3-y5r; |
| 295 |
lft x1r=lft x5r-hround 0.6u=appr; x3=w-appr+ho-0.5rth; |
| 296 |
x2r=0.5[x1r,x3]; x4=0.5[x5r,x3]; |
| 297 |
z1'-z1r=(z2r-z1r) xscaled 0.35; z5'-z5r=(z4r-z5r) xscaled 0.325; |
| 298 |
pos1(rth,angle(z1'-z1r)-90); pos5(rth,angle(z5r-z5')-90); |
| 299 |
x6=good.x x1l; |
| 300 |
filldraw stroke z2e{left}...z1e{z1r-z1'}; |
| 301 |
filldraw stroke z5e{z5'-z5r}...z4e{right}; |
| 302 |
filldraw stroke z6e..z3e; |
| 303 |
pickup pencircle scaled rth; |
| 304 |
draw z2..controls 0.625[z2,(x3,y2)] and 0.65[z3,(x3,y2)].. |
| 305 |
z3..controls 0.65[z3,(x3,y4)] and 0.625[z4,(x3,y4)]..z4; |
| 306 |
penlabels(1,2,3,4,5,6,7,1',5'); |
| 307 |
tmp_picture:=currentpicture; |
| 308 |
endchar; |
| 309 |
|
| 310 |
beginchar(not_rev_belong_to,7.5u#+2appr#,asc_height#,asc_depth#); |
| 311 |
"Not reverse belong sign"; |
| 312 |
currentpicture:=tmp_picture; |
| 313 |
pickup tiny.nib; |
| 314 |
pickup tiny.nib; |
| 315 |
lft x2l=w-rt x1r=appr+hround u; |
| 316 |
top y1r=h+eps; 0.5[y1r,y2l]=math_axis; |
| 317 |
adjust_slanted_bar(2l,1r,2r,1l)(rth-tiny,-1); |
| 318 |
filldraw stroke z1e..z2e; penlabels(1,2); |
| 319 |
endchar; |
| 320 |
|
| 321 |
beginchar(var_not_rev_belong_to,7.5u#+2appr#,asc_height#,asc_depth#); |
| 322 |
"Variant not reverse belong sign"; |
| 323 |
currentpicture:=tmp_picture; |
| 324 |
pickup tiny.nib; |
| 325 |
pos1(rth,0); pos2(rth,0); |
| 326 |
top y1l=h; 0.5[y1l,y2l]=math_axis; |
| 327 |
lft x1l=lft x2l=vround 0.5(w-rth); |
| 328 |
filldraw stroke z1e..z2e; penlabels(1,2); |
| 329 |
endchar; |
| 330 |
|
| 331 |
beginchar(rev_belong_to_bar,7.5u#+2appr#,math_axis#+0.5spread3#, |
| 332 |
0.5spread3#+spread1#+0.5rth#-math_axis#); |
| 333 |
"Variant not reverse belong sign"; |
| 334 |
currentpicture:=tmp_picture; |
| 335 |
pickup tiny.nib; |
| 336 |
pos1(rth,90); pos2(rth,90); bot y1l=bot y2l=-d; |
| 337 |
lft x1l=appr; rt x2=w-appr; |
| 338 |
filldraw stroke z1e..z2e; penlabels(1,2); |
| 339 |
endchar; |
| 340 |
|
| 341 |
% |
| 342 |
% U |
| 343 |
% |
| 344 |
|
| 345 |
use_rule1; |
| 346 |
|
| 347 |
beginchar(cap_sign,12u#+2appr#,x_height#,0); |
| 348 |
"Small cap sign"; |
| 349 |
pickup tiny.nib; |
| 350 |
pos1(rth,180); pos2(rth,180); |
| 351 |
pos4(rth,0); pos5(rth,0); |
| 352 |
y3+0.5rth=h+o; bot y1r=bot y5r=-d; y2=y4=2/3[y3,y1r]; |
| 353 |
lft x1r=w-rt x5r=appr+hround 0.8u; |
| 354 |
x1=x2; x4=x5; x3=0.5[x2,x4]; |
| 355 |
filldraw stroke z1e..z2e; filldraw stroke z4e..z5e; |
| 356 |
pickup rule.nib; autorounded; |
| 357 |
draw z2 down_to_right z3 right_to_up z4; |
| 358 |
penlabels(1,2,3,4,5); |
| 359 |
endchar; |
| 360 |
|
| 361 |
beginchar(cup_sign,12u#+2appr#,x_height#,0); |
| 362 |
"Small cup sign"; |
| 363 |
pickup tiny.nib; |
| 364 |
pos1(rth,180); pos2(rth,180); |
| 365 |
pos4(rth,0); pos5(rth,0); |
| 366 |
y3-0.5rth=-d-o; top y1r=top y5r=h; y2=y4=2/3[y3,y1r]; |
| 367 |
lft x1r=w-rt x5r=appr+hround 0.8u; |
| 368 |
x1=x2; x4=x5; x3=0.5[x2,x4]; |
| 369 |
filldraw stroke z5e..z4e; filldraw stroke z2e..z1e; |
| 370 |
pickup rule.nib; autorounded; |
| 371 |
draw z2 down_to_right z3 right_to_up z4; |
| 372 |
penlabels(1,2,3,4,5); |
| 373 |
endchar; |
| 374 |
|
| 375 |
beginchar(cup_plus,12u#+2appr#,x_height#,0); |
| 376 |
"Small cup-plus sign"; |
| 377 |
ensure_centering_of(rth); |
| 378 |
% |
| 379 |
pickup tiny.nib; |
| 380 |
pos1(rth,180); pos2(rth,180); pos3(rth,-90); |
| 381 |
pos4(rth,0); pos5(rth,0); |
| 382 |
y3-0.5rth=-d-o; top y1r=top y5r=h; y2=y4=2/3[y3,y1r]; |
| 383 |
lft x1r=w-rt x5r=appr+hround 0.8u; |
| 384 |
x1=x2; x4=x5; x3=0.5[x2,x4]; |
| 385 |
filldraw stroke z5e..z4e; filldraw stroke z2e..z1e; |
| 386 |
% |
| 387 |
pos6(rth,0); pos7(rth,0); pos8(rth,90); pos9(rth,90); |
| 388 |
top y6=h; x6=x7=0.5w; |
| 389 |
numeric a; |
| 390 |
a=0.5(min(lft x5r-rt x1r-1.2u,h-rth-0.6u)-rth); |
| 391 |
y6-y8r=y8l-y7=vround a; x6l-x8=x9-x6r=hround a; y8=y9; |
| 392 |
filldraw stroke z6e..z7e; filldraw stroke z8e..z9e; |
| 393 |
pickup rule.nib; autorounded; |
| 394 |
draw z2 down_to_right z3 right_to_up z4; |
| 395 |
penlabels(1,2,3,4,5,6,7,8,9); |
| 396 |
endchar; |
| 397 |
|
| 398 |
beginchar(sqcap_sign,12u#+2appr#,x_height#,0); |
| 399 |
"Small square cap sign"; |
| 400 |
pickup tiny.nib; |
| 401 |
pos1(rth,180); pos4(rth,0); |
| 402 |
top y2r=top y3r=h; bot y1=bot y4=-d; |
| 403 |
top y2r-bot y2l=top y3r-bot y3l=rth; |
| 404 |
lft x1r=w-rt x4r=appr+hround 0.95u; |
| 405 |
x2r=x1r; x3r=x4r; x2l=x1l; x3l=x4l; |
| 406 |
filldraw stroke z1e--z2e--z3e--z4e; |
| 407 |
penlabels(1,2,3,4); |
| 408 |
endchar; |
| 409 |
|
| 410 |
beginchar(sqcup_sign,12u#+2appr#,x_height#,0); |
| 411 |
"Small square cup sign"; |
| 412 |
pickup tiny.nib; |
| 413 |
pos1(rth,180); pos4(rth,0); |
| 414 |
bot y2r=bot y3r=-d; top y1=top y4=h; |
| 415 |
top y2l-bot y2r=top y3l-bot y3r=rth; |
| 416 |
lft x1r=w-rt x4r=appr+hround 0.95u; |
| 417 |
x2r=x1r; x3r=x4r; x2l=x1l; x3l=x4l; |
| 418 |
filldraw stroke z4e--z3e--z2e--z1e; |
| 419 |
penlabels(1,2,3,4); |
| 420 |
endchar; |
| 421 |
|
| 422 |
beginchar(sqcup_plus,12u#+2appr#,x_height#,0); |
| 423 |
"Small square cup-plus sign"; |
| 424 |
pickup tiny.nib; |
| 425 |
ensure_centering_of(rth); |
| 426 |
pos1(rth,180); pos4(rth,0); |
| 427 |
bot y2r=bot y3r=-d; top y1=top y4=h; |
| 428 |
top y2l-bot y2r=top y3l-bot y3r=rth; |
| 429 |
lft x1r=w-rt x4r=appr+hround 0.95u; |
| 430 |
x2r=x1r; x3r=x4r; x2l=x1l; x3l=x4l; |
| 431 |
filldraw stroke z4e--z3e--z2e--z1e; |
| 432 |
% |
| 433 |
pos6(rth,0); pos7(rth,0); pos8(rth,90); pos9(rth,90); |
| 434 |
top y6=h; x6=x7=0.5w; |
| 435 |
numeric a; |
| 436 |
a=0.5(min(lft x4l-rt x1l-1.2u,h-rth-0.6u)-rth); |
| 437 |
y6-y8r=y8l-y7=vround a; x6l-x8=x9-x6r=hround a; y8=y9; |
| 438 |
filldraw stroke z6e..z7e; filldraw stroke z8e..z9e; |
| 439 |
penlabels(1,2,3,4,6,7,8,9); |
| 440 |
endchar; |
| 441 |
|
| 442 |
def tmp_program(expr stem,orientation,$)= |
| 443 |
autorounded; pickup tiny.nib; |
| 444 |
pos1(stem,0); pos2(stem,0); |
| 445 |
pos4(stem,180); pos5(stem,180); |
| 446 |
lft x1l=w-rt x5l=appr+hround $; |
| 447 |
x1l=x2l; x4l=x5l; x3=0.5[x1,x5]; |
| 448 |
if orientation=up: pos3(stem,90); |
| 449 |
top y1=top y5=h; bot y3l=-d-o; |
| 450 |
y2=y4=min(0.25[y1,y3r],y3+0.5(x5-x1)); |
| 451 |
else: pos3(stem,-90); |
| 452 |
bot y1=bot y5=-d; top y3l=h+o; |
| 453 |
y2=y4=max(0.25[y1,y3r],y3-0.5(x5-x1)); |
| 454 |
fi |
| 455 |
filldraw stroke z1e..z2e..controls (x2e,y3e) and (flatness[x3e,x2e],y3e) |
| 456 |
..z3e..controls (flatness[x3e,x4e],y3e) and (x4e,y3e)..z4e..z5e; |
| 457 |
penlabels(1,2,3,4,5); |
| 458 |
enddef; |
| 459 |
|
| 460 |
beginchar(bold_cap,12u#+2appr#,x_height#,0); |
| 461 |
"Bold cap"; |
| 462 |
tmp_program(stem,down,0.8u); |
| 463 |
endchar; |
| 464 |
|
| 465 |
beginchar(bold_cup,12u#+2appr#,x_height#,0); |
| 466 |
"Bold cup"; |
| 467 |
tmp_program(stem,up,0.8u); |
| 468 |
endchar; |
| 469 |
|
| 470 |
% |
| 471 |
% V |
| 472 |
% |
| 473 |
|
| 474 |
beginchar(wedge_sign,12u#+2appr#,x_height#,0); |
| 475 |
"Wedge sign"; |
| 476 |
pickup tiny.nib; |
| 477 |
top y2r=x_height+o; bot y1r=0; y1r=y1l=y3r=y3l; |
| 478 |
x2r=good.x 0.5w; |
| 479 |
x3r-x2r=x2r-x1r=hround((y2r-y1r)/sqrt3); |
| 480 |
x1l-x1r=diag_width(rth-tiny,z2r-z1r); |
| 481 |
x3r-x3l=diag_width(rth-tiny,z2r-z3r); |
| 482 |
z2l-z1l=whatever*(z2r-z1r); z2l-z3l=whatever*(z2r-z3r); |
| 483 |
filldraw stroke z1e--z2e--z3e; penlabels(1,2,3); |
| 484 |
endchar; |
| 485 |
|
| 486 |
beginchar(vee_sign,12u#+2appr#,x_height#,0); |
| 487 |
"Vee sign"; |
| 488 |
pickup tiny.nib; |
| 489 |
bot y2r=-o; top y1r=x_height; y1r=y1l=y3r=y3l; |
| 490 |
x2r=good.x 0.5w; |
| 491 |
x3r-x2r=x2r-x1r=-hround((y2r-y1r)/sqrt3); |
| 492 |
x1l-x1r=diag_width(rth-tiny,z2r-z1r); |
| 493 |
x3r-x3l=diag_width(rth-tiny,z2r-z3r); |
| 494 |
z2l-z1l=whatever*(z2r-z1r); z2l-z3l=whatever*(z2r-z3r); |
| 495 |
filldraw stroke z3e--z2e--z1e; penlabels(1,2,3); |
| 496 |
endchar; |
| 497 |
|
| 498 |
beginchar(wedge_eq,12u#+2appr#,x_height#,0); |
| 499 |
"Wedge-bar sign"; |
| 500 |
pickup tiny.nib; |
| 501 |
top y2r=x_height; bot y1r=0; y1r=y1l=y3r=y3l; |
| 502 |
x2r=good.x 0.5w; |
| 503 |
x3r-x2r=x2r-x1r=hround((y2r-y1r+o)/sqrt3);% see wedge sign (+o) |
| 504 |
x1l-x1r=diag_width(rth-tiny,z2r-z1r); |
| 505 |
x3r-x3l=diag_width(rth-tiny,z2r-z3r); |
| 506 |
z2l-z1l=whatever*(z2r-z1r); z2l-z3l=whatever*(z2r-z3r); |
| 507 |
pos4(rth,90); pos5(rth,90); y4r=y5r=y2r; |
| 508 |
lft x4=min(Appr,lft x1r); x5-x3r=x1r-x4; |
| 509 |
filldraw stroke z1e--z2e--z3e; filldraw stroke z4e..z5e; |
| 510 |
penlabels(1,2,3,4,5); |
| 511 |
endchar; |
| 512 |
|
| 513 |
beginchar(vee_eq,12u#+2appr#,x_height#,0); |
| 514 |
"Vee-bar sign"; |
| 515 |
pickup tiny.nib; |
| 516 |
bot y2r=0; top y1r=x_height; y1r=y1l=y3r=y3l; |
| 517 |
x2r=good.x 0.5w; |
| 518 |
x3r-x2r=x2r-x1r=-hround((y2r-y1r-o)/sqrt3);% see vee sign (-o) |
| 519 |
x1l-x1r=diag_width(rth-tiny,z2r-z1r); |
| 520 |
x3r-x3l=diag_width(rth-tiny,z2r-z3r); |
| 521 |
z2l-z1l=whatever*(z2r-z1r); z2l-z3l=whatever*(z2r-z3r); |
| 522 |
pos4(rth,-90); pos5(rth,-90); y4r=y5r=y2r; |
| 523 |
rt x4=max(w-Appr,rt x1r); x5-x3r=x1r-x4; |
| 524 |
filldraw stroke z3e--z2e--z1e; filldraw stroke z4e..z5e; |
| 525 |
penlabels(1,2,3,4,5); |
| 526 |
endchar; |
| 527 |
|
| 528 |
beginchar(wedge_eqq,12u#+2appr#,asc_height#,0);% strange choice |
| 529 |
"Wedge-equal sign"; |
| 530 |
pickup tiny.nib; |
| 531 |
top y2r=x_height; bot y1r=0; y1r=y1l=y3r=y3l; |
| 532 |
x2r=good.x 0.5w; |
| 533 |
x3r-x2r=x2r-x1r=hround((y2r-y1r+o)/sqrt3);% see wedge sign (+o) |
| 534 |
x1l-x1r=diag_width(rth-tiny,z2r-z1r); |
| 535 |
x3r-x3l=diag_width(rth-tiny,z2r-z3r); |
| 536 |
z2l-z1l=whatever*(z2r-z1r); z2l-z3l=whatever*(z2r-z3r); |
| 537 |
pos4(rth,90); pos5(rth,90); pos6(rth,90); pos7(rth,90); |
| 538 |
y4r=y5r=y2r; y6=y7=y4+spread1; |
| 539 |
lft x4=min(Appr,lft x1r); x5-x3r=x1r-x4; x4=x6; x5=x7; |
| 540 |
filldraw stroke z1e--z2e--z3e; filldraw stroke z4e..z5e; |
| 541 |
filldraw stroke z6e..z7e; penlabels(1,2,3,4,5,6,7); |
| 542 |
endchar; |
| 543 |
|
| 544 |
beginchar(vee_eqq,12u#+2appr#,asc_height#,0);% strange choice |
| 545 |
"Vee-equal sign"; |
| 546 |
pickup tiny.nib; |
| 547 |
bot y2r=0+spread1; top y1r=x_height+spread1; y1r=y1l=y3r=y3l; |
| 548 |
x2r=good.x 0.5w; |
| 549 |
x3r-x2r=x2r-x1r=-hround((y2r-y1r-o)/sqrt3);% see vee sign (-o) |
| 550 |
x1l-x1r=diag_width(rth-tiny,z2r-z1r); |
| 551 |
x3r-x3l=diag_width(rth-tiny,z2r-z3r); |
| 552 |
z2l-z1l=whatever*(z2r-z1r); z2l-z3l=whatever*(z2r-z3r); |
| 553 |
pos4(rth,-90); pos5(rth,-90); pos6(rth,-90); pos7(rth,-90); |
| 554 |
y4r=y5r=y2r; y6=y7=y4-spread1; |
| 555 |
rt x4=max(w-Appr,rt x1r); x5-x3r=x1r-x4; x4=x6; x5=x7; |
| 556 |
filldraw stroke z3e--z2e--z1e; filldraw stroke z4e..z5e; |
| 557 |
filldraw stroke z6e..z7e; penlabels(1,2,3,4,5,6,7); |
| 558 |
endchar; |
| 559 |
|
| 560 |
beginchar(wedge_curly,12u#+2appr#,x_height#,0); |
| 561 |
"Curly wedge sign"; |
| 562 |
pickup tiny.nib; |
| 563 |
x2=hround 0.5(w-rth)+0.5rth; |
| 564 |
top y2=h+o; pos2(rth,0); bot y1r=bot y3l=0; |
| 565 |
lft x1r=hround min(appr+1.0u,lft x2l-((y2r-y1r)/sqrt3)); |
| 566 |
x3l-x2r=x2l-x1r; x1l=x1r; x3l=x3r; |
| 567 |
x4=x2; pos4(rth,0); y4=0.625[y2,y1r]; |
| 568 |
y1l-y1r=y3r-y3l=(rth-tiny)/cosd angle(z4r-z1r); |
| 569 |
filldraw stroke z2e{down}...z1e{z1r-z4r}; |
| 570 |
filldraw stroke z2e{down}...z3e{z3l-z4l}; |
| 571 |
penlabels(1,2,3,4); |
| 572 |
endchar; |
| 573 |
|
| 574 |
beginchar(vee_curly,12u#+2appr#,x_height#,0); |
| 575 |
"Curly vee sign"; |
| 576 |
pickup tiny.nib; |
| 577 |
x2=hround 0.5(w-rth)+0.5rth; |
| 578 |
bot y2=-o; pos2(rth,0); top y1r=top y3l=h; |
| 579 |
lft x1r=hround min(appr+1.0u,lft x2l+((y2r-y1r)/sqrt3)); |
| 580 |
x1l=x1r; x3l=x3r; x3l-x2r=x2l-x1r; |
| 581 |
x4=x2; pos4(rth,0); y4=0.625[y2,y1r]; |
| 582 |
y1r-y1l=y3l-y3r=(rth-tiny)/cosd angle(z4r-z1r); |
| 583 |
filldraw stroke z2e{up}...z1e{z1r-z4r}; |
| 584 |
filldraw stroke z2e{up}...z3e{z3l-z4l}; |
| 585 |
penlabels(1,2,3,4); |
| 586 |
endchar; |
| 587 |
|
| 588 |
beginchar(double_cap_sign, |
| 589 |
12u#+2appr#,cap_height#,0);% maybe too high |
| 590 |
"Double cap sign"; |
| 591 |
pickup tiny.nib; |
| 592 |
pos1(rth,180); pos2(rth,180); |
| 593 |
pos4(rth,0); pos5(rth,0); |
| 594 |
pos6(rth,180); pos7(rth,180); |
| 595 |
pos9(rth,0); pos10(rth,0); |
| 596 |
rt x1l=w-appr; lft x5l=appr; |
| 597 |
numeric a; a=min(spread1,0.25(x1-x5)); |
| 598 |
x1=x2; x4=x5; x6=x7; x9=x10; x3=x8=0.5[x1,x5]; |
| 599 |
x1-x6=x10-x5=hround a; |
| 600 |
bot y1=bot y5=-d-o; bot y6=bot y10=-d; |
| 601 |
y3+0.5rth=h+o; y8-y3=-vround a; |
| 602 |
y2=y4=y7=y9=1/3[y8,y6]; |
| 603 |
filldraw stroke z1e..z2e; filldraw stroke z4e..z5e; |
| 604 |
filldraw stroke z6e..z7e; filldraw stroke z9e..z10e; |
| 605 |
pickup rule.nib; autorounded; |
| 606 |
draw z2 up_to_right z3 right_to_down z4; |
| 607 |
draw z7 up_to_right z8 right_to_down z9; |
| 608 |
penlabels(1,2,3,4,5,6,7,8,9,10); |
| 609 |
endchar; |
| 610 |
|
| 611 |
beginchar(double_cup_sign, |
| 612 |
12u#+2appr#,cap_height#,0);% maybe too high |
| 613 |
"Double cup sign"; |
| 614 |
pickup tiny.nib; |
| 615 |
pos1(rth,0); pos2(rth,0); |
| 616 |
pos4(rth,180); pos5(rth,180); |
| 617 |
pos6(rth,0); pos7(rth,0); |
| 618 |
pos9(rth,180); pos10(rth,180); |
| 619 |
rt x1r=w-appr; lft x5r=appr; |
| 620 |
numeric a; a=min(spread1,0.25(x1-x5)); |
| 621 |
x1=x2; x4=x5; x6=x7; x9=x10; x3=x8=0.5[x1,x5]; |
| 622 |
x1-x6=x10-x5=hround a; |
| 623 |
top y1=top y5=h+o; top y6=top y10=h; |
| 624 |
y3-0.5rth=-d-o; y8-y3=vround a; |
| 625 |
y2=y4=y7=y9=1/3[y8,y6]; |
| 626 |
filldraw stroke z1e..z2e; filldraw stroke z4e..z5e; |
| 627 |
filldraw stroke z6e..z7e; filldraw stroke z9e..z10e; |
| 628 |
pickup rule.nib; autorounded; |
| 629 |
draw z2 down_to_right z3 right_to_up z4; |
| 630 |
draw z7 down_to_right z8 right_to_up z9; |
| 631 |
penlabels(1,2,3,4,5,6,7,8,9,10); |
| 632 |
endchar; |
| 633 |
|
| 634 |
beginchar(double_sqcap_sign, |
| 635 |
12u#+2appr#,cap_height#,0);% maybe too high |
| 636 |
"Double square cap sign"; |
| 637 |
pickup tiny.nib; |
| 638 |
pos1(rth,180); pos3(rth,90); pos5(rth,0); |
| 639 |
pos6(rth,180); pos8(rth,90); pos10(rth,0); |
| 640 |
lft x1r=appr; rt x5r=w-appr; |
| 641 |
numeric a; a=min(spread1,0.25(x5-x1)); |
| 642 |
x6-x1=x5-x10=hround a; x3=x8=0.5[x1,x5]; |
| 643 |
bot y1=bot y5=-d-o; bot y6=bot y10=-d; |
| 644 |
top y3r=h; y8-y3=-vround a; |
| 645 |
forsuffixes $=,r,l: |
| 646 |
x1$=x2$; x4$=x5$; x6$=x7$; x9$=x10$; |
| 647 |
y2$=y3$=y4$; y7$=y8$=y9$; endfor |
| 648 |
filldraw stroke z1e--z2e--z4e--z5e; |
| 649 |
filldraw stroke z6e--z7e--z9e--z10e; |
| 650 |
penlabels(1,2,3,4,5,6,7,8,9,10); |
| 651 |
endchar; |
| 652 |
|
| 653 |
beginchar(double_sqcup_sign, |
| 654 |
12u#+2appr#,cap_height#,0);% maybe too high |
| 655 |
"Double square cup sign"; |
| 656 |
pickup tiny.nib; |
| 657 |
pos1(rth,0); pos3(rth,90); pos5(rth,180); |
| 658 |
pos6(rth,0); pos8(rth,90); pos10(rth,180); |
| 659 |
lft x1l=appr; rt x5l=w-appr; |
| 660 |
numeric a; a=min(spread1,0.25(x5-x1)); |
| 661 |
x6-x1=x5-x10=hround a; x3=x8=0.5[x1,x5]; |
| 662 |
top y1=top y5=h+o; top y6=top y10=h; |
| 663 |
bot y3l=0; y8-y3=vround a; |
| 664 |
forsuffixes $=,r,l: |
| 665 |
x1$=x2$; x4$=x5$; x6$=x7$; x9$=x10$; |
| 666 |
y2$=y3$=y4$; y7$=y8$=y9$; endfor |
| 667 |
filldraw stroke z1e--z2e--z4e--z5e; |
| 668 |
filldraw stroke z6e--z7e--z9e--z10e; |
| 669 |
penlabels(1,2,3,4,5,6,7,8,9,10); |
| 670 |
endchar; |
| 671 |
|
| 672 |
|
| 673 |
|