| 1 |
% mathematical symbols by Anthony Phan. |
| 2 |
% file: mathbdel.mf (big delimiters) |
| 3 |
% last modification: May 16, 2005. |
| 4 |
% Only known charcodes will be generated. |
| 5 |
|
| 6 |
def horizontal_rules_list = |
| 7 |
0.5[-d, h]-math_axis, 0.5[-d, h]-math_axis+x_height, |
| 8 |
0.25[-d, h], 0.5[-d, h], 0.75[-d, h] enddef; |
| 9 |
|
| 10 |
% Since I thinck that adjust_fit's strategy is too |
| 11 |
% complex, I just cut actual width in three parts: |
| 12 |
% ``visible'' width, ``internal'' adjustment and |
| 13 |
% finally ``external'' adjustment. Letter_fit# is |
| 14 |
% added automatically (there is no use of appr#'s). |
| 15 |
|
| 16 |
vardef set_width(expr inner_sharp, internal_sharp, external_sharp) = |
| 17 |
internal_adjustment := hround((internal_sharp+letter_fit#)*hppp); |
| 18 |
external_adjustment := hround((external_sharp+letter_fit#)*hppp); |
| 19 |
inner_sharp+internal_sharp+external_sharp+2letter_fit# |
| 20 |
enddef; |
| 21 |
|
| 22 |
% PARENTHESIS (look at cm) |
| 23 |
|
| 24 |
def tmp_program(expr orientation, hair, stem, do_top, do_bot) = |
| 25 |
pickup fine.nib; |
| 26 |
pos1(hround hair, 0); pos2(hround stem, 0); pos3(hround hair, 0); |
| 27 |
if orientation = left: |
| 28 |
rt x1r = rt x3r = hround(w-internal_adjustment-0.25u+0.5hair); |
| 29 |
lft x2l = external_adjustment+hround 0.25u; |
| 30 |
else: |
| 31 |
lft x1l = lft x3l = hround(internal_adjustment+0.25u-0.5hair); |
| 32 |
rt x2r = w-external_adjustment-hround 0.25u; |
| 33 |
fi |
| 34 |
if do_top and do_bot: |
| 35 |
top y1 = h; bot y3 = -d; y2 = 0.5[y1, y3]; |
| 36 |
filldraw stroke z1e{3(x2e-x1e), y2-y1}...z2e{down} |
| 37 |
...{3(x3e-x2e), y3-y2}z3e; |
| 38 |
elseif do_top: |
| 39 |
top y1 = h; y2 = -d-eps; |
| 40 |
filldraw stroke z1e{3(x2e-x1e), y2-y1}...z2e{down}; |
| 41 |
elseif do_bot: |
| 42 |
y2 = h+eps; bot y3 = -d; |
| 43 |
filldraw stroke z2e{down}...{3(x3e-x2e), y3-y2}z3e; |
| 44 |
else: |
| 45 |
pos2'(hround stem, 0); x2' = x2; |
| 46 |
y2 = h+eps; y2' = -d-eps; |
| 47 |
filldraw stroke z2e..z2'e; |
| 48 |
fi |
| 49 |
penlabels(1, 2, 3, 2'); |
| 50 |
enddef; |
| 51 |
|
| 52 |
beginchar(paren_left, |
| 53 |
5u#+2appr#, body_height#, paren_depth#); |
| 54 |
"Left parenthesis"; |
| 55 |
% italcorr body_height#*slant-0.5u#; |
| 56 |
pickup fine.nib; |
| 57 |
pos1(vair, 0); pos2(0.75[hair, stem], 0); pos3(vair, 0); |
| 58 |
rt x1r = rt x3r = w-appr; lft x2l = hround(x1-4u); |
| 59 |
top y1 = h; y2 = 0.5[y1, y3] = math_axis; |
| 60 |
filldraw stroke z1e{3(x2e-x1e), y2-y1}...z2e{down} |
| 61 |
...{3(x3e-x2e), y3-y2}z3e; |
| 62 |
penlabels(1, 2, 3); |
| 63 |
endchar; |
| 64 |
|
| 65 |
beginchar(paren_left_big, %7u#, |
| 66 |
set_width(5u#, (1-0.25)*u#, (1+1.5)*u#), rth.frac#, 2dh#-rth.frac#); |
| 67 |
"big left parenthesis"; |
| 68 |
% adjust_fit(1.5u#, -.25u#); |
| 69 |
tmp_program(left, hair, stem, true, true); |
| 70 |
endchar; |
| 71 |
|
| 72 |
beginchar(paren_left_Big, %9u#, |
| 73 |
set_width(7u#, (1-0.25)*u#, (1+2)*u#), rth.frac#, 3dh#-rth.frac#); |
| 74 |
"Big left parenthesis"; |
| 75 |
% adjust_fit(2u#, -.25u#); |
| 76 |
tmp_program(left, rth1, .5[stem, bold], true, true); |
| 77 |
endchar; |
| 78 |
|
| 79 |
beginchar(paren_left_bigg, %11u#, |
| 80 |
set_width(9u#, (1-0.25)*u#, (1+2.5)*u#), rth.frac#, 4dh#-rth.frac#); |
| 81 |
"bigg left parenthesis"; |
| 82 |
% adjust_fit(2.5u#, -.25u#); |
| 83 |
tmp_program(left, rth1+.2dw, bold, true, true); |
| 84 |
endchar; |
| 85 |
|
| 86 |
beginchar(paren_left_Bigg, %11.5u#, |
| 87 |
set_width(9.5u#, (1-0.25)*u#, (1+3)*u#), rth.frac#, 5dh#-rth.frac#); |
| 88 |
"Bigg left parenthesis"; |
| 89 |
% adjust_fit(3u#, -.25u#); |
| 90 |
tmp_program(left, rth1+.4dw, bold+dw, true, true); |
| 91 |
endchar; |
| 92 |
|
| 93 |
beginchar(paren_left_top, %12u#, |
| 94 |
set_width(10u#, (1-0.25)*u#, (1+4)*u#), rth.frac#, 3dh#-rth.frac#); |
| 95 |
"left perenthesis' extension top"; |
| 96 |
% adjust_fit(4u#, -.25u#); pickup fine.nib; |
| 97 |
tmp_program(left, rth1+.6dw, bold+2dw, true, false); |
| 98 |
endchar; |
| 99 |
|
| 100 |
beginchar(paren_left_bot, %12u#, |
| 101 |
set_width(10u#, (1-0.25)*u#, (1+4)*u#), rth.frac#, 3dh#-rth.frac#); |
| 102 |
"left parenthesis' extension bot"; |
| 103 |
% adjust_fit(4u#, -.25u#); pickup fine.nib; |
| 104 |
tmp_program(left, rth1+.6dw, bold+2dw, false, true); |
| 105 |
endchar; |
| 106 |
|
| 107 |
beginchar(paren_left_mid, %12u#, |
| 108 |
set_width(10u#, (1-0.25)*u#, (1+4)*u#), 0, dh#); |
| 109 |
"left parenthesis' extension mid"; |
| 110 |
% adjust_fit(4u#, -.25u#); pickup fine.nib; |
| 111 |
tmp_program(left, rth1+.6dw, bold+2dw, false, false); |
| 112 |
endchar; |
| 113 |
|
| 114 |
beginchar(paren_right, |
| 115 |
5u#+2appr#, body_height#, paren_depth#); |
| 116 |
"Right parenthesis"; |
| 117 |
% italcorr math_axis#*slant-0.5u#; |
| 118 |
pickup fine.nib; |
| 119 |
pos1(vair, 0); pos2(0.75[hair, stem], 0); pos3(vair, 0); |
| 120 |
lft x1l = lft x3l = appr; rt x2r = hround(x1+4u); |
| 121 |
top y1 = h; y2 = 0.5[y1, y3] = math_axis; |
| 122 |
filldraw stroke z1e{3(x2e-x1e), y2-y1}...z2e{down} |
| 123 |
...{3(x3e-x2e), y3-y2}z3e; |
| 124 |
penlabels(1, 2, 3); |
| 125 |
endchar; |
| 126 |
|
| 127 |
beginchar(paren_right_big, %7u#, |
| 128 |
set_width(5u#, (1-0.25)*u#, (1+1.5)*u#), rth.frac#, 2dh#-rth.frac#); |
| 129 |
"big right parenthesis"; |
| 130 |
% adjust_fit(-.25u#, 1.5u#); |
| 131 |
tmp_program(right, hair, stem, true, true); |
| 132 |
endchar; |
| 133 |
|
| 134 |
beginchar(paren_right_Big, %9u#, |
| 135 |
set_width(7u#, (1-0.25)*u#, (1+2)*u#), rth.frac#, 3dh#-rth.frac#); |
| 136 |
"Big right parenthesis"; |
| 137 |
% adjust_fit(-.25u#, 2u#); |
| 138 |
tmp_program(right, rth1, .5[stem, bold], true, true); |
| 139 |
endchar; |
| 140 |
|
| 141 |
beginchar(paren_right_bigg, %11u#, |
| 142 |
set_width(9u#, (1-0.25)*u#, (1+2.5)*u#), rth.frac#, 4dh#-rth.frac#); |
| 143 |
"bigg right parenthesis"; |
| 144 |
% adjust_fit(-.25u#, 2.5u#); |
| 145 |
tmp_program(right, rth1+.2dw, bold, true, true); |
| 146 |
endchar; |
| 147 |
|
| 148 |
beginchar(paren_right_Bigg, %11.5u#, |
| 149 |
set_width(9.5u#, (1-0.25)*u#, (1+3)*u#), rth.frac#, 5dh#-rth.frac#); |
| 150 |
"Bigg right parenthesis"; |
| 151 |
% adjust_fit(-.25u#, 3u#); |
| 152 |
tmp_program(right, rth1+.4dw, bold+dw, true, true); |
| 153 |
endchar; |
| 154 |
|
| 155 |
beginchar(paren_right_top, %12u#, |
| 156 |
set_width(10u#, (1-0.25)*u#, (1.4)*u#), rth.frac#, 3dh#-rth.frac#); |
| 157 |
"right parenthesis' extension top"; |
| 158 |
% adjust_fit(-.25u#, 4u#); pickup fine.nib; |
| 159 |
tmp_program(right, rth1+.6dw, bold+2dw, true, false); |
| 160 |
endchar; |
| 161 |
|
| 162 |
beginchar(paren_right_bot, %12u#, |
| 163 |
set_width(10u#, (1-0.25)*u#, (1+4)*u#), rth.frac#, 3dh#-rth.frac#); |
| 164 |
"right parenthesis' extension top"; |
| 165 |
% adjust_fit(-.25u#, 4u#); pickup fine.nib; |
| 166 |
tmp_program(right, rth1+.6dw, bold+2dw, false, true); |
| 167 |
endchar; |
| 168 |
|
| 169 |
beginchar(paren_right_mid, %12u#, |
| 170 |
set_width(10u#, (1-0.25)*u#, (1.4)*u#), 0, dh#); |
| 171 |
"big right parenthesis' extension mid"; |
| 172 |
% adjust_fit(-.25u#, 4u#); pickup fine.nib; |
| 173 |
tmp_program(right, rth1+.6dw, bold+2dw, false, false); |
| 174 |
endchar; |
| 175 |
|
| 176 |
% BRACKETS |
| 177 |
|
| 178 |
def tmp_program(expr orientation, stem, rth, do_top, do_bot, not_ext) = |
| 179 |
pickup tiny.nib; |
| 180 |
pos1(hround stem, 0); pos2(hround stem, 0); |
| 181 |
pos3(vround rth, 90); pos4(vround rth, 90); |
| 182 |
pos5(vround rth, 90); pos6(vround rth, 90); |
| 183 |
if do_top or not_ext: top y1 = h; else: y1 = h+eps; fi |
| 184 |
if do_bot or not_ext: bot y2 = -d; else: y2 = -d-eps; fi |
| 185 |
y1 = y3r = y4r; y2 = y5l = y6l; |
| 186 |
if orientation = left: |
| 187 |
lft x1l = lft x2l = min(external_adjustment, hround 0.5(w-stem)); |
| 188 |
rt x3r = rt x5l = w-internal_adjustment; |
| 189 |
x4r = x1r; x6l = x2r; |
| 190 |
else: |
| 191 |
rt x1r = rt x2r = max(w-external_adjustment, hround 0.5(w+stem)); |
| 192 |
lft x4r = lft x6l = internal_adjustment; |
| 193 |
x3r = x1l; x5l = x2l; |
| 194 |
fi |
| 195 |
filldraw stroke z1e--z2e; |
| 196 |
if do_top: filldraw stroke z3e--z4e; fi |
| 197 |
if do_bot: filldraw stroke z5e--z6e; fi |
| 198 |
penlabels(1, 2, 3, 4, 5, 6); |
| 199 |
enddef; |
| 200 |
|
| 201 |
% HALF BRACKETS (true heights or depths are to be discussed) |
| 202 |
|
| 203 |
% okay |
| 204 |
beginchar(bracket_upper_left, |
| 205 |
set_width(4u#, 0.2u#, 2u#), body_height#, paren_depth#); |
| 206 |
"Upper left bracket"; |
| 207 |
a := d; d := -vround 0.75[-d, h]; |
| 208 |
tmp_program(left, 0[0.95stem, 0.95cap_stem], |
| 209 |
rth0, true, false, true); |
| 210 |
d := a; |
| 211 |
endchar; |
| 212 |
|
| 213 |
% okay |
| 214 |
beginchar(bracket_lower_left, |
| 215 |
set_width(4u#, 0.2u#, 2u#), body_height#, paren_depth#); |
| 216 |
"Lower left bracket"; |
| 217 |
a := h; h := vround 0.25[-d, h]; |
| 218 |
tmp_program(left, 0[0.95stem, 0.95cap_stem], |
| 219 |
rth0, false, true, true); |
| 220 |
h := a; |
| 221 |
endchar; |
| 222 |
|
| 223 |
% okay |
| 224 |
beginchar(bracket_upper_right, |
| 225 |
set_width(4u#, 0.2u#, 2u#), body_height#, paren_depth#); |
| 226 |
"Upper right bracket"; |
| 227 |
a := d; d := -vround 0.75[-d, h]; |
| 228 |
tmp_program(right, 0[0.95stem, 0.95cap_stem], |
| 229 |
rth0, true, false, true); |
| 230 |
d := a; |
| 231 |
endchar; |
| 232 |
|
| 233 |
% okay |
| 234 |
beginchar(bracket_lower_right, |
| 235 |
set_width(4u#, 0.2u#, 2u#), body_height#, paren_depth#); |
| 236 |
"Lower right bracket"; |
| 237 |
a := h; h := vround 0.25[-d, h]; |
| 238 |
tmp_program(right, 0[0.95stem, 0.95cap_stem], |
| 239 |
rth0, false, true, true); |
| 240 |
h := a; |
| 241 |
endchar; |
| 242 |
|
| 243 |
% okay |
| 244 |
beginchar(bracket_upper_lower_left, |
| 245 |
set_width(4u#, 0.2u#, 2u#), body_height#, paren_depth#); |
| 246 |
"Upper lower left bracket"; |
| 247 |
a := d; d := -vround 0.75[-d, h]; |
| 248 |
tmp_program(left, 0[0.95stem, 0.95cap_stem], |
| 249 |
rth0, true, false, true); |
| 250 |
d := a; |
| 251 |
clearxy; |
| 252 |
a := h; h := vround 0.25[-d, h]; |
| 253 |
tmp_program(left, 0[0.95stem, 0.95cap_stem], |
| 254 |
rth0, false, true, true); |
| 255 |
h := a; |
| 256 |
endchar; |
| 257 |
|
| 258 |
% okay |
| 259 |
beginchar(bracket_upper_lower_right, |
| 260 |
set_width(4u#, 0.2u#, 2u#), body_height#, paren_depth#); |
| 261 |
"Upper lower right bracket"; |
| 262 |
a := d; d := -vround 0.75[-d, h]; |
| 263 |
tmp_program(right, 0[0.95stem, 0.95cap_stem], |
| 264 |
rth0, true, false, true); |
| 265 |
d := a; |
| 266 |
clearxy; |
| 267 |
a := h; h := vround 0.25[-d, h]; |
| 268 |
tmp_program(right, 0[0.95stem, 0.95cap_stem], |
| 269 |
rth0, false, true, true); |
| 270 |
h := a; |
| 271 |
endchar; |
| 272 |
|
| 273 |
% okay |
| 274 |
beginchar(bracket_left, |
| 275 |
set_width(4u#, 0.2u#, 2u#), body_height#, paren_depth#); |
| 276 |
"Left bracket"; |
| 277 |
tmp_program(left, 0[0.95stem, 0.95cap_stem], |
| 278 |
rth0, true, true, true); |
| 279 |
endchar; |
| 280 |
|
| 281 |
beginchar(bracket_left_big, |
| 282 |
set_width(4.5u#, 0.4u#, 2.5u#), rth.frac#, 2dh#-rth.frac#); |
| 283 |
"big left bracket"; |
| 284 |
tmp_program(left, 0.125[0.95stem, 0.95cap_stem], |
| 285 |
0.125[rth0, rth1], true, true, true); |
| 286 |
endchar; |
| 287 |
|
| 288 |
beginchar(bracket_left_Big, |
| 289 |
set_width(5u#, 0.6u#, 3u#), rth.frac#, 3dh#-rth.frac#); |
| 290 |
"Big left bracket"; |
| 291 |
tmp_program(left, 0.25[0.95stem, 0.95cap_stem], |
| 292 |
0.25[rth0, rth1], true, true, true); |
| 293 |
endchar; |
| 294 |
|
| 295 |
beginchar(bracket_left_bigg, |
| 296 |
set_width(5.5u#, 0.8u#, 3.5u#), rth.frac#, 4dh#-rth.frac#); |
| 297 |
"bigg left bracket"; |
| 298 |
tmp_program(left, 0.5[0.95stem, 0.95cap_stem], |
| 299 |
0.5[rth0, rth1], true, true, true); |
| 300 |
endchar; |
| 301 |
|
| 302 |
beginchar(bracket_left_Bigg, |
| 303 |
set_width(6u#, 1.00u#, 4u#), rth.frac#, 5dh#-rth.frac#); |
| 304 |
"Bigg left bracket"; |
| 305 |
tmp_program(left, 0.75[0.95stem, 0.95cap_stem], |
| 306 |
0.75[rth0, rth1], true, true, true); |
| 307 |
endchar; |
| 308 |
|
| 309 |
beginchar(bracket_left_top, |
| 310 |
set_width(7u#, 1.5u#, 5u#), rth.frac#, 3dh#-rth.frac#); |
| 311 |
"left bracket's extension top"; |
| 312 |
tmp_program(left, 0.95cap_stem, rth1, true, false, false); |
| 313 |
endchar; |
| 314 |
|
| 315 |
beginchar(bracket_left_bot, |
| 316 |
set_width(7u#, 1.5u#, 5u#), rth.frac#, 3dh#-rth.frac#); |
| 317 |
"left bracket's extension bottom"; |
| 318 |
tmp_program(left, 0.95cap_stem, rth1, false, true, false); |
| 319 |
endchar; |
| 320 |
|
| 321 |
beginchar(bracket_left_mid, |
| 322 |
set_width(7u#, 1.5u#, 5u#), 0, dh#); |
| 323 |
"left bracket's extension module"; |
| 324 |
tmp_program(left, 0.95cap_stem, rth1, false, false, false); |
| 325 |
endchar; |
| 326 |
|
| 327 |
% okay |
| 328 |
beginchar(bracket_right, |
| 329 |
set_width(4u#, 0.2u#, 2u#), body_height#, paren_depth#); |
| 330 |
"Right bracket"; |
| 331 |
tmp_program(right, 0[0.95stem, 0.95cap_stem], |
| 332 |
rth0, true, true, true); |
| 333 |
endchar; |
| 334 |
|
| 335 |
beginchar(bracket_right_big, |
| 336 |
set_width(4.5u#, 0.4u#, 2.5u#), rth.frac#, 2dh#-rth.frac#); |
| 337 |
"big right bracket"; |
| 338 |
tmp_program(right, 0.125[0.95stem, 0.95cap_stem], |
| 339 |
0.125[rth0, rth1], true, true, true); |
| 340 |
endchar; |
| 341 |
|
| 342 |
beginchar(bracket_right_Big, |
| 343 |
set_width(5u#, 0.6u#, 3u#), rth.frac#, 3dh#-rth.frac#); |
| 344 |
"Big right bracket"; |
| 345 |
tmp_program(right, 0.25[0.95stem, 0.95cap_stem], |
| 346 |
0.25[rth0, rth1], true, true, true); |
| 347 |
endchar; |
| 348 |
|
| 349 |
beginchar(bracket_right_bigg, |
| 350 |
set_width(5.5u#, 0.80u#, 3.5u#), rth.frac#, 4dh#-rth.frac#); |
| 351 |
"bigg right bracket"; |
| 352 |
tmp_program(right, 0.5[0.95stem, 0.95cap_stem], |
| 353 |
0.5[rth0, rth1], true, true, true); |
| 354 |
endchar; |
| 355 |
|
| 356 |
beginchar(bracket_right_Bigg, |
| 357 |
set_width(6u#, 1.00u#, 4u#), rth.frac#, 5dh#-rth.frac#); |
| 358 |
"Bigg right bracket"; |
| 359 |
tmp_program(right, 0.75[0.95stem, 0.95cap_stem], |
| 360 |
0.75[rth0, rth1], true, true, true); |
| 361 |
endchar; |
| 362 |
|
| 363 |
beginchar(bracket_right_top, |
| 364 |
set_width(7u#, 1.5u#, 5u#), rth.frac#, 3dh#-rth.frac#); |
| 365 |
"right bracket's extension top"; |
| 366 |
tmp_program(right, 0.95cap_stem, rth1, true, false, false); |
| 367 |
endchar; |
| 368 |
|
| 369 |
beginchar(bracket_right_bot, |
| 370 |
set_width(7u#, 1.5u#, 5u#), rth.frac#, 3dh#-rth.frac#); |
| 371 |
"right bracket's extension bottom"; |
| 372 |
tmp_program(right, 0.95cap_stem, rth1, false, true, false); |
| 373 |
endchar; |
| 374 |
|
| 375 |
beginchar(bracket_right_mid, |
| 376 |
set_width(7u#, 1.5u#, 5u#), 0, dh#); |
| 377 |
"right bracket's extension module"; |
| 378 |
tmp_program(right, 0.95cap_stem, rth1, false, false, false); |
| 379 |
endchar; |
| 380 |
|
| 381 |
% okay |
| 382 |
beginchar(ceiling_left, |
| 383 |
set_width(4u#, 0.2u#, 2u#), body_height#, paren_depth#); |
| 384 |
"Left ceiling"; |
| 385 |
tmp_program(left, 0[0.95stem, 0.95cap_stem], |
| 386 |
rth0, true, false, true); |
| 387 |
endchar; |
| 388 |
|
| 389 |
beginchar(ceiling_left_big, |
| 390 |
set_width(4.5u#, 0.4u#, 2.5u#), rth.frac#, 2dh#-rth.frac#); |
| 391 |
"big left ceiling"; |
| 392 |
tmp_program(left, 0.125[0.95stem, 0.95cap_stem], |
| 393 |
0.125[rth0, rth1], true, false, true); |
| 394 |
endchar; |
| 395 |
|
| 396 |
beginchar(ceiling_left_Big, |
| 397 |
set_width(5u#, 0.6u#, 3u#), rth.frac#, 3dh#-rth.frac#); |
| 398 |
"Big left ceiling"; |
| 399 |
tmp_program(left, 0.25[0.95stem, 0.95cap_stem], |
| 400 |
0.25[rth0, rth1], true, false, true); |
| 401 |
endchar; |
| 402 |
|
| 403 |
beginchar(ceiling_left_bigg, |
| 404 |
set_width(5.5u#, 0.8u#, 3.5u#), rth.frac#, 4dh#-rth.frac#); |
| 405 |
"bigg left ceiling"; |
| 406 |
tmp_program(left, 0.5[0.95stem, 0.95cap_stem], |
| 407 |
0.5[rth0, rth1], true, false, true); |
| 408 |
endchar; |
| 409 |
|
| 410 |
beginchar(ceiling_left_Bigg, |
| 411 |
set_width(6u#, 1.00u#, 4u#), rth.frac#, 5dh#-rth.frac#); |
| 412 |
"Bigg left ceiling"; |
| 413 |
tmp_program(left, 0.75[0.95stem, 0.95cap_stem], |
| 414 |
0.75[rth0, rth1], true, false, true); |
| 415 |
endchar; |
| 416 |
|
| 417 |
% okay |
| 418 |
beginchar(ceiling_right, |
| 419 |
set_width(4u#, 0.2u#, 2u#), body_height#, paren_depth#); |
| 420 |
"Right ceiling"; |
| 421 |
tmp_program(right, 0[0.95stem, 0.95cap_stem], rth0, true, false, true); |
| 422 |
endchar; |
| 423 |
|
| 424 |
beginchar(ceiling_right_big, |
| 425 |
set_width(4.5u#, 0.4u#, 2.5u#), rth.frac#, 2dh#-rth.frac#); |
| 426 |
"big right ceiling"; |
| 427 |
tmp_program(right, 0.125[0.95stem, 0.95cap_stem], |
| 428 |
0.125[rth0, rth1], true, false, true); |
| 429 |
endchar; |
| 430 |
|
| 431 |
beginchar(ceiling_right_Big, |
| 432 |
set_width(5u#, 0.6u#, 3u#), rth.frac#, 3dh#-rth.frac#); |
| 433 |
"Big right ceiling"; |
| 434 |
tmp_program(right, 0.25[0.95stem, 0.95cap_stem], |
| 435 |
0.25[rth0, rth1], true, false, true); |
| 436 |
endchar; |
| 437 |
|
| 438 |
beginchar(ceiling_right_bigg, |
| 439 |
set_width(5.5u#, 0.80u#, 3.5u#), rth.frac#, 4dh#-rth.frac#); |
| 440 |
"bigg right ceiling"; |
| 441 |
tmp_program(right, 0.5[0.95stem, 0.95cap_stem], |
| 442 |
0.5[rth0, rth1], true, false, true); |
| 443 |
endchar; |
| 444 |
|
| 445 |
beginchar(ceiling_right_Bigg, |
| 446 |
set_width(6u#, 1.00u#, 4u#), rth.frac#, 5dh#-rth.frac#); |
| 447 |
"Bigg right ceiling"; |
| 448 |
tmp_program(right, 0.75[0.95stem, 0.95cap_stem], |
| 449 |
0.75[rth0, rth1], true, false, true); |
| 450 |
endchar; |
| 451 |
|
| 452 |
% okay |
| 453 |
beginchar(floor_left, |
| 454 |
set_width(4u#, 0.2u#, 2u#), body_height#, paren_depth#); |
| 455 |
"Left floor"; |
| 456 |
tmp_program(left, 0[0.95stem, 0.95cap_stem], |
| 457 |
rth0, false, true, true); |
| 458 |
endchar; |
| 459 |
|
| 460 |
beginchar(floor_left_big, |
| 461 |
set_width(4.5u#, 0.4u#, 2.5u#), rth.frac#, 2dh#-rth.frac#); |
| 462 |
"big left floor"; |
| 463 |
tmp_program(left, 0.125[0.95stem, 0.95cap_stem], |
| 464 |
0.125[rth0, rth1], false, true, true); |
| 465 |
endchar; |
| 466 |
|
| 467 |
beginchar(floor_left_Big, |
| 468 |
set_width(5u#, 0.6u#, 3u#), rth.frac#, 3dh#-rth.frac#); |
| 469 |
"Big left floor"; |
| 470 |
tmp_program(left, 0.25[0.95stem, 0.95cap_stem], |
| 471 |
0.25[rth0, rth1], false, true, true); |
| 472 |
endchar; |
| 473 |
|
| 474 |
beginchar(floor_left_bigg, |
| 475 |
set_width(5.5u#, 0.8u#, 3.5u#), rth.frac#, 4dh#-rth.frac#); |
| 476 |
"bigg left floor"; |
| 477 |
tmp_program(left, 0.5[0.95stem, 0.95cap_stem], |
| 478 |
0.5[rth0, rth1], false, true, true); |
| 479 |
endchar; |
| 480 |
|
| 481 |
beginchar(floor_left_Bigg, |
| 482 |
set_width(6u#, 1.00u#, 4u#), rth.frac#, 5dh#-rth.frac#); |
| 483 |
"Bigg left floor"; |
| 484 |
tmp_program(left, 0.75[0.95stem, 0.95cap_stem], |
| 485 |
0.75[rth0, rth1], false, true, true); |
| 486 |
endchar; |
| 487 |
|
| 488 |
% okay |
| 489 |
beginchar(floor_right, |
| 490 |
set_width(4u#, 0.2u#, 2u#), body_height#, paren_depth#); |
| 491 |
"Right floor"; |
| 492 |
tmp_program(right, 0[0.95stem, 0.95cap_stem], |
| 493 |
rth0, false, true, true); |
| 494 |
endchar; |
| 495 |
|
| 496 |
beginchar(floor_right_big, |
| 497 |
set_width(4.5u#, 0.4u#, 2.5u#), rth.frac#, 2dh#-rth.frac#); |
| 498 |
"big right floor"; |
| 499 |
tmp_program(right, 0.125[0.95stem, 0.95cap_stem], |
| 500 |
0.125[rth0, rth1], false, true, true); |
| 501 |
endchar; |
| 502 |
|
| 503 |
beginchar(floor_right_Big, |
| 504 |
set_width(5u#, 0.6u#, 3u#), rth.frac#, 3dh#-rth.frac#); |
| 505 |
"Big right floor"; |
| 506 |
tmp_program(right, 0.25[0.95stem, 0.95cap_stem], |
| 507 |
0.25[rth0, rth1], false, true, true); |
| 508 |
endchar; |
| 509 |
|
| 510 |
beginchar(floor_right_bigg, |
| 511 |
set_width(5.5u#, 0.80u#, 3.5u#), rth.frac#, 4dh#-rth.frac#); |
| 512 |
"bigg right floor"; |
| 513 |
tmp_program(right, 0.5[0.95stem, 0.95cap_stem], |
| 514 |
0.5[rth0, rth1], false, true, true); |
| 515 |
endchar; |
| 516 |
|
| 517 |
beginchar(floor_right_Bigg, |
| 518 |
set_width(6u#, 1.00u#, 4u#), rth.frac#, 5dh#-rth.frac#); |
| 519 |
"Bigg right floor"; |
| 520 |
tmp_program(right, 0.75[0.95stem, 0.95cap_stem], |
| 521 |
0.75[rth0, rth1], false, true, true); |
| 522 |
endchar; |
| 523 |
|
| 524 |
% BRACES |
| 525 |
|
| 526 |
def tmp_program(expr orientation, stem, hair, factor, superness) = |
| 527 |
pickup fine.nib; |
| 528 |
if orientation = left: |
| 529 |
rt x5l = w-internal_adjustment; |
| 530 |
lft x1 = external_adjustment; |
| 531 |
else: |
| 532 |
lft x5l = internal_adjustment; |
| 533 |
rt x1 = w-external_adjustment; |
| 534 |
fi |
| 535 |
x3 = 0.5[x1, x5l]; |
| 536 |
y1+0.5hair = vround(0.5[-d, h]+0.5hair); pos1(hround hair, 90); |
| 537 |
top y5r = h+eps; y3 = 0.5[y1l, y5r]; y2 = y2l = y1l; y1r = y2r; |
| 538 |
x2 = factor[x3, x5l]; a := 0.5[angle(z3-z2), 90]; pos5(hair, a); |
| 539 |
pos3(stem, angle(z3-z2) if orientation = left: + else: - fi 90); |
| 540 |
forsuffixes $ = r, l: |
| 541 |
z2$-z3$ = whatever*(z2-z3); |
| 542 |
z4$-z3$ = whatever*(z2-z3); |
| 543 |
z4$-z5$ = whatever*dir(a+90); |
| 544 |
forsuffixes @ = 1, 2, 3, 4, 5: |
| 545 |
x@'.$ = x@.$; y@'.$-y1 = y1-y@.$; |
| 546 |
endfor |
| 547 |
endfor |
| 548 |
autorounded; |
| 549 |
filldraw stroke z1e{x5e-x1e, 0}... |
| 550 |
(z2e+(1-superness)*(z1e-z2e)+(1-superness)*(z3e-z2e)){z3e-z1e} |
| 551 |
...z3e{z3e-z2e}... |
| 552 |
(z4e+(1-superness)*(z3e-z4e)+(1-superness)*(z5e-z4e)){z5e-z3e} |
| 553 |
...z5e{z5e-z4e}; |
| 554 |
filldraw stroke z1'e{x5'e-x1'e, 0}... |
| 555 |
(z2'e+(1-superness)*(z1'e-z2'e)+(1-superness)*(z3'e-z2'e)){z3'e-z1'e} |
| 556 |
...z3'e{z3'e-z2'e}... |
| 557 |
(z4'e+(1-superness)*(z3'e-z4'e)+(1-superness)*(z5'e-z4'e)){z5'e-z3'e} |
| 558 |
...z5'e{z5'e-z4'e}; |
| 559 |
% filldraw stroke z1e{x5e-x1e, 0}.. |
| 560 |
% controls 0.5[z1e, z2e] and z2e ..z3e.. |
| 561 |
% controls z4e and 0.5[z5e, z4e] ..z5e; |
| 562 |
% filldraw stroke z1'e{x5'e-x1'e, 0}.. |
| 563 |
% controls 0.5[z1'e, z2'e] and z2'e ..z3'e.. |
| 564 |
% controls z4'e and 0.5[z5'e, z4'e] ..z5'e; |
| 565 |
penlabels(1, 2, 3, 4, 5, 1', 2', 3', 4', 5'); |
| 566 |
enddef; |
| 567 |
|
| 568 |
beginchar(brace_left, |
| 569 |
set_width(5u#, 1.5u#, 1.5u#), body_height#, paren_depth#); |
| 570 |
"left brace"; |
| 571 |
tmp_program(left, 0[stem, cap_stem], |
| 572 |
0[hair, rth1], 0.5, superness); |
| 573 |
endchar; |
| 574 |
|
| 575 |
beginchar(brace_left_big, |
| 576 |
set_width(6u#, 1.75*u#, 1.75*u#), rth.frac#, 2dh#-rth.frac#); |
| 577 |
"big left brace"; |
| 578 |
tmp_program(left, 0.125[stem, cap_stem], |
| 579 |
0.125[hair, rth1], 0.5, superness); |
| 580 |
endchar; |
| 581 |
|
| 582 |
beginchar(brace_left_Big, |
| 583 |
set_width(7u#, 2*u#, 2*u#), rth.frac#, 3dh#-rth.frac#); |
| 584 |
"Big left brace"; |
| 585 |
tmp_program(left, 0.25[stem, cap_stem], |
| 586 |
0.25[hair, rth1], 0.5, superness); |
| 587 |
endchar; |
| 588 |
|
| 589 |
beginchar(brace_left_bigg, |
| 590 |
set_width(8u#, 2.25*u#, 2.25*u#), rth.frac#, 4dh#-rth.frac#); |
| 591 |
"bigg left brace"; |
| 592 |
tmp_program(left, 0.5[stem, cap_stem], |
| 593 |
0.5[hair, rth1], 0.5, superness); |
| 594 |
endchar; |
| 595 |
|
| 596 |
beginchar(brace_left_Bigg, |
| 597 |
set_width(9u#, 2.5*u#, 2.5*u#), rth.frac#, 5dh#-rth.frac#); |
| 598 |
"Bigg left brace"; |
| 599 |
tmp_program(left, 0.75[stem, cap_stem], |
| 600 |
0.75[hair, rth1], 0.5, superness); |
| 601 |
endchar; |
| 602 |
|
| 603 |
beginchar(brace_left_top, |
| 604 |
set_width(10u#, 3*u#, 3*u#), 0, 1.5dh#); |
| 605 |
"left brace's extension top"; |
| 606 |
a := cap_stem; |
| 607 |
pickup fine.nib; |
| 608 |
top y1l = h; top y1l-y2 = 0.5(h+d); y3 = -d-eps; |
| 609 |
rt x1 = w-internal_adjustment; |
| 610 |
x2 = x3 = hround(0.5[external_adjustment, w-internal_adjustment]-0.5a)+0.5a; |
| 611 |
pos1(rth1, -90); pos2(a, 0); pos3(a, 0); |
| 612 |
filldraw stroke z1e left_to_down z2e..z3e; |
| 613 |
penlabels(1, 2, 3); |
| 614 |
endchar; |
| 615 |
|
| 616 |
beginchar(brace_left_bot, |
| 617 |
set_width(10u#, 3*u#, 3*u#), 0, 1.5dh#); |
| 618 |
"left brace's extension bot"; |
| 619 |
a := cap_stem; |
| 620 |
pickup fine.nib; |
| 621 |
y1 = h+eps; y2-bot y3l = 0.5(h+d); bot y3l = -d; |
| 622 |
rt x3 = w-internal_adjustment; |
| 623 |
x1 = x2 = hround(0.5[external_adjustment, w-internal_adjustment]-0.5a)+0.5a; |
| 624 |
pos1(a, 0); pos2(a, 0); pos3(rth1, 90); |
| 625 |
filldraw stroke z1e..z2e down_to_right z3e; |
| 626 |
penlabels(1, 2, 3); |
| 627 |
endchar; |
| 628 |
|
| 629 |
beginchar(brace_left_mid, |
| 630 |
set_width(10u#, 3*u#, 3*u#), 0, 3dh#); |
| 631 |
"left brace's extension mid"; |
| 632 |
a := cap_stem; |
| 633 |
pickup fine.nib; |
| 634 |
y1 = h+eps; |
| 635 |
y3+0.5rth1 = vround(0.5[-d, h]+0.5rth1); |
| 636 |
y2-bot y3r = top y3l-y4 = 0.25(h+d); y5 = -d-eps; |
| 637 |
x1 = x2 = x4 = x5 = hround(0.5[external_adjustment, w-internal_adjustment]-0.5a)+0.5a; |
| 638 |
lft x3 = external_adjustment; |
| 639 |
pos1(a, 0); pos2(a, 0); pos3(rth1, -90); pos4(a, 180); pos5(a, 180); |
| 640 |
filldraw stroke z1e..z2e down_to_left z3e; |
| 641 |
filldraw stroke z3e right_to_down z4e..z5e; |
| 642 |
penlabels(1, 2, 3, 4, 5); |
| 643 |
endchar; |
| 644 |
|
| 645 |
beginchar(brace_left_mod, |
| 646 |
set_width(10u#, 3*u#, 3*u#), 0, 0.5dh#); |
| 647 |
"left brace's extension module"; |
| 648 |
a := cap_stem; |
| 649 |
pickup fine.nib; y1 = h+eps; y2 = -d-eps; |
| 650 |
x1 = x2 = hround(0.5[external_adjustment, w-internal_adjustment]-0.5a)+0.5a; |
| 651 |
pos1(a, 0); pos2(a, 0); filldraw stroke z1e..z2e; penlabels(1, 2); |
| 652 |
endchar; |
| 653 |
|
| 654 |
beginchar(brace_right, |
| 655 |
set_width(5u#, 1.5u#, 1.5u#), body_height#, paren_depth#); |
| 656 |
"Right brace"; |
| 657 |
internal_adjustment := appr+hround 0.5u; |
| 658 |
external_adjustment := appr+hround 0.5u; |
| 659 |
tmp_program(right, 0[stem, cap_stem], |
| 660 |
0[hair, rth1], 0.5, superness); |
| 661 |
endchar; |
| 662 |
|
| 663 |
beginchar(brace_right_big, |
| 664 |
set_width(6u#, 1.75*u#, 1.75*u#), rth.frac#, 2dh#-rth.frac#); |
| 665 |
"big right brace"; |
| 666 |
tmp_program(right, 0.125[stem, cap_stem], |
| 667 |
0.125[hair, rth1], 0.5, superness); |
| 668 |
endchar; |
| 669 |
|
| 670 |
beginchar(brace_right_Big, |
| 671 |
set_width(7u#, 2*u#, 2*u#), rth.frac#, 3dh#-rth.frac#); |
| 672 |
"Big right brace"; |
| 673 |
tmp_program(right, 0.25[stem, cap_stem], |
| 674 |
0.25[hair, rth1], 0.5, superness); |
| 675 |
endchar; |
| 676 |
|
| 677 |
beginchar(brace_right_bigg, |
| 678 |
set_width(8u#, 2.25*u#, 2.25*u#), rth.frac#, 4dh#-rth.frac#); |
| 679 |
"bigg right brace"; |
| 680 |
tmp_program(right, 0.5[stem, cap_stem], |
| 681 |
0.5[hair, rth1], 0.5, superness); |
| 682 |
endchar; |
| 683 |
|
| 684 |
beginchar(brace_right_Bigg, |
| 685 |
set_width(9u#, 2.5*u#, 2.5*u#), rth.frac#, 5dh#-rth.frac#); |
| 686 |
"Bigg right brace"; |
| 687 |
tmp_program(right, 0.75[stem, cap_stem], |
| 688 |
0.75[hair, rth1], 0.5, superness); |
| 689 |
endchar; |
| 690 |
|
| 691 |
beginchar(brace_right_top, |
| 692 |
set_width(10u#, 3*u#, 3*u#), 0, 1.5dh#); |
| 693 |
"right brace's extension top"; |
| 694 |
a := cap_stem; |
| 695 |
pickup fine.nib; |
| 696 |
top y1r = h; top y1r-y2 = 0.5(h+d); y3 = -d-eps; |
| 697 |
lft x1 = internal_adjustment; |
| 698 |
x2 = x3 = hround(0.5[internal_adjustment, w-external_adjustment]-0.5a)+0.5a; |
| 699 |
pos1(rth1, 90); pos2(a, 0); pos3(a, 0); |
| 700 |
filldraw stroke z1e right_to_down z2e..z3e; |
| 701 |
penlabels(1, 2, 3); |
| 702 |
endchar; |
| 703 |
|
| 704 |
beginchar(brace_right_bot, |
| 705 |
set_width(10u#, 3*u#, 3*u#), 0, 1.5dh#); |
| 706 |
"right brace's extension bot"; |
| 707 |
a := cap_stem; |
| 708 |
pickup fine.nib; |
| 709 |
y1 = h+eps; y2-bot y3r = 0.5(h+d); bot y3r = -d; |
| 710 |
lft x3 = internal_adjustment; |
| 711 |
x1 = x2 = hround(0.5[internal_adjustment, w-external_adjustment]-0.5a)+0.5a; |
| 712 |
pos1(a, 0); pos2(a, 0); pos3(rth1, -90); |
| 713 |
filldraw stroke z1e..z2e down_to_left z3e; |
| 714 |
penlabels(1, 2, 3); |
| 715 |
endchar; |
| 716 |
|
| 717 |
beginchar(brace_right_mid, |
| 718 |
set_width(10u#, 3*u#, 3*u#), 0, 3dh#); |
| 719 |
"right brace's extension mid"; |
| 720 |
a := cap_stem; |
| 721 |
pickup fine.nib; |
| 722 |
y1 = h+eps; |
| 723 |
y3+0.5rth1 = vround(0.5[-d, h]+0.5rth1); |
| 724 |
y2-bot y3l = top y3r-y4 = 0.25(h+d); |
| 725 |
y5 = -d-eps; |
| 726 |
x1 = x2 = x4 = x5 = hround(0.5[internal_adjustment, w-external_adjustment]-0.5a)+0.5a; |
| 727 |
rt x3 = w-external_adjustment; |
| 728 |
pos1(a, 0); pos2(a, 0); pos3(rth1, 90); pos4(a, 180); pos5(a, 180); |
| 729 |
filldraw stroke z1e..z2e down_to_right z3e; |
| 730 |
filldraw stroke z3e right_to_down z4e..z5e; |
| 731 |
penlabels(1, 2, 3, 4, 5); |
| 732 |
endchar; |
| 733 |
|
| 734 |
beginchar(brace_right_mod, |
| 735 |
set_width(10u#, 3*u#, 3*u#), 0, 0.5dh#); |
| 736 |
"right brace's extension module"; |
| 737 |
a := cap_stem; |
| 738 |
pickup fine.nib; y1 = h+eps; y2 = -d-eps; |
| 739 |
x1 = x2 = hround(0.5[internal_adjustment, w-external_adjustment]-0.5a)+0.5a; |
| 740 |
pos1(a, 0); pos2(a, 0); filldraw stroke z1e..z2e; penlabels(1, 2); |
| 741 |
endchar; |
| 742 |
|
| 743 |
% ANGLES |
| 744 |
|
| 745 |
def tmp_program(expr orientation, rth) = |
| 746 |
pickup tiny.nib; |
| 747 |
top y1r = h+eps; y2l = good.y 0.5[-d, h]; y1r-y2l = y2l-y3r; |
| 748 |
if orientation = left: |
| 749 |
rt x1r = rt x3r = w-internal_adjustment+eps; |
| 750 |
lft x2l = external_adjustment-eps; |
| 751 |
adjust_slanted_bar(1r, 2l, 1l, 2a)(max(rth-tiny, 1), -1); |
| 752 |
adjust_slanted_bar(3r, 2l, 3l, 2b)(max(rth-tiny, 1), 1); |
| 753 |
else: |
| 754 |
lft x1r = lft x3r = internal_adjustment-eps; |
| 755 |
rt x2l = w-external_adjustment+eps; |
| 756 |
adjust_slanted_bar(1r, 2l, 1l, 2a)(max(rth-tiny, 1), 1); |
| 757 |
adjust_slanted_bar(3r, 2l, 3l, 2b)(max(rth-tiny, 1), -1); |
| 758 |
fi |
| 759 |
z2r = whatever[z1r, z2a]; z2r = whatever[z3r, z2b]; |
| 760 |
filldraw stroke z1e--z2e--z3e; |
| 761 |
penlabels(1, 2, 3); labels(2a, 2b); |
| 762 |
enddef; |
| 763 |
|
| 764 |
% almost okay |
| 765 |
beginchar(angle_left, |
| 766 |
set_width(6.5u#, 0.5u#, 0.5u#), body_height#, paren_depth#); |
| 767 |
"Left angle"; |
| 768 |
tmp_program(left, rth0); |
| 769 |
endchar; |
| 770 |
|
| 771 |
beginchar(angle_left_big, |
| 772 |
set_width(8u#, 0.75u#, 0.75u#), rth.frac#, 2dh#-rth.frac#); |
| 773 |
"big left angle"; |
| 774 |
tmp_program(left, 0.125[rth0, rth2]); |
| 775 |
endchar; |
| 776 |
|
| 777 |
beginchar(angle_left_Big, |
| 778 |
set_width(10u#, 1.0u#, 1.0u#), rth.frac#, 3dh#-rth.frac#); |
| 779 |
"Big left angle"; |
| 780 |
tmp_program(left, 0.25[rth0, rth2]); |
| 781 |
endchar; |
| 782 |
|
| 783 |
beginchar(angle_left_bigg, |
| 784 |
set_width(12u#, 1.25u#, 1.25u#), rth.frac#, 4dh#-rth.frac#); |
| 785 |
"bigg left angle"; |
| 786 |
tmp_program(left, 0.5[rth0, rth2]); |
| 787 |
endchar; |
| 788 |
|
| 789 |
beginchar(angle_left_Bigg, |
| 790 |
set_width(14u#, 1.5u#, 1.5u#), rth.frac#, 5dh#-rth.frac#); |
| 791 |
"Bigg left angle"; |
| 792 |
tmp_program(left, 0.75[rth0, rth2]); |
| 793 |
endchar; |
| 794 |
|
| 795 |
% almost okay |
| 796 |
beginchar(angle_right, |
| 797 |
set_width(6.5u#, 0.5u#, 0.5u#), body_height#, paren_depth#); |
| 798 |
"Right angle"; |
| 799 |
tmp_program(right, rth0); |
| 800 |
endchar; |
| 801 |
|
| 802 |
beginchar(angle_right_big, |
| 803 |
set_width(8u#, 0.75u#, 0.75u#), rth.frac#, 2dh#-rth.frac#); |
| 804 |
"big right angle"; |
| 805 |
tmp_program(right, 0.125[rth0, rth2]); |
| 806 |
endchar; |
| 807 |
|
| 808 |
beginchar(angle_right_Big, |
| 809 |
set_width(10u#, 1.0u#, 1.0u#), rth.frac#, 3dh#-rth.frac#); |
| 810 |
"Big right angle"; |
| 811 |
tmp_program(right, 0.25[rth0, rth2]); |
| 812 |
endchar; |
| 813 |
|
| 814 |
beginchar(angle_right_bigg, |
| 815 |
set_width(12u#, 1.25u#, 1.25u#), rth.frac#, 4dh#-rth.frac#); |
| 816 |
"bigg right angle"; |
| 817 |
tmp_program(right, 0.5[rth0, rth2]); |
| 818 |
endchar; |
| 819 |
|
| 820 |
beginchar(angle_right_Bigg, |
| 821 |
set_width(14u#, 1.5u#, 1.5u#), rth.frac#, 5dh#-rth.frac#); |
| 822 |
"Bigg right angle"; |
| 823 |
tmp_program(right, 0.75[rth0, rth2]); |
| 824 |
endchar; |
| 825 |
|
| 826 |
% SLASHES |
| 827 |
|
| 828 |
vardef tmp_program(expr orientation, thickness, slash_slant) = |
| 829 |
pickup tiny.nib; |
| 830 |
top y1 = h; y1 = y1l = y1r; bot y2 = -d; y2 = y2l = y2r; |
| 831 |
0.5[x1, x2] = 0.5w; |
| 832 |
x1-x2 = if orientation = left: - fi slash_slant*(y1-y2); |
| 833 |
x1r-x1l = x2r-x2l = diag_width(thickness-tiny, z1-z2); |
| 834 |
0.5[x1l, x1r] = x1; 0.5[x2l, x2r] = x2; |
| 835 |
filldraw stroke z1e..z2e; |
| 836 |
penlabels(1, 2); |
| 837 |
enddef; |
| 838 |
|
| 839 |
beginchar(backslash, |
| 840 |
set_width((body_height#+paren_depth#)*0.375 |
| 841 |
+(0[rth0#, rth2#]-tiny#)*(1++0.375)+tiny#, |
| 842 |
0.2u#, 0.2u#), |
| 843 |
body_height#, paren_depth#); |
| 844 |
"backslash"; |
| 845 |
tmp_program(left, 0[rth0, rth2], 0.375); |
| 846 |
endchar; |
| 847 |
|
| 848 |
beginchar(backslash_thick, |
| 849 |
set_width((body_height#+paren_depth#)*0.375 |
| 850 |
+(0.95stem#-tiny#)*(1++0.375)+tiny#, |
| 851 |
0.2u#, 0.2u#), |
| 852 |
body_height#, paren_depth#); |
| 853 |
"Thick backslash"; |
| 854 |
tmp_program(left, 0.95stem, 0.375); |
| 855 |
endchar; |
| 856 |
|
| 857 |
beginchar(backslash_big, |
| 858 |
set_width(2dh#*0.375 |
| 859 |
+(0.125[rth0#, rth2#]-tiny#)*(1++0.375)+tiny#, |
| 860 |
0.4u#, 0.4u#), |
| 861 |
rth.frac#, 2dh#-rth.frac#); |
| 862 |
"big backslash"; |
| 863 |
tmp_program(left, 0.125[rth0, rth2], 0.375); |
| 864 |
endchar; |
| 865 |
|
| 866 |
beginchar(backslash_Big, |
| 867 |
set_width(3dh#*0.375 |
| 868 |
+(0.25[rth0#, rth2#]-tiny#)*(1++0.375)+tiny#, |
| 869 |
0.7u#, 0.7u#), |
| 870 |
rth.frac#, 3dh#-rth.frac#); |
| 871 |
"Big backslash"; |
| 872 |
tmp_program(left, 0.25[rth0, rth2], 0.375); |
| 873 |
endchar; |
| 874 |
|
| 875 |
beginchar(backslash_bigg, |
| 876 |
set_width(4dh#*0.375 |
| 877 |
+(0.5[rth0#, rth2#]-tiny#)*(1++0.375)+tiny#, |
| 878 |
1.0u#, 1.0u#), |
| 879 |
rth.frac#, 4dh#-rth.frac#); |
| 880 |
"bigg backslash"; |
| 881 |
tmp_program(left, 0.5[rth0, rth2], 0.375); |
| 882 |
endchar; |
| 883 |
|
| 884 |
beginchar(backslash_Bigg, |
| 885 |
set_width(5dh#*0.375 |
| 886 |
+(0.75[rth0#, rth2#]-tiny#)*(1++0.375)+tiny#, |
| 887 |
1.2u#, 1.2u#), |
| 888 |
rth.frac#, 5dh#-rth.frac#); |
| 889 |
"Bigg backslash"; |
| 890 |
tmp_program(left, 0.75[rth0, rth2], 0.375); |
| 891 |
endchar; |
| 892 |
|
| 893 |
beginchar(slash, |
| 894 |
set_width((body_height#+paren_depth#)*0.375 |
| 895 |
+(0[rth0#, rth2#]-tiny#)*(1++0.375)+tiny#, |
| 896 |
0.2u#, 0.2u#), |
| 897 |
body_height#, paren_depth#); |
| 898 |
"slash"; |
| 899 |
tmp_program(right, 0[rth0, rth2], 0.375); |
| 900 |
endchar; |
| 901 |
|
| 902 |
beginchar(slash_thick, |
| 903 |
set_width((body_height#+paren_depth#)*0.375 |
| 904 |
+(0.95stem#-tiny#)*(1++0.375)+tiny#, |
| 905 |
0.2u#, 0.2u#), |
| 906 |
body_height#, paren_depth#); |
| 907 |
"Thick slash"; |
| 908 |
tmp_program(right, 0.95stem, 0.375); |
| 909 |
endchar; |
| 910 |
|
| 911 |
beginchar(slash_big, |
| 912 |
set_width(2dh#*0.375 |
| 913 |
+(0.125[rth0#, rth2#]-tiny#)*(1++0.375)+tiny#, |
| 914 |
0.4u#, 0.4u#), |
| 915 |
rth.frac#, 2dh#-rth.frac#); |
| 916 |
"big slash"; |
| 917 |
tmp_program(right, 0.125[rth0, rth2], 0.375); |
| 918 |
endchar; |
| 919 |
|
| 920 |
beginchar(slash_Big, |
| 921 |
set_width(3dh#*0.375 |
| 922 |
+(0.25[rth0#, rth2#]-tiny#)*(1++0.375)+tiny#, |
| 923 |
0.7u#, 0.7u#), |
| 924 |
rth.frac#, 3dh#-rth.frac#); |
| 925 |
"Big slash"; |
| 926 |
tmp_program(right, 0.25[rth0, rth2], 0.375); |
| 927 |
endchar; |
| 928 |
|
| 929 |
beginchar(slash_bigg, |
| 930 |
set_width(4dh#*0.375 |
| 931 |
+(0.5[rth0#, rth2#]-tiny#)*(1++0.375)+tiny#, |
| 932 |
1.0u#, 1.0u#), |
| 933 |
rth.frac#, 4dh#-rth.frac#); |
| 934 |
"bigg slash"; |
| 935 |
tmp_program(right, 0.5[rth0, rth2], 0.375); |
| 936 |
endchar; |
| 937 |
|
| 938 |
beginchar(slash_Bigg, |
| 939 |
set_width(5dh#*0.375 |
| 940 |
+(0.75[rth0#, rth2#]-tiny#)*(1++0.375)+tiny#, |
| 941 |
1.2u#, 1.2u#), |
| 942 |
rth.frac#, 5dh#-rth.frac#); |
| 943 |
"Bigg slash"; |
| 944 |
tmp_program(right, 0.75[rth0, rth2], 0.375); |
| 945 |
endchar; |
| 946 |
|
| 947 |
% |
| 948 |
% blackboard bold brackets |
| 949 |
% |
| 950 |
|
| 951 |
def tmp_program(expr orientation, rth, thick, |
| 952 |
do_top, do_bot, not_ext) = |
| 953 |
save a, b; |
| 954 |
a = hround(rth*(1++slant)); b = hround(thick*(1++slant)); |
| 955 |
y5r = y6r = h if do_top or not_ext: else: +eps fi; |
| 956 |
y7r = y8r = -d if do_bot or not_ext: else: -eps fi; |
| 957 |
if orientation = left: |
| 958 |
forsuffixes @# = 1, 2, 3, 4: x@#r-x@# = x@#-x@#l = -0.5a; endfor |
| 959 |
x1r = x2r = x5r = x7r = min(external_adjustment, |
| 960 |
hround 0.5(w-a-b)); |
| 961 |
x1-x3 = x2-x4 = -b; x6r = x8r = w-internal_adjustment; |
| 962 |
else: |
| 963 |
forsuffixes @# = 1, 2, 3, 4: x@#r-x@# = x@#-x@#l = 0.5a; endfor |
| 964 |
x1r = x2r = x5r = x7r = max(w-external_adjustment, |
| 965 |
hround 0.5(w+a+b)); |
| 966 |
x1-x3 = x2-x4 = b; x6r = x8r = internal_adjustment; |
| 967 |
fi |
| 968 |
forsuffixes @ = 1, 1r, 1l, 3, 3r, 3l: z@ = whatever[z5r, z6r]; endfor |
| 969 |
forsuffixes @ = 2, 2r, 2l, 4, 4r, 4l: z@ = whatever[z7r, z8r]; endfor |
| 970 |
penpos5(rth, 90); penpos6(rth, 90); |
| 971 |
penpos7(rth, -90); penpos8(rth, -90); |
| 972 |
penstroke z1e..z2e; penstroke z3e..z4e; |
| 973 |
if do_top: penstroke z5e..z6e; fi |
| 974 |
if do_bot: penstroke z7e..z8e; fi |
| 975 |
penlabels(1, 2, 3, 4, 5, 6, 7, 8); |
| 976 |
enddef; |
| 977 |
|
| 978 |
beginchar(bbbracket_left, |
| 979 |
set_width(5u#, 0.5u#, 2u#), body_height#, paren_depth#); |
| 980 |
"Left bbbracket"; |
| 981 |
tmp_program(left, rth0, 2.2u, true, true, true); |
| 982 |
endchar; |
| 983 |
|
| 984 |
beginchar(bbbracket_left_big, |
| 985 |
set_width(5.5u#, 0.75u#, 2.5u#), rth.frac#, 2dh#-rth.frac#); |
| 986 |
"big left bbbracket"; |
| 987 |
tmp_program(left, 0.125[rth0, rth1], 0.125[2.2u, 3.0u], true, true, true); |
| 988 |
endchar; |
| 989 |
|
| 990 |
beginchar(bbbracket_left_Big, |
| 991 |
set_width(6.0u#, 1.0u#, 3u#), rth.frac#, 3dh#-rth.frac#); |
| 992 |
"Big left bbbracket"; |
| 993 |
tmp_program(left, 0.25[rth0, rth1], 0.25[2.2u, 3.0u], true, true, true); |
| 994 |
endchar; |
| 995 |
|
| 996 |
beginchar(bbbracket_left_bigg, |
| 997 |
set_width(6.5u#, 1.25u#, 3.5u#), rth.frac#, 4dh#-rth.frac#); |
| 998 |
"bigg left bbbracket"; |
| 999 |
tmp_program(left, 0.5[rth0, rth1], 0.5[2.2u, 3.0u], true, true, true); |
| 1000 |
endchar; |
| 1001 |
|
| 1002 |
beginchar(bbbracket_left_Bigg, |
| 1003 |
set_width(7.0u#, 1.5u#, 4u#), rth.frac#, 5dh#-rth.frac#); |
| 1004 |
"Bigg left bbbracket"; |
| 1005 |
tmp_program(left, 0.75[rth0, rth1], 0.75[2.2u, 3.0u], true, true, true); |
| 1006 |
endchar; |
| 1007 |
|
| 1008 |
beginchar(bbbracket_left_top, |
| 1009 |
set_width(8u#, 2u#, 5u#), rth.frac#, 3dh#-rth.frac#); |
| 1010 |
"Left bbbracket's extension top"; |
| 1011 |
tmp_program(left, rth1, 3.0u, true, false, false); |
| 1012 |
endchar; |
| 1013 |
|
| 1014 |
beginchar(bbbracket_left_bot, |
| 1015 |
set_width(8u#, 2u#, 5u#), rth.frac#, 3dh#-rth.frac#); |
| 1016 |
"Left bbbracket's extension bottom"; |
| 1017 |
tmp_program(left, rth1, 3.0u, false, true, false); |
| 1018 |
endchar; |
| 1019 |
|
| 1020 |
beginchar(bbbracket_left_mid, |
| 1021 |
set_width(8u#, 2u#, 5u#), 0, dh#); |
| 1022 |
"Left bbbracket's extension module"; |
| 1023 |
tmp_program(left, rth1, 3.0u, false, false, false); |
| 1024 |
endchar; |
| 1025 |
|
| 1026 |
beginchar(bbbracket_right, |
| 1027 |
set_width(5u#, 0.5u#, 2u#), body_height#, paren_depth#); |
| 1028 |
"Right bbbracket"; |
| 1029 |
tmp_program(right, rth0, 2.2u, true, true, true); |
| 1030 |
endchar; |
| 1031 |
|
| 1032 |
beginchar(bbbracket_right_big, |
| 1033 |
set_width(5.5u#, 0.75u#, 2.5u#), rth.frac#, 2dh#-rth.frac#); |
| 1034 |
"big right bbbracket"; |
| 1035 |
tmp_program(right, 0.125[rth0, rth1], 0.125[2.2u, 3.0u], true, true, true); |
| 1036 |
endchar; |
| 1037 |
|
| 1038 |
beginchar(bbbracket_right_Big, |
| 1039 |
set_width(6.0u#, 1.0u#, 3u#), rth.frac#, 3dh#-rth.frac#); |
| 1040 |
"Big right bbbracket"; |
| 1041 |
tmp_program(right, 0.25[rth0, rth1], 0.25[2.2u, 3.0u], true, true, true); |
| 1042 |
endchar; |
| 1043 |
|
| 1044 |
beginchar(bbbracket_right_bigg, |
| 1045 |
set_width(6.5u#, 1.25u#, 3.5u#), rth.frac#, 4dh#-rth.frac#); |
| 1046 |
"bigg right bbbracket"; |
| 1047 |
tmp_program(right, 0.5[rth0, rth1], 0.5[2.2u, 3.0u], true, true, true); |
| 1048 |
endchar; |
| 1049 |
|
| 1050 |
beginchar(bbbracket_right_Bigg, |
| 1051 |
set_width(7.0u#, 1.5u#, 4u#), rth.frac#, 5dh#-rth.frac#); |
| 1052 |
"Bigg right bbbracket"; |
| 1053 |
tmp_program(right, 0.75[rth0, rth1], 0.75[2.2u, 3.0u], true, true, true); |
| 1054 |
endchar; |
| 1055 |
|
| 1056 |
beginchar(bbbracket_right_top, |
| 1057 |
set_width(8u#, 2.0u#, 5u#), rth.frac#, 3dh#-rth.frac#); |
| 1058 |
"Right bbbracket's extension top"; |
| 1059 |
tmp_program(right, rth1, 3.0u, true, false, false); |
| 1060 |
endchar; |
| 1061 |
|
| 1062 |
beginchar(bbbracket_right_bot, |
| 1063 |
set_width(8u#, 2.0u#, 5u#), rth.frac#, 3dh#-rth.frac#); |
| 1064 |
"Right bbbracket's extension bottom"; |
| 1065 |
tmp_program(right, rth1, 3.0u, false, true, false); |
| 1066 |
endchar; |
| 1067 |
|
| 1068 |
beginchar(bbbracket_right_mid, |
| 1069 |
set_width(8u#, 2.0u#, 5u#), 0, dh#); |
| 1070 |
"Right bbbracket's extension module"; |
| 1071 |
tmp_program(right, rth1, 3.0u, false, false, false); |
| 1072 |
endchar; |
| 1073 |
|
| 1074 |
% |
| 1075 |
% A poursuivre |
| 1076 |
% |
| 1077 |
|
| 1078 |
beginchar(vert_sign, 3u#+2appr#, body_height#, paren_depth#); |
| 1079 |
"Vertical line"; |
| 1080 |
ensure_centering_of(rth1); |
| 1081 |
pickup tiny.nib; |
| 1082 |
pos1(rth1, 0); pos2(rth1, 0); x1 = x2 = 0.5w; |
| 1083 |
top y1 = h; bot y2 = -d; filldraw stroke z1e..z2e; |
| 1084 |
penlabels(1, 2); |
| 1085 |
endchar; |
| 1086 |
|
| 1087 |
beginchar(vert_mod, 3u#+2appr#, 0, dh#); |
| 1088 |
"Vertical line's module"; |
| 1089 |
ensure_centering_of(rth1); |
| 1090 |
pickup tiny.nib; |
| 1091 |
pos1(rth1, 0); pos2(rth1, 0); x1 = x2 = 0.5w; |
| 1092 |
y1 = h+eps; y2 = -d-eps; filldraw stroke z1e..z2e; |
| 1093 |
penlabels(1, 2); |
| 1094 |
endchar; |
| 1095 |
|
| 1096 |
beginchar(vert_thick, 3u#+2appr#, body_height#, paren_depth#); |
| 1097 |
"Thick vertical line"; |
| 1098 |
ensure_centering_of(0.95stem); |
| 1099 |
pickup tiny.nib; |
| 1100 |
pos1(hround 0.95stem, 0); pos2(hround 0.95stem, 0); x1 = x2 = 0.5w; |
| 1101 |
top y1 = h; bot y2 = -d; filldraw stroke z1e..z2e; |
| 1102 |
penlabels(1, 2); |
| 1103 |
endchar; |
| 1104 |
|
| 1105 |
beginchar(vert_thick_mod, 3u#+2appr#, 0, dh#); |
| 1106 |
"Thick vertical line's module"; |
| 1107 |
ensure_centering_of(0.95stem); |
| 1108 |
pickup tiny.nib; |
| 1109 |
pos1(hround 0.95stem, 0); pos2(hround 0.95stem, 0); |
| 1110 |
x1 = x2 = 0.5w; y1 = h+eps; y2 = -d-eps; filldraw stroke z1e..z2e; |
| 1111 |
penlabels(1, 2); |
| 1112 |
endchar; |
| 1113 |
|
| 1114 |
beginchar(vvert_sign, 5.5u#+2appr#, body_height#, paren_depth#); |
| 1115 |
"Double vertical line"; |
| 1116 |
numeric a; a = max(2.5u-rth0, 2rth0);% blank space between bars |
| 1117 |
pickup tiny.nib; |
| 1118 |
pos1(rth0, 0); pos2(rth0, 0); pos3(rth0, 0); pos4(rth0, 0); |
| 1119 |
rt x1r = rt x2r = hround 0.5(w-a); |
| 1120 |
w-rt x3r = lft x1l; x3 = x4; |
| 1121 |
top y1 = top y3 = h; bot y2 = bot y4 = -d; |
| 1122 |
filldraw stroke z1e..z2e; |
| 1123 |
filldraw stroke z3e..z4e; |
| 1124 |
penlabels(1, 2, 3, 4); |
| 1125 |
endchar; |
| 1126 |
|
| 1127 |
beginchar(vvert_mod, 5.5u#+2appr#, 0, dh#); |
| 1128 |
"Double vertical line's module"; |
| 1129 |
numeric a; a = max(2.5u-rth0, 2rth0);% blank space between bars |
| 1130 |
pickup tiny.nib; |
| 1131 |
pos1(rth0, 0); pos2(rth0, 0); pos3(rth0, 0); pos4(rth0, 0); |
| 1132 |
rt x1r = rt x2r = hround 0.5(w-a); |
| 1133 |
w-rt x3r = lft x1l; x3 = x4; |
| 1134 |
y1 = y3 = h+eps; y2 = y4 = -d-eps; |
| 1135 |
filldraw stroke z1e..z2e; |
| 1136 |
filldraw stroke z3e..z4e; |
| 1137 |
penlabels(1, 2, 3, 4); |
| 1138 |
endchar; |
| 1139 |
|
| 1140 |
beginchar(vvvert_sign, 9u#+2appr#, body_height#, paren_depth#); |
| 1141 |
"Triple vertical line"; |
| 1142 |
ensure_centering_of(rth0); |
| 1143 |
numeric a; a = max(2.75u-rth0, 2rth0);% blank space between bars |
| 1144 |
pickup tiny.nib; |
| 1145 |
pos1(rth0, 0); pos2(rth0, 0); |
| 1146 |
pos3(rth0, 0); pos4(rth0, 0); |
| 1147 |
pos5(rth0, 0); pos6(rth0, 0); |
| 1148 |
x3 = x4 = 0.5w; x1 = x2; x5 = x6; |
| 1149 |
lft x5l-rt x3r = lft x3l-rt x1r = hround a; |
| 1150 |
top y1 = top y3 = top y5 = h; |
| 1151 |
bot y2 = bot y4 = bot y6 = -d; |
| 1152 |
filldraw stroke z1e..z2e; |
| 1153 |
filldraw stroke z3e..z4e; |
| 1154 |
filldraw stroke z5e..z6e; |
| 1155 |
penlabels(1, 2, 3, 4, 5, 6); |
| 1156 |
endchar; |
| 1157 |
|
| 1158 |
beginchar(vvvert_mod, 9u#+2appr#, 0, dh#); |
| 1159 |
"Triple vertical line's module"; |
| 1160 |
ensure_centering_of(rth0); |
| 1161 |
numeric a; a = max(2.75u-rth0, 2rth0);% blank space between bars |
| 1162 |
pickup tiny.nib; |
| 1163 |
pos1(rth0, 0); pos2(rth0, 0); |
| 1164 |
pos3(rth0, 0); pos4(rth0, 0); |
| 1165 |
pos5(rth0, 0); pos6(rth0, 0); |
| 1166 |
x3 = x4 = 0.5w; x1 = x2; x5 = x6; |
| 1167 |
lft x5l-rt x3r = lft x3l-rt x1r = hround a; |
| 1168 |
y1 = y3 = y5 = h+eps; y2 = y4 = y6 = -d-eps; |
| 1169 |
filldraw stroke z1e..z2e; |
| 1170 |
filldraw stroke z3e..z4e; |
| 1171 |
filldraw stroke z5e..z6e; |
| 1172 |
penlabels(1, 2, 3, 4, 5, 6); |
| 1173 |
endchar; |
| 1174 |
|
| 1175 |
beginchar(left_filet, 4stem#+2appr#, 0, dh#); |
| 1176 |
"extensible left filet"; |
| 1177 |
pickup fine.nib; |
| 1178 |
y1r = y1l = 0; y5r = y5l = -d; |
| 1179 |
forsuffixes $ = r, l: y2$ = 0.25[y1r, y5r]; |
| 1180 |
y3$ = 0.5[y1r, y5r]; y4$ = 0.75[y1r, y5r]; endfor |
| 1181 |
x1l = x5l = x4r = good.x 0.5w; |
| 1182 |
x1l-lft x3l = rt x2r-x4r = 2stem; |
| 1183 |
x2l = x4l = 0.5[x1l, x3l]; x1r = x3r = x5r = 0.5[x2r, x4r]; |
| 1184 |
filldraw z1l{down}...z2l{(z3l-z1l)xscaled 2}...z3l{down} |
| 1185 |
...z4l{(z5l-z3l)xscaled 2}...z5l{down}-- |
| 1186 |
z5r{(z4r-z5r)xscaled 2}...z4r{up}... |
| 1187 |
z3r{(z2r-z3r)xscaled 2}...z2r{up}... |
| 1188 |
z1r{(z1r-z2r)xscaled 2}--cycle; |
| 1189 |
penlabels(1, 2, 3, 4, 5); |
| 1190 |
endchar; |
| 1191 |
|
| 1192 |
beginchar(right_filet, 4stem#+2appr#, 0, dh#); |
| 1193 |
"extensible right filet"; |
| 1194 |
pickup fine.nib; |
| 1195 |
y1r = y1l = 0; y5r = y5l = -d; |
| 1196 |
forsuffixes $ = r, l: y2$ = 0.25[y1r, y5r]; |
| 1197 |
y3$ = 0.5[y1r, y5r]; y4$ = 0.75[y1r, y5r]; endfor |
| 1198 |
x1r = x5r = x2l = good.x 0.5w; |
| 1199 |
x2l-lft x4l = rt x3r-x1r = 2stem; |
| 1200 |
x1l = x3l = x5l = 0.5[x2l, x4l]; x2r = x4r = 0.5[x1r, x3r]; |
| 1201 |
filldraw z1r{down}...z2r{(z3r-z1r)xscaled 2}...z3r{down} |
| 1202 |
...z4r{(z5r-z3r)xscaled 2}...z5r{down}-- |
| 1203 |
z5l{(z4l-z5l)xscaled 2}...z4l{up}... |
| 1204 |
z3l{(z2l-z3l)xscaled 2}...z2l{up}... |
| 1205 |
z1l{(z1l-z2l)xscaled 2}--cycle; |
| 1206 |
penlabels(1, 2, 3, 4, 5); |
| 1207 |
endchar; |
| 1208 |
|
| 1209 |
% HORIZONTAL BRACES (almost okay, check xdvi problems) |
| 1210 |
|
| 1211 |
beginchar(overbrace_left, 0.75dh#+appr#, cap_stem#, dh#); |
| 1212 |
"overbrace's left piece"; |
| 1213 |
pickup fine.nib; |
| 1214 |
pos1(rth1, 180); pos2(cap_stem, 90); |
| 1215 |
bot y2l = vround (0.5[-d, h]-0.5cap_stem); |
| 1216 |
bot y1r = vround(y2-min(5u, 0.4dh+0.5cap_stem)); |
| 1217 |
lft x1r = appr; x2 = w+eps; |
| 1218 |
filldraw stroke z1e up_to_right z2e; |
| 1219 |
penlabels(1, 2); |
| 1220 |
endchar; |
| 1221 |
|
| 1222 |
beginchar(overbrace_mid, 1.5dh#, cap_stem#, dh#); |
| 1223 |
"overbrace's middle piece"; |
| 1224 |
pickup fine.nib; |
| 1225 |
pos1(cap_stem, -90); pos2(rth1, 0); pos3(cap_stem, 90); |
| 1226 |
bot y1r = bot y3l = vround (0.5[-d, h]-0.5cap_stem); |
| 1227 |
top y2 = vround(y3+min(5u, 0.4dh+0.5cap_stem)); |
| 1228 |
x2 = hround 0.5(w-rth1); x1 = -eps; x3 = w+eps; |
| 1229 |
filldraw stroke z1e right_to_down z2e; |
| 1230 |
filldraw stroke z3e left_to_down z2e; |
| 1231 |
penlabels(1, 2, 3); |
| 1232 |
endchar; |
| 1233 |
|
| 1234 |
beginchar(overbrace_right, 0.75dh#+appr#, cap_stem#, dh#); |
| 1235 |
"overbrace's right piece"; |
| 1236 |
pickup fine.nib; |
| 1237 |
pos1(rth1, 0); pos2(cap_stem, 90); |
| 1238 |
bot y2l = vround (0.5[-d, h]-0.5cap_stem); |
| 1239 |
bot y1r = vround(y2-min(5u, 0.4dh+0.5cap_stem)); |
| 1240 |
rt x1r = w-appr; x2 = -eps; |
| 1241 |
filldraw stroke z1e up_to_left z2e; |
| 1242 |
penlabels(1, 2); |
| 1243 |
endchar; |
| 1244 |
|
| 1245 |
% 4u# ??? |
| 1246 |
beginchar(overbrace_mod, 0.5dh#, cap_stem#, dh#); |
| 1247 |
"overbrace's module piece"; |
| 1248 |
pickup fine.nib; |
| 1249 |
pos1(cap_stem, 90); pos2(cap_stem, 90); |
| 1250 |
bot y1l = bot y2l = vround (0.5[-d, h]-0.5cap_stem); |
| 1251 |
x1 = -eps; x2 = w+eps; |
| 1252 |
filldraw stroke z1e..z2e; penlabels(1, 2); |
| 1253 |
endchar; |
| 1254 |
|
| 1255 |
beginchar(underbrace_left, 0.75dh#+appr#, cap_stem#, dh#); |
| 1256 |
"underbrace's left piece"; |
| 1257 |
pickup fine.nib; |
| 1258 |
pos1(rth1, 0); pos2(cap_stem, 90); |
| 1259 |
bot y2l = vround (0.5[-d, h]-0.5cap_stem); |
| 1260 |
top y1l = vround(y2+min(5u, 0.4dh+0.5cap_stem)); |
| 1261 |
lft x1l = appr; x2 = w+eps; |
| 1262 |
filldraw stroke z1e down_to_right z2e; |
| 1263 |
penlabels(1, 2); |
| 1264 |
endchar; |
| 1265 |
|
| 1266 |
beginchar(underbrace_mid, 1.5dh#, cap_stem#, dh#); |
| 1267 |
"underbrace's middle piece"; |
| 1268 |
pickup fine.nib; |
| 1269 |
pos1(cap_stem, 90); pos2(rth1, 0); pos3(cap_stem, -90); |
| 1270 |
bot y1l = bot y3r = vround (0.5[-d, h]-0.5cap_stem); |
| 1271 |
bot y2 = vround(y3-min(5u, 0.4dh+0.5cap_stem)); |
| 1272 |
x2 = hround 0.5(w-rth1); x1 = -eps; x3 = w+eps; |
| 1273 |
filldraw stroke z1e right_to_down z2e; |
| 1274 |
filldraw stroke z3e left_to_down z2e; |
| 1275 |
penlabels(1, 2, 3); |
| 1276 |
endchar; |
| 1277 |
|
| 1278 |
beginchar(underbrace_right, 0.75dh#+appr#, cap_stem#, dh#); |
| 1279 |
"underbrace's right piece"; |
| 1280 |
pickup fine.nib; |
| 1281 |
pos1(rth1, 180); pos2(cap_stem, 90); |
| 1282 |
bot y2l = vround (0.5[-d, h]-0.5cap_stem); |
| 1283 |
top y1l = vround(y2+min(5u, 0.4dh+0.5cap_stem)); |
| 1284 |
rt x1l = w-appr; x2 = -eps; |
| 1285 |
filldraw stroke z1e down_to_left z2e; |
| 1286 |
penlabels(1, 2); |
| 1287 |
endchar; |
| 1288 |
|
| 1289 |
% 4u# ??? |
| 1290 |
beginchar(underbrace_mod, 0.5dh#, cap_stem#, dh#); |
| 1291 |
"underbrace's module piece"; |
| 1292 |
pickup fine.nib; |
| 1293 |
pos1(cap_stem, 90); pos2(cap_stem, 90); |
| 1294 |
bot y1l = bot y2l = vround (0.5[-d, h]-0.5cap_stem); |
| 1295 |
x1 = -eps; x2 = w+eps; |
| 1296 |
filldraw stroke z1e..z2e; penlabels(1, 2); |
| 1297 |
endchar; |
| 1298 |
|
| 1299 |
% RADICALS |
| 1300 |
rth := ceiling(rth.frac#*hppp); |
| 1301 |
|
| 1302 |
vardef tmp_program = |
| 1303 |
% imperative coordinates |
| 1304 |
save a, b, c, f, sl; a = 2.75; b = 1.25;% slope factors |
| 1305 |
pickup crisp.nib; x1' = w; lft x5l = appr; |
| 1306 |
top y1r = h; y1' = h-0.5rth; bot y2r = bot y3r = -d-eps; |
| 1307 |
top y4l = vround 0.5[-d, h]+o; y5l = good.y 0.75[y2r, y4l]; |
| 1308 |
% numerical calculus |
| 1309 |
c = a*(y4l-y5l)+b*(y4l-y2r)+y1'-y2r; |
| 1310 |
vardef f(expr sl) = |
| 1311 |
sl*c-(1++(b*sl))*(curve-crisp)+0.5(rth-crisp)*(1+(1++sl))<x1'-x5l |
| 1312 |
enddef; |
| 1313 |
sl = solve f(0, (x1'-x5l)/(y1'-y5l)); |
| 1314 |
% setting other key points |
| 1315 |
x4l = good.x(x5l+a*sl*(y4l-y5l)); |
| 1316 |
x2r = good.x(x1'-sl*(y1'-y2r)+0.5(rth-crisp)*(1++sl)); |
| 1317 |
penpos1((rth-crisp)*(1++sl), 0); |
| 1318 |
pos5(min(hair, rth), angle(z4l-z5l)-90); |
| 1319 |
rt x2r-lft x3r = rth; z1r-z2r = whatever*(sl, 1); |
| 1320 |
adjust_slanted_bar(3r, 4l, 3, 4)(curve-crisp, -1); |
| 1321 |
z1l-z2l = whatever*(z1r-z2r); z2l = whatever[z3, z4l]; |
| 1322 |
z4r-z5r = whatever*(z4l-z5l); z4r = whatever[z3r, z4]; |
| 1323 |
z3l = 0.5[z2l, z4l];% it's not an interesting point |
| 1324 |
filldraw stroke z1e--z2e--z3e--z4e--z5e; |
| 1325 |
penlabels(1, 2, 3, 4, 5); labels(1'); |
| 1326 |
enddef; |
| 1327 |
|
| 1328 |
beginchar(radical_sign, |
| 1329 |
15u#+letter_fit#, rth.frac#, body_height#+paren_depth#-rth.frac#); |
| 1330 |
"radical sign"; |
| 1331 |
tmp_program; |
| 1332 |
endchar; |
| 1333 |
|
| 1334 |
beginchar(radical_big, |
| 1335 |
18u#+letter_fit#, rth.frac#, 2dh#-rth.frac#); |
| 1336 |
"big radical sign"; |
| 1337 |
tmp_program; |
| 1338 |
endchar; |
| 1339 |
|
| 1340 |
beginchar(radical_Big, |
| 1341 |
18u#+letter_fit#, rth.frac#, 3dh#-rth.frac#); |
| 1342 |
"Big radical sign"; |
| 1343 |
tmp_program; |
| 1344 |
endchar; |
| 1345 |
|
| 1346 |
beginchar(radical_bigg, |
| 1347 |
18u#+letter_fit#, rth.frac#, 4dh#-rth.frac#); |
| 1348 |
"bigg radical sign"; |
| 1349 |
tmp_program; |
| 1350 |
endchar; |
| 1351 |
|
| 1352 |
beginchar(radical_Bigg, |
| 1353 |
18u#+letter_fit#, rth.frac#, 5dh#-rth.frac#); |
| 1354 |
"Bigg radical sign"; |
| 1355 |
tmp_program; |
| 1356 |
endchar; |
| 1357 |
|
| 1358 |
beginchar(radical_bot, 19u#+letter_fit#, 0, 3dh#); |
| 1359 |
"Extensible radical sign---bottom"; |
| 1360 |
% imperative coordinates |
| 1361 |
save a, b, c, f, sl; a = 1; b = 1;% slope factors |
| 1362 |
pickup crisp.nib; |
| 1363 |
rt x1r = rt x2r = hround(w-6u+0.5rth); lft x5l = appr; |
| 1364 |
top y1r = h+1+eps; bot y2r = bot y3r = -d-eps; |
| 1365 |
top y4l = vround 0.9[-d, h]+o; y5l = good.y 0.75[y2r, y4l]; |
| 1366 |
% numerical calculus |
| 1367 |
c = a*(y4l-y5l)+b*(y4l-y2r); |
| 1368 |
vardef f(expr sl) = |
| 1369 |
sl*c-(1++(b*sl))*(curve-crisp)+0.5(rth-crisp)<x1r-x5l |
| 1370 |
enddef; |
| 1371 |
sl = solve f(0, (x1r-x5l)/(y1r-y5l)); |
| 1372 |
% setting other key points |
| 1373 |
x4l = good.x(x5l+a*sl*(y4l-y5l)); x3r = x1l; |
| 1374 |
pos1(rth, 0); pos5(min(hair, rth), angle(z4l-z5l)-90); |
| 1375 |
adjust_slanted_bar(3r, 4l, 3, 4)(curve-crisp, -1); |
| 1376 |
z1l-z2l = whatever*(z1r-z2r); z2l = whatever[z3, z4l]; |
| 1377 |
z4r-z5r = whatever*(z4l-z5l); z4r = whatever[z3r, z4]; |
| 1378 |
z3l = 0.5[z2l, z4l];% it's not an interesting point |
| 1379 |
filldraw stroke z1e--z2e--z3e--z4e--z5e; |
| 1380 |
penlabels(1, 2, 3, 4, 5); |
| 1381 |
endchar; |
| 1382 |
|
| 1383 |
beginchar(radical_mod, 19u#+letter_fit#, 0, dh#); |
| 1384 |
"Extensible radical sign---module"; |
| 1385 |
pickup crisp.nib; rt x1r = rt x2r = hround(w-6u+0.5rth); |
| 1386 |
y1 = h+1+eps; y2 = -d-1-eps; pos1(rth, 0); pos2(rth, 0); |
| 1387 |
filldraw stroke z1e..z2e; penlabels(1, 2); |
| 1388 |
endchar; |
| 1389 |
|
| 1390 |
beginchar(radical_top, 19u#+letter_fit#, rth.frac#, dh#-rth.frac#); |
| 1391 |
"Extensible radical sign---top"; |
| 1392 |
pickup crisp.nib; rt x3r = rt x2r = hround(w-6u+0.5rth); |
| 1393 |
x1 = good.x(w+0.5); bot y1r = bot y2r = 0; y3 = -d-1-eps; |
| 1394 |
x2l = x3l; y1l = y2l; pos1(rth, -90); pos3(rth, 0); |
| 1395 |
filldraw stroke z1e--z2e--z3e; penlabels(1, 2, 3); |
| 1396 |
endchar; |
| 1397 |
|
| 1398 |
beginchar(group_left, |
| 1399 |
set_width(4u#, 0.2u#, 2u#), body_height#, paren_depth#); |
| 1400 |
"Left group"; |
| 1401 |
a := hround 0[0.95stem, 0.95cap_stem]; |
| 1402 |
pickup fine.nib; |
| 1403 |
top y1l = h; bot y4l = -d; |
| 1404 |
y2 = 0.75[y4r, y1r]; y3 = 0.25[y4r, y1r]; |
| 1405 |
rt x1 = rt x4 = w-internal_adjustment; |
| 1406 |
lft x2l = lft x3l = external_adjustment; |
| 1407 |
pos1(rth0, -90); pos2(a, 0); pos3(a, 0); pos4(rth0, 90); |
| 1408 |
filldraw stroke z1e left_to_down |
| 1409 |
z2e..z3e down_to_right z4e; |
| 1410 |
penlabels(1, 2, 3, 4); |
| 1411 |
endchar; |
| 1412 |
|
| 1413 |
beginchar(group_left_big, |
| 1414 |
set_width(4.5u#, 0.4u#, 2.5u#), rth.frac#, 2dh#-rth.frac#); |
| 1415 |
"big left group"; |
| 1416 |
a := hround 0.125[0.95stem, 0.95cap_stem]; |
| 1417 |
pickup fine.nib; |
| 1418 |
top y1l = h; bot y4l = -d; |
| 1419 |
y2 = 0.75[y4r, y1r]; y3 = 0.25[y4r, y1r]; |
| 1420 |
rt x1 = rt x4 = w-internal_adjustment; |
| 1421 |
lft x2l = lft x3l = external_adjustment; |
| 1422 |
pos1(rth0, -90); pos2(a, 0); pos3(a, 0); pos4(rth0, 90); |
| 1423 |
filldraw stroke z1e left_to_down |
| 1424 |
z2e..z3e down_to_right z4e; |
| 1425 |
penlabels(1, 2, 3, 4); |
| 1426 |
endchar; |
| 1427 |
|
| 1428 |
beginchar(group_right, |
| 1429 |
set_width(4u#, 0.2u#, 2u#), body_height#, paren_depth#); |
| 1430 |
"Right group"; |
| 1431 |
a := hround 0[0.95stem, 0.95cap_stem]; |
| 1432 |
pickup fine.nib; |
| 1433 |
top y1r = h; bot y4r = -d; |
| 1434 |
y2 = 0.75[y4l, y1l]; y3 = 0.25[y4l, y1l]; |
| 1435 |
lft x1 = lft x4 = internal_adjustment; |
| 1436 |
rt x2r = rt x3r = w-external_adjustment; |
| 1437 |
pos1(rth0, 90); pos2(a, 0); pos3(a, 0); pos4(rth0, -90); |
| 1438 |
filldraw stroke z1e right_to_down |
| 1439 |
z2e..z3e down_to_left z4e; |
| 1440 |
penlabels(1, 2, 3, 4); |
| 1441 |
endchar; |
| 1442 |
|
| 1443 |
beginchar(group_right_big, |
| 1444 |
set_width(4.5u#, 0.4u#, 2.5u#), rth.frac#, 2dh#-rth.frac#); |
| 1445 |
"big right group"; |
| 1446 |
a := hround 0.125[0.95stem, 0.95cap_stem]; |
| 1447 |
pickup fine.nib; |
| 1448 |
top y1r = h; bot y4r = -d; |
| 1449 |
y2 = 0.75[y4l, y1l]; y3 = 0.25[y4l, y1l]; |
| 1450 |
lft x1 = lft x4 = internal_adjustment; |
| 1451 |
rt x2r = rt x3r = w-external_adjustment; |
| 1452 |
pos1(rth0, 90); pos2(a, 0); pos3(a, 0); pos4(rth0, -90); |
| 1453 |
filldraw stroke z1e right_to_down |
| 1454 |
z2e..z3e down_to_left z4e; |
| 1455 |
penlabels(1, 2, 3, 4); |
| 1456 |
endchar; |