| 1 |
% mathematical symbols by Anthony Phan. |
| 2 |
% file: mathusym.mf (various unsupported 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 |
enddef; |
| 9 |
|
| 10 |
vardef draw_polygon@#(expr center,n_edges,angle_init,sqrt_area)= |
| 11 |
save a,b; |
| 12 |
x@#=good.x xpart center; y@#=good.y ypart center; |
| 13 |
a=sqrt_area/sqrt((n_edges*cosd(180/n_edges)*sind(180/n_edges))) |
| 14 |
-0.5currentbreadth; |
| 15 |
b=(rth-currentbreadth)/cosd(180/n_edges); |
| 16 |
for $=1 upto n_edges: |
| 17 |
z@#[$]r=z@#+round(a*dir(($-1)*360/n_edges+angle_init)); |
| 18 |
z@#[$]r-z@#[$]l=b*dir(($-1)*360/n_edges+angle_init); |
| 19 |
penlabels(@#[$]); |
| 20 |
endfor |
| 21 |
filldraw stroke for $=1 upto n_edges: z@#[$]e--endfor z@#[1]e; |
| 22 |
enddef; |
| 23 |
|
| 24 |
use_rule1; |
| 25 |
|
| 26 |
% The square root of the total area has been calculated |
| 27 |
% so that circle would fit the bounding box. |
| 28 |
|
| 29 |
beginchar(hex"B0",arithmetic_bounds); |
| 30 |
"Square a"; |
| 31 |
pickup tiny.nib; |
| 32 |
draw_polygon.a((0.5w,math_axis),4,45,6u*sqrt 3.14159); |
| 33 |
labels(a); |
| 34 |
endchar; |
| 35 |
|
| 36 |
beginchar(hex"B1",arithmetic_bounds); |
| 37 |
"Pentagon a"; |
| 38 |
pickup tiny.nib; |
| 39 |
draw_polygon.a((0.5w,math_axis),5,90,6u*sqrt 3.14159); |
| 40 |
labels(a); |
| 41 |
endchar; |
| 42 |
|
| 43 |
beginchar(hex"B2",arithmetic_bounds); |
| 44 |
"Hexagon a"; |
| 45 |
pickup tiny.nib; |
| 46 |
draw_polygon.a((0.5w,math_axis),6,90,6u*sqrt 3.14159); |
| 47 |
labels(a); |
| 48 |
endchar; |
| 49 |
|
| 50 |
beginchar(hex"B3",arithmetic_bounds); |
| 51 |
"Octogon a"; |
| 52 |
pickup tiny.nib; |
| 53 |
draw_polygon.a((0.5w,math_axis),8,22.5,6u*sqrt 3.14159); |
| 54 |
labels(a); |
| 55 |
endchar; |
| 56 |
|
| 57 |
beginchar(hex"B4",arithmetic_bounds); |
| 58 |
"Square b"; |
| 59 |
pickup tiny.nib; |
| 60 |
draw_polygon.a((0.5w,math_axis),4,0,6u*sqrt 3.14159); |
| 61 |
labels(a); |
| 62 |
endchar; |
| 63 |
|
| 64 |
beginchar(hex"B5",arithmetic_bounds); |
| 65 |
"Pentagon b"; |
| 66 |
pickup tiny.nib; |
| 67 |
draw_polygon.a((0.5w,math_axis),5,-90,6u*sqrt 3.14159); |
| 68 |
labels(a); |
| 69 |
endchar; |
| 70 |
|
| 71 |
beginchar(hex"B6",arithmetic_bounds); |
| 72 |
"Hexagon b"; |
| 73 |
pickup tiny.nib; |
| 74 |
draw_polygon.a((0.5w,math_axis),6,0,6u*sqrt 3.14159); |
| 75 |
labels(a); |
| 76 |
endchar; |
| 77 |
|
| 78 |
beginchar(hex"B7",arithmetic_bounds); |
| 79 |
"Octogon b"; |
| 80 |
pickup tiny.nib; |
| 81 |
draw_polygon.a((0.5w,math_axis),8,0,6u*sqrt 3.14159); |
| 82 |
labels(a); |
| 83 |
endchar; |
| 84 |
|
| 85 |
use_rule0; |
| 86 |
|
| 87 |
beginchar(hex"B8",arithmetic_bounds); |
| 88 |
"5-bright-star"; |
| 89 |
pickup tiny.nib; |
| 90 |
draw_star.a((0.5w,math_axis),5,6u,0.05,90,true); |
| 91 |
labels(a); |
| 92 |
endchar; |
| 93 |
|
| 94 |
beginchar(hex"B9",arithmetic_bounds); |
| 95 |
"5-black-star"; |
| 96 |
pickup tiny.nib; |
| 97 |
draw_star.a((0.5w,math_axis),5,6u,0.1,90,false); |
| 98 |
labels(a); |
| 99 |
endchar; |
| 100 |
|
| 101 |
beginchar(hex"BA",arithmetic_bounds); |
| 102 |
"6-bright-star"; |
| 103 |
pickup tiny.nib; |
| 104 |
draw_star.a((0.5w,math_axis),6,6u,0.05,90,true); |
| 105 |
labels(a); |
| 106 |
endchar; |
| 107 |
|
| 108 |
beginchar(hex"BB",arithmetic_bounds); |
| 109 |
"6-black-star"; |
| 110 |
pickup tiny.nib; |
| 111 |
draw_star.a((0.5w,math_axis),6,6u,0.2,90,false); |
| 112 |
labels(a); |
| 113 |
endchar; |
| 114 |
|
| 115 |
use_rule1; |
| 116 |
|
| 117 |
% mathltlk.mf |
| 118 |
|
| 119 |
% |
| 120 |
% Q |
| 121 |
% |
| 122 |
|
| 123 |
beginchar(Q_northwest,13u#+2appr#,cap_height#,0); |
| 124 |
"Q northwest"; |
| 125 |
autorounded; pickup rule.nib; |
| 126 |
top y2=h+o; bot y4=-d-o; lft x3=appr; rt x1=w-appr; |
| 127 |
x2=x4=0.5[x1,x3]; y1=y3=0.5[y2,y4]; |
| 128 |
tmp_path:=superellipse(z1,z2,z3,z4,1/sqrt 2); |
| 129 |
draw tmp_path; pickup tiny.nib; top y5=h; lft x5=appr; |
| 130 |
z5'=tmp_path intersectionpoint ((x2,y1)..z5); |
| 131 |
(sqrt 2)*(z5-z5')=z5'-z6; a:=angle(z5-z6)-90; pos5(rth,a); pos6(rth,a); |
| 132 |
filldraw stroke z5e..z6e; |
| 133 |
labels(1,2,3,4); penlabels(5,6); |
| 134 |
endchar; |
| 135 |
|
| 136 |
beginchar(Q_northeast,13u#+2appr#,cap_height#,0); |
| 137 |
"Q northeast"; |
| 138 |
autorounded; pickup rule.nib; |
| 139 |
top y2=h+o; bot y4=-d-o; lft x3=appr; rt x1=w-appr; |
| 140 |
x2=x4=0.5[x1,x3]; y1=y3=0.5[y2,y4]; |
| 141 |
tmp_path:=superellipse(z1,z2,z3,z4,1/sqrt 2); |
| 142 |
draw tmp_path; pickup tiny.nib; top y5=h; rt x5=w-appr; |
| 143 |
z5'=tmp_path intersectionpoint ((x2,y1)..z5); |
| 144 |
(sqrt 2)*(z5-z5')=z5'-z6; a:=angle(z5-z6)-90; pos5(rth,a); pos6(rth,a); |
| 145 |
filldraw stroke z5e..z6e; |
| 146 |
labels(1,2,3,4); penlabels(5,6); |
| 147 |
endchar; |
| 148 |
|
| 149 |
beginchar(Q_southwest,13u#+2appr#,cap_height#,0); |
| 150 |
"Q southwest"; |
| 151 |
autorounded; pickup rule.nib; |
| 152 |
top y2=h+o; bot y4=-d-o; lft x3=appr; rt x1=w-appr; |
| 153 |
x2=x4=0.5[x1,x3]; y1=y3=0.5[y2,y4]; |
| 154 |
tmp_path:=superellipse(z1,z2,z3,z4,1/sqrt 2); |
| 155 |
draw tmp_path; pickup tiny.nib; bot y5=-d; lft x5=appr; |
| 156 |
z5'=tmp_path intersectionpoint ((x2,y1)..z5); |
| 157 |
(sqrt 2)*(z5-z5')=z5'-z6; a:=angle(z5-z6)-90; pos5(rth,a); pos6(rth,a); |
| 158 |
filldraw stroke z5e..z6e; |
| 159 |
labels(1,2,3,4); penlabels(5,6); |
| 160 |
endchar; |
| 161 |
|
| 162 |
beginchar(Q_southeast,13u#+2appr#,cap_height#,0); |
| 163 |
"Q southeast"; |
| 164 |
autorounded; pickup rule.nib; |
| 165 |
top y2=h+o; bot y4=-d-o; lft x3=appr; rt x1=w-appr; |
| 166 |
x2=x4=0.5[x1,x3]; y1=y3=0.5[y2,y4]; |
| 167 |
tmp_path:=superellipse(z1,z2,z3,z4,1/sqrt 2); |
| 168 |
draw tmp_path; pickup tiny.nib; bot y5=-d; rt x5=w-appr; |
| 169 |
z5'=tmp_path intersectionpoint ((x2,y1)..z5); |
| 170 |
(sqrt 2)*(z5-z5')=z5'-z6; a:=angle(z5-z6)-90; pos5(rth,a); pos6(rth,a); |
| 171 |
filldraw stroke z5e..z6e; |
| 172 |
labels(1,2,3,4); penlabels(5,6); |
| 173 |
endchar; |
| 174 |
|
| 175 |
% |
| 176 |
% Z |
| 177 |
% |
| 178 |
|
| 179 |
vardef tmp_program(expr stem,radius, |
| 180 |
up_adjustment,bot_adjustment)= |
| 181 |
pickup tiny.nib; save R,a,c,s; |
| 182 |
pos1(stem,90); pos2(stem,90); pos3(stem,0); |
| 183 |
pos6(stem,0); pos7(stem,90); pos8(stem,90); |
| 184 |
bot y1l=bot y2l=y0-radius=y3-radius=-d; |
| 185 |
top y7r=top y8r=y0'+radius=y6+radius=h; |
| 186 |
rt x1+hround bot_adjustment=rt x6r=w-appr; |
| 187 |
x0'=x7=w-appr-radius; |
| 188 |
lft x3l=lft x8-hround up_adjustment=appr; |
| 189 |
x0=x2=appr+radius; |
| 190 |
a=0.5length(z0'-z0); R=radius-0.5stem; |
| 191 |
c=0.5((R/a)*(abs(x0'-x0)/a)-(abs(y0'-y0)/a)*((a+-+R)/a)); |
| 192 |
s=1+-+c; z5-z0'=-R*(c,s); z4-z0=R*(c,s); |
| 193 |
pos4(stem,angle(-c,-s)); pos5(stem,angle(-c,-s)); |
| 194 |
filldraw stroke z1e..z2e left_to_up z3e...z4e |
| 195 |
---z5e...z6e up_to_left z7e..z8e; |
| 196 |
penlabels(1,2,3,4,5,6,7,8); labels(0,0'); |
| 197 |
enddef; |
| 198 |
|
| 199 |
beginchar(Bourbaki_Z,12u#+2appr#,cap_height#,0); |
| 200 |
"Bourbaki's Z"; |
| 201 |
tmp_program(cap_stem,1.6cap_stem,1.2*0.6u,1.2*0.3u); |
| 202 |
endchar; |
| 203 |
|
| 204 |
beginchar(bBourbaki_Z,16u#+2appr#,0,10/6dh#); |
| 205 |
"Bourbaki's Z"; |
| 206 |
tmp_program(round 1.2cap_curve,1.6*1.2cap_curve,1.6*0.6u,1.6*0.3u); |
| 207 |
endchar; |
| 208 |
|
| 209 |
beginchar(BBourbaki_Z,22u#+2appr#,0,14/6dh#); |
| 210 |
"Bourbaki's Z"; |
| 211 |
tmp_program(round 1.4cap_curve,1.6*1.4cap_curve,2.2*0.6u,2.2*0.3u); |
| 212 |
endchar; |
| 213 |
|
| 214 |
% mathsymb.mf |
| 215 |
|
| 216 |
beginchar(nuclear_sign,arithmetic_bounds); |
| 217 |
"Nuclear sign"; |
| 218 |
a:=0.13; t:=1.6; |
| 219 |
autorounded; |
| 220 |
pickup null.nib; |
| 221 |
adjust_dot1((0.5w,0.5[-d,h]),dtsz,true,true); |
| 222 |
dot(1,1'); |
| 223 |
pickup rule.nib0; |
| 224 |
top y7=top y4=h; bot y2=bot y9=-d; |
| 225 |
lft x5=lft x8=appr; rt x6=rt x3=w-appr; |
| 226 |
y5=y6=a[y2,y4]; y3=y8=a[y4,y2]; |
| 227 |
x2=x7=a[x5,x6]; x4=x9=a[x6,x5]; |
| 228 |
draw z2{right}..tension atleast t..z3{up}...z4{left} |
| 229 |
..tension atleast t..z5{down}...cycle; |
| 230 |
draw z6{up}..tension atleast t..z7{left}...z8{down} |
| 231 |
..tension atleast t..z9{right}...cycle; |
| 232 |
labels(2,3,4,5,4,5,6,7,8,9); |
| 233 |
endchar; |
| 234 |
|
| 235 |
% SMILES AND FROWNS |
| 236 |
|
| 237 |
use_rule1; |
| 238 |
|
| 239 |
beginchar(smile_small,12u#+2appr#,v_center(spread1#+rth#)); |
| 240 |
"Small smile sign"; |
| 241 |
pickup tiny.nib; |
| 242 |
pos2(rth,90); |
| 243 |
y2=math_axis-0.5spread1; y1l=y3l=y2l+spread1; |
| 244 |
lft x1l=appr; rt x3l=w-appr; x2=0.5[x1l,x3l]; |
| 245 |
z1'-z1l=(z2l-z1l) xscaled 1/3; |
| 246 |
z3'-z3l=(z2l-z3l) xscaled 1/3; |
| 247 |
pos1(rth,angle(z1'-z1l)+90); |
| 248 |
pos3(rth,angle(z3'-z3l)-90); |
| 249 |
filldraw stroke z1e{z1'-z1l}...z2e{right}...z3e{z3l-z3'}; |
| 250 |
penlabels(1,2,3); labels(1',3'); |
| 251 |
endchar; |
| 252 |
|
| 253 |
beginchar(frown_small,12u#+2appr#,v_center(spread1#+rth#)); |
| 254 |
"Small frown sign"; |
| 255 |
pickup tiny.nib; |
| 256 |
pos2(rth,90); |
| 257 |
y2=math_axis+0.5spread1; y1r=y3r=y2r-spread1; |
| 258 |
lft x1r=appr; rt x3r=w-appr; x2=0.5[x1r,x3r]; |
| 259 |
z1'-z1r=(z2r-z1r) xscaled 1/3; |
| 260 |
z3'-z3r=(z2r-z3r) xscaled 1/3; |
| 261 |
pos1(rth,angle(z1'-z1r)+90); |
| 262 |
pos3(rth,angle(z3'-z3r)-90); |
| 263 |
filldraw stroke z1e{z1'-z1r}...z2e{right}...z3e{z3r-z3'}; |
| 264 |
penlabels(1,2,3); labels(1',3'); |
| 265 |
endchar; |
| 266 |
|
| 267 |
make_sim_picture; |
| 268 |
|
| 269 |
beginchar(sim_sim_bar,12u#+2appr#,v_center(3spread1#+2rth#)); |
| 270 |
"Similarity-similarity-bar sign"; |
| 271 |
currentpicture:=(sim_picture shifted(0,spread1+rth))+ |
| 272 |
sim_picture;% shifted(0,-0.5(spread1+rth)); |
| 273 |
pickup tiny.nib; |
| 274 |
pos1(rth,90); pos2(rth,90); |
| 275 |
lft x1=Appr; rt x2=w-Appr; y1=y2=math_axis-1.5spread1; |
| 276 |
filldraw stroke z1e..z2e; penlabels(1,2); |
| 277 |
tmp_picture:=currentpicture; |
| 278 |
endchar; |
| 279 |
|
| 280 |
beginchar(sim_sim_not_bar,12u#+2appr#,asc_height#,asc_depth#); |
| 281 |
"Not similarity-similarity_bar sign"; |
| 282 |
currentpicture:=tmp_picture; |
| 283 |
pickup tiny.nib; |
| 284 |
lft x2l-appr=w-appr-rt x1r=hround 1.75u; |
| 285 |
top y1r=h+eps; 0.5[bot y2l,top y1r]=math_axis; |
| 286 |
adjust_slanted_bar(2l,1r,2r,1l)(rth-tiny,-1); |
| 287 |
filldraw stroke z2e..z1e; penlabels(1,2); |
| 288 |
endchar; |
| 289 |
|
| 290 |
beginchar(bar_sim,12u#+2appr#,v_center(2spread1#+rth#)); |
| 291 |
"Bar-similarity sign"; |
| 292 |
currentpicture:=sim_picture shifted(0,-vround 0.5spread1); |
| 293 |
pickup tiny.nib; |
| 294 |
pos1(rth,90); pos2(rth,90); |
| 295 |
lft x1=Appr; rt x2=w-Appr; y1=y2=math_axis+spread1; |
| 296 |
filldraw stroke z1e..z2e; penlabels(1,2); |
| 297 |
tmp_picture:=currentpicture; |
| 298 |
endchar; |
| 299 |
|
| 300 |
beginchar(bar_sim_not,arithmetic_bounds); |
| 301 |
"Not bar-similarity sign"; |
| 302 |
currentpicture:=tmp_picture; |
| 303 |
pickup tiny.nib; |
| 304 |
lft x2l-Appr=w-Appr-rt x1r=hround 1.75u; |
| 305 |
top y1r=h+eps; 0.5[bot y2l,top y1r]=math_axis; |
| 306 |
adjust_slanted_bar(2l,1r,2r,1l)(rth-tiny,-1); |
| 307 |
filldraw stroke z1e..z2e; penlabels(1,2); |
| 308 |
endchar; |
| 309 |
|
| 310 |
beginchar(sim_vert,arithmetic_bounds); |
| 311 |
"Sim-vert sign"; |
| 312 |
currentpicture:=sim_picture rotatedaround((0.5w,math_axis),90); |
| 313 |
endchar; |
| 314 |
|
| 315 |
beginchar(sim_reverse,12u#+2appr#,v_center(spread1#+rth#)); |
| 316 |
"Sim-reverse sign"; |
| 317 |
currentpicture:=sim_picture reflectedabout((0.5w,0),(0.5w,h)); |
| 318 |
endchar; |
| 319 |
|
| 320 |
beginchar(sim_reverse_bar,12u#+2appr#,v_center(2spread1#+rth#)); |
| 321 |
"Sim-reverse-bar sign"; |
| 322 |
currentpicture:=sim_picture reflectedabout((0.5w,0),(0.5w,h)) |
| 323 |
shifted(0,vround 0.5spread1); |
| 324 |
pickup tiny.nib; |
| 325 |
pos1(rth,90); pos2(rth,90); |
| 326 |
lft x1=Appr; rt x2=w-Appr; y1=y2=math_axis-spread1; |
| 327 |
filldraw stroke z1e..z2e; penlabels(1,2); |
| 328 |
endchar; |
| 329 |
|
| 330 |
beginchar(reverse_negation_sign,12u#+2appr#,v_center(spread1#+rth#)); |
| 331 |
"Reverse negation sign"; |
| 332 |
pickup tiny.nib; |
| 333 |
pos1(rth,-90); pos3(rth,0); |
| 334 |
y2r=y1r; y2l=y1l; x2l=x3l; x2r=x3r; |
| 335 |
y1=math_axis+0.5spread1; y1r-y3=spread1; |
| 336 |
rt x1=w-Appr; lft x3l=Appr; |
| 337 |
filldraw stroke z1e--z2e--z3e; |
| 338 |
penlabels(1,2,3); |
| 339 |
endchar; |
| 340 |
|
| 341 |
beginchar(smash_product_sign,arithmetic_bounds); |
| 342 |
"Smash product sign"; |
| 343 |
pickup tiny.nib; |
| 344 |
top y1r=top y5l=h+eps; bot y4l=bot y8r=-d-eps; |
| 345 |
lft x3l=lft x6l=appr-eps; rt x2r=rt x7r=w-appr+eps; |
| 346 |
y1r-y3l=y5r-y7l=y6l-y8r=y2r-y4l=vround((spread1+rth-tiny)/sqrt 2); |
| 347 |
x1r-x3l=x7r-x5l=x8r-x6l=x2r-x4l=hround((spread1+rth-tiny)/sqrt 2); |
| 348 |
pos1(rth,45); pos2(rth,45); pos3(rth,45); pos4(rth,45); |
| 349 |
pos5(rth,-45); pos6(rth,-45); pos7(rth,-45); pos8(rth,-45); |
| 350 |
filldraw stroke z1e..z2e; filldraw stroke z3e..z4e; |
| 351 |
filldraw stroke z5e..z6e; filldraw stroke z7e..z8e; |
| 352 |
penlabels(1,2,3,4,5,6,7,8); |
| 353 |
endchar; |
| 354 |
|
| 355 |
% The next design is taken from my favorite pen: |
| 356 |
% a Omas' Paragon. |
| 357 |
|
| 358 |
beginchar(greek_motive,24u#,body_height#,0); |
| 359 |
"Decorative greek motive"; |
| 360 |
numeric a,b; a=2max(hround 0.5rth1,1); |
| 361 |
b=a*(1++slant); |
| 362 |
pickup pencircle scaled a; |
| 363 |
if 0.5w<>good.x 0.5w: change_width; fi |
| 364 |
x21=x22=good.x 0.5w; |
| 365 |
x1=x3=x5l=x6l=-1; x2=x4=x20l=x19l=w+1; |
| 366 |
x7=x8=good.x 0.75[x1,x21]; x17=x18=x21+(x21-x7); |
| 367 |
x9=x10=good.x 0.5[x1,x21]; x15=x16=x21+(x21-x9); |
| 368 |
x11=x12=good.x 0.25[x1,x21]; x13=x14=x21+(x21-x11); |
| 369 |
y1r=y2r=h; y3l=y4l=-d; penpos1(a,90); |
| 370 |
penpos2(a,90); penpos3(a,90); penpos4(a,90); |
| 371 |
penpos5(0.5b+1,0); penpos20(0.5b+1,180); |
| 372 |
penpos21(b,0); penpos22(b,0); |
| 373 |
y6=y7=y18=y19=good.y 0.2[y3,y1]; y22=bot y6; |
| 374 |
y12=y21=y13=good.y 0.8[y3,y1]; y5=y20=top y12; |
| 375 |
y10=y11=y14=y15=good.y 0.3[y6,y12]; |
| 376 |
y8=y9=y16=y17=good.y 0.7[y6,y12]; |
| 377 |
forsuffixes $=6,7,12,13,18,19: |
| 378 |
y$r-y$l=a; z$=0.5[z$r,z$l]; endfor |
| 379 |
forsuffixes $=8,9,10,11,14,15,16,17: |
| 380 |
y$l-y$r=a; z$=0.5[z$r,z$l]; endfor |
| 381 |
forsuffixes $=9,10,13,14,17,18: |
| 382 |
x$r-x$l=b; endfor |
| 383 |
x6r-x6l=x19l-x19r=0.5b+1; |
| 384 |
forsuffixes $=7,8,11,12,15,16: |
| 385 |
x$l-x$r=b; endfor |
| 386 |
penstroke z1e..z2e; penstroke z3e..z4e; penstroke z21e..z22e; |
| 387 |
penstroke z5e--z6e--z7e--z8e--z9e--z10e--z11e-- |
| 388 |
z12e--z13e--z14e--z15e--z16e--z17e--z18e--z19e--z20e; |
| 389 |
penlabels(range 1 thru 22); |
| 390 |
endchar; |
| 391 |
|
| 392 |
% The next motive appears in ITC's Kokoa font. |
| 393 |
% The designer (Jochen Schuss) has been inspired by |
| 394 |
% a trip in Ghana. It is therefore possible that |
| 395 |
% this design is not copyright since it may be |
| 396 |
% a traditionnal one. |
| 397 |
|
| 398 |
beginchar(ghanean_motive,14u#,body_height#,body_depth#); |
| 399 |
"Decorative ghanean motive"; |
| 400 |
numeric a; a=2max(hround 0.5rth1,1); |
| 401 |
pickup pencircle scaled a; |
| 402 |
if 0.5w<>good.x 0.5w: change_width; fi |
| 403 |
numeric b; b=vround((h+d)/7); |
| 404 |
x2=x3=x8l=x15l=x21l=0.5w; |
| 405 |
x1r=x5r=x12r=x19l=x20l=0; |
| 406 |
x4r=x11r=x18r=x23l=x22l=w; |
| 407 |
y1r=y4r=h; |
| 408 |
y1r-y5r=y5r-y12r=y12r-y19l=b; |
| 409 |
y4r-y11r=y11r-y18r=y18r-y23l=b; |
| 410 |
y3-y8l=y8l-y15l=y15l-y21l=b; |
| 411 |
y1r-y2=y2-y3=y19l-y20l=y23l-y22l=2b; |
| 412 |
x6=x7=good.x 2/3[x1r,x2]; x9=x10=x2+(x2-x6); |
| 413 |
x13=x14=good.x 1/3[x1r,x2]; x16=x17=x2+(x2-x13); |
| 414 |
forsuffixes $=2,3,6,7,13,14: |
| 415 |
x$r-x$l=a; x$=0.5[x$r,x$l]; |
| 416 |
endfor |
| 417 |
forsuffixes $=10,9,17,16: |
| 418 |
x$r-x$l=-a; x$=0.5[x$r,x$l]; |
| 419 |
endfor |
| 420 |
numeric b,c; |
| 421 |
b=a/abs cosd angle(z2-z1r); |
| 422 |
c=a/abs cosd angle(z2-z4r); |
| 423 |
penpos1(b,90); penpos5(b,90); penpos12(b,90); |
| 424 |
penpos4(c,90); penpos11(c,90); penpos18(c,90); |
| 425 |
x19r-x19l=x20r-x20l=x23l-x23r=x22l-x22r=0.5a; |
| 426 |
% |
| 427 |
z21r-(z21l+z1r-z1l)=whatever*(z2-z1r); |
| 428 |
z21r-(z21l+z4r-z4l)=whatever*(z2-z4r); |
| 429 |
z8r-z8l=z15r-z15l=z21r-z21l; |
| 430 |
% |
| 431 |
z2l-z1l=whatever*(z2-z1r); z3-z3l=whatever*(z2-z1r); |
| 432 |
z6r-z5r=whatever*(z2-z1r); z6l-z5l=whatever*(z2-z1r); |
| 433 |
z8r-z7r=whatever*(z2-z1r); z8l-z7l=whatever*(z2-z1r); |
| 434 |
z13r-z12r=whatever*(z2-z1r); z13l-z12l=whatever*(z2-z1r); |
| 435 |
z15r-z14r=whatever*(z2-z1r); z15l-z14l=whatever*(z2-z1r); |
| 436 |
z19r-z19l=whatever*(z2-z1r); |
| 437 |
z21r-z20r=whatever*(z2-z1r);% z21l-z20l=whatever*(z2-z1r); |
| 438 |
% |
| 439 |
z2r-z4l=whatever*(z2-z4r); z3-z3r=whatever*(z2-z4r); |
| 440 |
z10r-z11r=whatever*(z2-z4r); z10l-z11l=whatever*(z2-z4r); |
| 441 |
z8r-z9r=whatever*(z2-z4r); z8l-z9l=whatever*(z2-z4r); |
| 442 |
z17r-z18r=whatever*(z2-z4r); z17l-z18l=whatever*(z2-z4r); |
| 443 |
z15r-z16r=whatever*(z2-z4r); z15l-z16l=whatever*(z2-z4r); |
| 444 |
z23r-z23l=whatever*(z2-z4r); |
| 445 |
z21r-z22r=whatever*(z2-z4r);% z21l-z22l=whatever*(z2-z4r); |
| 446 |
% |
| 447 |
fill z1r--z2--z4r--z4l--z2r--z3r--z3--z3l--z2l--z1l--cycle; |
| 448 |
penstroke z5e--z6e--z7e--z8e--z9e--z10e--z11e; |
| 449 |
penstroke z12e--z13e--z14e--z15e--z16e--z17e--z18e; |
| 450 |
penstroke z19e--z20e--z21e--z22e--z23e; |
| 451 |
penlabels(range 1 thru 23); |
| 452 |
endchar; |
| 453 |
|
| 454 |
% |
| 455 |
% doted symbols |
| 456 |
% |
| 457 |
|
| 458 |
beginchar(cap_dot,12u#+2appr#,x_height#,0); |
| 459 |
"Small cap with dot sign"; |
| 460 |
pickup tiny.nib; |
| 461 |
pos1(rth,180); pos2(rth,180); |
| 462 |
pos4(rth,0); pos5(rth,0); |
| 463 |
y3+0.5rth=h+o; bot y1r=bot y5r=-d; y2=y4=2/3[y3,y1r]; |
| 464 |
lft x1r=w-rt x5r=appr+hround 0.8u; |
| 465 |
x1=x2; x4=x5; x3=0.5[x2,x4]; |
| 466 |
filldraw stroke z1e..z2e; filldraw stroke z4e..z5e; |
| 467 |
pickup rule.nib; autorounded; |
| 468 |
draw z2 up_to_right z3 right_to_down z4; |
| 469 |
penlabels(1,2,3,4,5); |
| 470 |
adjust_dot6((0.5w,h-math_axis),dtsz,false,true); |
| 471 |
dot(6,6'); |
| 472 |
endchar; |
| 473 |
|
| 474 |
beginchar(cup_dot,12u#+2appr#,x_height#,0); |
| 475 |
"Small cup with dot sign"; |
| 476 |
pickup tiny.nib; |
| 477 |
pos1(rth,180); pos2(rth,180); |
| 478 |
pos4(rth,0); pos5(rth,0); |
| 479 |
y3-0.5rth=-d-o; top y1r=top y5r=h; y2=y4=2/3[y3,y1r]; |
| 480 |
lft x1r=w-rt x5r=appr+hround 0.8u; |
| 481 |
x1=x2; x4=x5; x3=0.5[x2,x4]; |
| 482 |
filldraw stroke z5e..z4e; filldraw stroke z2e..z1e; |
| 483 |
pickup rule.nib; autorounded; |
| 484 |
draw z2 down_to_right z3 right_to_up z4; |
| 485 |
penlabels(1,2,3,4,5); |
| 486 |
adjust_dot6((0.5w,math_axis),dtsz,false,true); |
| 487 |
dot(6,6'); |
| 488 |
endchar; |
| 489 |
|
| 490 |
beginchar(sqcap_dot,12u#+2appr#,x_height#,0); |
| 491 |
"Small square cap with dot sign"; |
| 492 |
pickup tiny.nib; |
| 493 |
pos1(rth,180); pos4(rth,0); |
| 494 |
top y2r=top y3r=h; bot y1=bot y4=-d; |
| 495 |
top y2r-bot y2l=top y3r-bot y3l=rth; |
| 496 |
lft x1r=w-rt x4r=appr+hround 0.95u; |
| 497 |
x2r=x1r; x3r=x4r; x2l=x1l; x3l=x4l; |
| 498 |
filldraw stroke z1e--z2e--z3e--z4e; |
| 499 |
penlabels(1,2,3,4); |
| 500 |
adjust_dot5((0.5w,h-math_axis),dtsz,false,true); |
| 501 |
dot(5,5'); |
| 502 |
endchar; |
| 503 |
|
| 504 |
beginchar(sqcup_dot,12u#+2appr#,x_height#,0); |
| 505 |
"Small square cup with dot sign"; |
| 506 |
pickup tiny.nib; |
| 507 |
pos1(rth,180); pos4(rth,0); |
| 508 |
bot y2r=bot y3r=-d; top y1=top y4=h; |
| 509 |
top y2l-bot y2r=top y3l-bot y3r=rth; |
| 510 |
lft x1r=w-rt x4r=appr+hround 0.95u; |
| 511 |
x2r=x1r; x3r=x4r; x2l=x1l; x3l=x4l; |
| 512 |
filldraw stroke z4e--z3e--z2e--z1e; |
| 513 |
penlabels(1,2,3,4); |
| 514 |
adjust_dot5((0.5w,math_axis),dtsz,false,true); |
| 515 |
dot(5,5'); |
| 516 |
endchar; |