summaryrefslogtreecommitdiff
path: root/graphics/fig2mf
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /graphics/fig2mf
Initial commit
Diffstat (limited to 'graphics/fig2mf')
-rw-r--r--graphics/fig2mf/README78
-rw-r--r--graphics/fig2mf/alltypes.fig45
-rw-r--r--graphics/fig2mf/balls.fig111
-rw-r--r--graphics/fig2mf/bean.fig24
-rw-r--r--graphics/fig2mf/book.fig31
-rw-r--r--graphics/fig2mf/chase.fig10
-rw-r--r--graphics/fig2mf/face.fig31
-rw-r--r--graphics/fig2mf/fig2MF.c629
-rw-r--r--graphics/fig2mf/fig2MFman.tex116
-rw-r--r--graphics/fig2mf/graphbase.mf1277
-rw-r--r--graphics/fig2mf/house.fig317
-rw-r--r--graphics/fig2mf/many.fig22
-rw-r--r--graphics/fig2mf/mitsu.fig8
-rw-r--r--graphics/fig2mf/parc-place.fig12
-rw-r--r--graphics/fig2mf/plane.fig10
-rw-r--r--graphics/fig2mf/powells.fig44
-rw-r--r--graphics/fig2mf/qd.fig16
-rw-r--r--graphics/fig2mf/shade.fig22
-rw-r--r--graphics/fig2mf/tf4
-rw-r--r--graphics/fig2mf/thick.fig20
-rw-r--r--graphics/fig2mf/type.fig238
21 files changed, 3065 insertions, 0 deletions
diff --git a/graphics/fig2mf/README b/graphics/fig2mf/README
new file mode 100644
index 0000000000..aa1af12d4c
--- /dev/null
+++ b/graphics/fig2mf/README
@@ -0,0 +1,78 @@
+Here is fig2MF, a tool to convert fig 2.1 input to METAFONT. The
+generated METAFONT code uses the mfpic macros.
+
+Fig2MF should compile with any C compiler known to man. Under Unix,
+just say:
+
+ make fig2MF
+
+Usage is straightforward:
+
+ fig2mf file.fig >foo.mf
+ mf '\mode:=localfont; input foo.mf'
+ tex '\font\foo=foo \foo \char33 \bye'
+
+In order to use the font you've just created, you must
+place the mfpic macros where METAFONT will find them, and
+adjust your TeX environment to recognize the .tfm and
+.gf files. You may also convert the .gf file to .pk format.
+
+
+Fig2MF has a few options:
+
+Option Default Description
+------------------------------------------------------------------------
+-mag 1000 Font magstep
+-code 32 Initial METAFONT font code value
+-pen 0.5 Size of the METAFONT pen (points)
+-xscale 0.125 x coordinate scaling factor
+-yscale 0.125 y coordinate scaling factor
+-xneg 0.0 Minimum x coordinate value of the figure (inches)
+-xpos 8.0 Maximum x coordinate value of the figure (inches)
+-yneg 0.0 Minimum y coordinate value of the figure (inches)
+-ypos 8.0 Maximum y coordinate value of the figure (inches)
+-top 8.0 Top of the whole coordinate system (inches)
+-----------------------------------------------------------------------
+
+The options are specified in the form of -opt=value. For example:
+
+ fig2MF -xscale=0.25 -xpos=4.0 foo.fig
+--------------------------------------------------------------------------
+
+Enclosed is:
+
+fig2MF.c source code
+fig2MFman.tex manual
+graphbase.mf mfpic macros
+tf shell script to test new fonts
+
+Samples fig files:
+
+alltypes.fig
+balls.fig
+bean.fig
+book.fig
+chase.fig
+face.fig
+house.fig
+many.fig
+mitsu.fig
+parc-place.fig
+plane.fig
+powells.fig
+qd.fig
+shade.fig
+thick.fig
+type.fig
+
+--------------------------------------------------------------------------
+
+Thanks go to Thomas Leathrum for creating the mfpic METAFONT macros.
+Geoffery Tobin contributed ideas, fruitful discussion and the
+enhanced mfpic macros.
+
+I'd dearly love to receive any bug fixes and enhancements.
+---
+Anthony Starks
+ajs@merck.com
+
diff --git a/graphics/fig2mf/alltypes.fig b/graphics/fig2mf/alltypes.fig
new file mode 100644
index 0000000000..6fd0348452
--- /dev/null
+++ b/graphics/fig2mf/alltypes.fig
@@ -0,0 +1,45 @@
+#FIG 2.1
+80 2
+5 1 0 1 -1 0 0 0 0.000 0 0 0 303.787 575.383 289 549 334 574 294 604
+1 1 0 1 -1 0 0 0 0.000 1 0.000 79 89 46 21 79 89 124 109
+1 4 0 1 -1 0 0 0 0.000 1 0.000 301 36 23 23 279 34 324 39
+1 2 0 1 -1 0 0 0 0.000 1 0.000 309 99 45 20 264 79 354 119
+1 3 0 1 -1 0 0 0 0.000 1 0.000 74 34 22 22 74 34 96 56
+1 2 0 1 -1 0 0 11 0.000 1 0.000 439 194 45 20 394 174 484 214
+1 4 0 1 -1 0 0 11 0.000 1 0.000 437 122 23 23 414 99 460 145
+1 4 0 1 -1 0 0 21 0.000 1 0.000 552 122 23 23 529 99 575 145
+1 2 0 1 -1 0 0 21 0.000 1 0.000 544 194 45 20 499 174 589 214
+2 4 0 1 -1 0 0 0 0.000 7 0 0
+ 349 529 349 479 264 479 264 529 349 529 9999 9999
+2 3 0 1 -1 0 0 0 0.000 -1 0 0
+ 69 379 69 469 99 469 99 424 134 424 144 399 144 389 129 374 69 374 69 379 9999 9999
+2 2 0 1 -1 0 0 0 0.000 0 0 0
+ 154 534 154 489 54 489 54 534 154 534 9999 9999
+2 3 0 1 -1 0 0 0 0.000 0 0 0
+ 124 584 113 556 83 551 64 574 75 602 105 607 124 584 9999 9999
+2 1 0 1 -1 0 0 0 0.000 7 0 0
+ 244 424 279 374 299 399 284 444 309 459 334 444 339 374 364 409 9999 9999
+2 3 0 1 -1 0 0 11 0.000 -1 0 0
+ 419 259 419 349 449 349 449 304 484 304 494 279 494 269 479 254 419 254 419 259 9999 9999
+2 3 0 1 -1 0 0 21 0.000 -1 0 0
+ 529 264 529 354 559 354 559 309 594 309 604 284 604 274 589 259 529 259 529 264 9999 9999
+3 0 0 1 -1 0 0 0 0.000 0 0
+ 319 149 264 149 284 179 319 204 319 214 274 209 244 194 9999 9999
+3 2 0 1 -1 0 0 0 0.000 0 0
+ 304 259 259 264 284 294 319 304 294 329 244 324 244 319 9999 9999
+ 0.000 0.000 273.553 254.545 262.303 255.795 255.202 273.436 275.747 288.626 291.693 299.009 316.453 294.172 321.474 313.546 303.350 325.662 280.712 333.744 256.476 337.786 243.069 322.971 243.069 321.721 0.000 0.000
+3 1 0 1 -1 0 0 0 0.000 0 0
+ 44 159 79 144 124 139 149 164 154 199 129 199 109 184 89 184 69 199 39 194 39 184 44 159 9999 9999
+3 3 0 1 -1 0 0 0 0.000 0 0
+ 44 259 94 229 139 239 169 254 179 304 144 314 114 284 64 304 39 299 44 259 9999 9999
+ 37.767 268.569 53.016 245.159 78.635 231.494 106.147 227.029 128.925 235.423 146.331 241.603 163.223 246.437 177.782 265.498 188.914 287.740 171.923 315.608 154.704 316.774 131.524 310.767 127.243 286.718 97.191 280.550 77.439 302.766 57.637 304.584 44.590 306.755 30.162 286.738 37.767 268.569 53.016 245.159
+3 1 0 1 -1 0 0 11 0.000 0 0
+ 399 404 434 389 479 384 504 409 509 444 484 444 464 429 444 429 424 444 394 439 394 429 399 404 9999 9999
+3 3 0 1 -1 0 0 11 0.000 0 0
+ 464 484 494 534 484 579 469 609 419 619 409 584 439 554 419 504 424 479 464 484 9999 9999
+ 454.431 477.767 477.841 493.016 491.507 518.635 495.971 546.147 487.577 568.925 481.397 586.331 476.563 603.223 457.502 617.782 435.260 628.914 407.392 611.922 406.226 594.704 412.233 571.524 436.282 567.243 442.450 537.191 420.234 517.439 418.416 497.637 416.245 484.590 436.262 470.162 454.431 477.767 477.841 493.016
+3 1 0 1 -1 0 0 21 0.000 0 0
+ 530 406 565 391 610 386 635 411 640 446 615 446 595 431 575 431 555 446 525 441 525 431 530 406 9999 9999
+3 3 0 1 -1 0 0 21 0.000 0 0
+ 599 489 629 539 619 584 604 614 554 624 544 589 574 559 554 509 559 484 599 489 9999 9999
+ 589.431 482.767 612.841 498.016 626.507 523.635 630.971 551.147 622.577 573.925 616.397 591.331 611.563 608.223 592.503 622.782 570.260 633.914 542.392 616.922 541.226 599.704 547.233 576.524 571.282 572.243 577.450 542.191 555.234 522.439 553.416 502.637 551.245 489.590 571.262 475.162 589.431 482.767 612.841 498.016
diff --git a/graphics/fig2mf/balls.fig b/graphics/fig2mf/balls.fig
new file mode 100644
index 0000000000..76b1328c2c
--- /dev/null
+++ b/graphics/fig2mf/balls.fig
@@ -0,0 +1,111 @@
+#FIG 2.1
+80 2
+5 1 0 1 -1 0 0 0 0.000 1 0 0 53.643 491.262 69 444 4 489 79 534
+5 1 0 1 -1 0 0 0 0.000 1 0 0 235.790 396.489 199 434 234 449 268 438
+5 1 0 1 -1 0 0 0 0.000 1 0 0 125.000 411.625 61 504 124 524 189 504
+5 1 0 1 -1 0 0 0 0.000 1 0 0 43.233 476.067 15 521 47 529 68 523
+1 2 0 1 -1 0 0 21 0.000 1 0.000 126 619 67 20 59 599 193 639
+1 2 0 1 -1 0 0 21 0.000 1 0.000 48 616 35 7 13 609 83 624
+1 1 0 1 -1 0 0 21 0.000 1 0.000 234 584 31 6 234 584 265 590
+1 3 0 1 -1 0 0 0 0.000 1 0.000 234 429 35 35 234 429 269 464
+1 4 0 1 -1 0 0 0 0.000 1 0.000 124 486 66 66 84 434 164 539
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 119 524 119 552 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 109 524 109 549 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 64 509 69 519 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 74 514 74 529 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 79 514 79 534 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 84 516 84 539 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 89 519 89 539 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 94 519 94 544 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 142 523 142 549 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 150 521 150 546 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 156 519 156 543 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 161 517 161 540 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 166 515 166 537 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 170 514 170 533 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 175 513 175 528 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 179 510 179 522 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 104 522 104 549 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 114 523 114 551 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 70 511 70 524 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 205 439 205 449 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 209 442 209 453 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 213 444 213 457 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 217 446 217 460 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 221 447 221 461 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 225 448 225 463 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 229 448 229 464 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 233 449 233 464 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 237 448 237 464 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 242 448 242 463 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 247 448 247 461 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 252 446 252 459 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 256 444 256 457 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 263 442 263 448 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 136 524 136 550 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 259 444 259 453 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 49 529 49 540 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 54 528 54 540 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 60 527 60 540 60 540 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 64 525 64 539 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 68 523 68 538 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 42 529 42 538 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 37 529 37 537 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 31 528 31 535 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 27 526 27 532 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 23 525 23 529 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 45 529 45 540 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 72 527 72 537 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 99 522 99 547 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 130 524 130 552 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 124 524 124 551 9999 9999
diff --git a/graphics/fig2mf/bean.fig b/graphics/fig2mf/bean.fig
new file mode 100644
index 0000000000..75e911f37a
--- /dev/null
+++ b/graphics/fig2mf/bean.fig
@@ -0,0 +1,24 @@
+#FIG 2.1
+80 2
+3 1 0 1 -1 0 0 0 0.000 0 0
+ 34 34 109 9 214 19 259 79 259 149 214 154 164 129 129 109 14 144 34 34 9999 9999
+3 1 0 1 -1 0 0 3 0.000 0 0
+ 29 169 104 144 209 154 254 214 254 284 209 289 159 264 124 244 9 279 29 169 9999 9999
+3 1 0 1 -1 0 0 5 0.000 0 0
+ 34 309 109 284 214 294 259 354 259 424 214 429 164 404 129 384 14 419 34 309 9999 9999
+3 1 0 1 -1 0 0 7 0.000 0 0
+ 29 449 104 424 209 434 254 494 254 564 209 569 159 544 124 524 9 559 29 449 9999 9999
+3 1 0 1 -1 0 0 9 0.000 0 0
+ 289 34 364 9 469 19 514 79 514 149 469 154 419 129 384 109 269 144 289 34 9999 9999
+3 1 0 1 -1 0 0 11 0.000 0 0
+ 284 179 359 154 464 164 509 224 509 294 464 299 414 274 379 254 264 289 284 179 9999 9999
+3 1 0 1 -1 0 0 13 0.000 0 0
+ 299 329 374 304 479 314 524 374 524 444 479 449 429 424 394 404 279 439 299 329 9999 9999
+3 1 0 1 -1 0 0 15 0.000 0 0
+ 309 469 384 444 489 454 534 514 534 584 489 589 439 564 404 544 289 579 309 469 9999 9999
+3 1 0 1 -1 0 0 17 0.000 0 0
+ 549 34 624 9 729 19 774 79 774 149 729 154 679 129 644 109 529 144 549 34 9999 9999
+3 1 0 1 -1 0 0 19 0.000 0 0
+ 554 204 629 179 734 189 779 249 779 319 734 324 684 299 649 279 534 314 554 204 9999 9999
+3 1 0 1 -1 0 0 21 0.000 0 0
+ 579 365 654 340 759 350 804 410 804 480 759 485 709 460 674 440 559 475 579 365 9999 9999
diff --git a/graphics/fig2mf/book.fig b/graphics/fig2mf/book.fig
new file mode 100644
index 0000000000..a67e2771d5
--- /dev/null
+++ b/graphics/fig2mf/book.fig
@@ -0,0 +1,31 @@
+#FIG 2.1
+80 2
+5 1 0 1 -1 0 0 0 0.000 0 0 0 97.378 495.824 39 424 109 404 149 419
+5 1 0 1 -1 0 0 0 0.000 0 0 0 84.000 709.000 19 614 89 594 149 614
+5 1 0 1 -1 0 0 0 0.000 0 0 0 214.000 709.000 149 614 219 594 279 614
+5 1 0 1 -1 0 0 0 0.000 0 0 0 207.378 490.824 149 419 219 399 259 414
+5 1 0 1 -1 0 0 0 0.000 0 0 0 84.000 709.000 19 614 89 594 149 614
+5 1 0 1 -1 0 0 0 0.000 0 0 0 84.000 747.333 19 614 84 599 149 614
+5 1 0 1 -1 0 0 0 0.000 0 0 0 84.000 819.000 19 614 79 604 149 614
+5 1 0 1 -1 0 0 0 0.000 0 0 0 84.000 1031.500 19 614 79 609 149 614
+5 1 0 1 -1 0 0 0 0.000 0 0 0 214.000 747.333 149 614 214 599 279 614
+5 1 0 1 -1 0 0 0 0.000 0 0 0 214.000 819.000 149 614 209 604 279 614
+5 1 0 1 -1 0 0 0 0.000 0 0 0 214.000 1031.500 149 614 209 609 279 614
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 149 419 149 614 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 39 424 19 614 19 609 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 259 414 279 614 279 604 9999 9999
+2 1 0 4 -1 0 0 0 0.000 7 0 0
+ 4 629 139 619 129 629 149 634 174 629 164 619 294 624 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 29 424 44 419 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 259 414 269 419 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 19 614 19 614 9999 9999
+2 1 0 4 -1 0 0 0 0.000 7 0 0
+ 29 424 4 629 9999 9999
+2 1 0 4 -1 0 0 0 0.000 7 0 0
+ 269 419 294 624 9999 9999
diff --git a/graphics/fig2mf/chase.fig b/graphics/fig2mf/chase.fig
new file mode 100644
index 0000000000..afebed0214
--- /dev/null
+++ b/graphics/fig2mf/chase.fig
@@ -0,0 +1,10 @@
+#FIG 2.1
+80 2
+2 3 0 1 -1 0 0 21 0.000 7 0 0
+ 39 369 -1 409 -1 569 59 569 59 349 39 369 9999 9999
+2 3 0 1 -1 0 0 21 0.000 7 0 0
+ 269 389 229 349 69 349 69 409 289 409 269 389 9999 9999
+2 3 0 1 -1 0 0 21 0.000 7 0 0
+ 19 599 59 639 219 639 219 579 -1 579 19 599 9999 9999
+2 3 0 1 -1 0 0 21 0.000 7 0 0
+ 249 619 289 579 289 419 229 419 229 639 249 619 9999 9999
diff --git a/graphics/fig2mf/face.fig b/graphics/fig2mf/face.fig
new file mode 100644
index 0000000000..1c76c1d8e2
--- /dev/null
+++ b/graphics/fig2mf/face.fig
@@ -0,0 +1,31 @@
+#FIG 2.1
+80 2
+5 1 0 1 -1 0 0 0 0.000 0 0 0 344.027 307.826 314 247 343 240 376 248
+5 1 0 1 -1 0 0 0 0.000 0 0 0 233.027 306.826 203 246 232 239 265 247
+5 1 0 2 -1 0 0 0 0.000 0 0 0 224.145 275.349 194 215 228 208 258 217
+5 1 0 2 -1 0 0 0 0.000 0 0 0 343.145 277.349 313 217 347 210 377 219
+1 1 0 1 -1 0 0 7 0.000 1 0.000 287 248 117 163 287 248 403 410
+1 2 0 1 -1 0 0 7 0.000 1 0.000 230 245 27 9 203 236 257 254
+1 2 0 1 -1 0 0 7 0.000 1 0.000 344 246 27 9 317 237 371 255
+1 4 0 1 0 0 0 21 0.000 1 0.000 232 245 7 7 225 238 239 252
+1 4 0 1 -1 0 0 21 0.000 1 0.000 347 246 7 7 340 239 354 253
+3 0 0 1 -1 0 0 0 0.000 0 0
+ 279 324 289 329 299 324 9999 9999
+3 0 0 1 -1 0 0 0 0.000 0 0
+ 279 324 279 319 274 314 274 314 269 319 9999 9999
+3 0 0 1 -1 0 0 0 0.000 0 0
+ 299 324 299 319 304 314 304 314 309 319 9999 9999
+3 0 0 1 -1 0 0 0 0.000 0 0
+ 274 249 279 274 274 294 9999 9999
+3 3 0 1 -1 0 0 21 0.000 0 0
+ 238 125 283 72 183 82 102 179 132 289 125 388 58 475 153 505 194 499 270 575 289 494 284 465 187 267 238 125 9999 9999
+ 220.123 155.909 246.238 110.757 289.650 84.672 273.387 53.682 206.853 69.357 153.005 97.898 109.815 143.167 94.949 211.330 129.376 262.267 134.284 312.270 133.863 364.695 115.194 413.785 47.629 441.982 67.409 504.956 128.994 503.069 162.985 505.803 182.739 495.268 223.208 508.681 242.350 582.876 291.404 568.903 288.407 513.862 289.210 486.975 286.116 471.534 268.149 416.046 190.310 326.717 184.735 226.134 220.123 155.909 246.238 110.757
+3 3 0 1 -1 0 0 21 0.000 0 0
+ 268 62 291 116 323 153 381 183 405 278 456 293 444 366 487 399 594 453 714 470 716 308 716 187 605 131 415 114 381 91 350 74 349 72 268 62 9999 9999
+ 281.480 44.101 258.306 74.872 283.716 104.327 297.071 125.729 313.867 145.801 335.191 162.610 369.790 168.864 397.821 204.212 384.609 256.807 416.063 289.498 445.658 276.538 470.393 315.909 435.675 344.953 450.100 381.421 476.434 392.361 510.364 413.679 567.111 444.563 621.190 461.531 680.589 498.652 758.663 431.699 715.772 344.909 716.170 280.434 735.627 218.885 695.834 154.239 633.404 139.114 561.418 118.551 459.081 129.692 405.514 110.623 389.002 95.886 374.108 86.792 356.200 80.439 349.608 73.593 349.535 72.378 329.462 58.199 281.480 44.101 258.306 74.872
+3 0 0 1 -1 0 0 0 0.000 0 0
+ 259 359 284 354 289 359 299 354 319 359 9999 9999
+3 0 0 1 -1 0 0 0 0.000 0 0
+ 254 359 279 379 309 374 324 359 9999 9999
+3 0 0 1 -1 0 0 0 0.000 0 0
+ 254 359 294 369 324 359 9999 9999
diff --git a/graphics/fig2mf/fig2MF.c b/graphics/fig2mf/fig2MF.c
new file mode 100644
index 0000000000..dd5a14a5d4
--- /dev/null
+++ b/graphics/fig2mf/fig2MF.c
@@ -0,0 +1,629 @@
+/*
+ * fig2MF -- convert fig to mfpic METAFONT code
+ *
+ * copyright (c) 1993 Anthony Starks (ajs@merck.com)
+ * You may do anything you want with this code except sell it
+ * or claim that you wrote it.
+ *
+ * Version 0.00 -- Incorporate Tobin's small suggestions
+ * Version 0.01 -- Change scaling to inches,
+ * default [x-y]scale is 1/8 inch
+ * slight format changes in cinit()
+ * Version 0.02 -- Fixed pen switching bug
+ * Version 0.03 -- Support new arcthree mode
+ * Version 0.04 -- Token support for text
+ */
+
+#include <stdio.h>
+
+#define put_msg(x) fputs(x, stderr); \
+ fprintf(stderr, \
+ " at line %d of file \"%s\" \n", line, curfile)
+#define dofill() 1.2-((double)area_fill/(double)FILL_BLACK)
+#define dopen(x) ((x-1)*PEN_INCR)+DEF_PEN
+#define VERSION 0.04
+#define BUF_SIZE 1024
+#define O_ELLIPSE 1
+#define O_POLYLINE 2
+#define O_SPLINE 3
+#define O_TEXT 4
+#define O_ARC 5
+#define O_COMP 6
+#define O_ECOMP -6
+#define FILL_BLACK 21
+#define N_CURVE 11
+#define N_POLYLINE 12
+#define N_ELLIPSE 19
+#define N_ARC 20
+#define DEF_PEN 0.5
+#define PEN_INCR 0.10
+#define DEF_BFILE "graphbase.mf"
+char buf[BUF_SIZE];
+
+typedef struct {
+ char *keyword;
+ double *value;
+} Options;
+
+int line;
+double ppi;
+double mag;
+double code;
+double mfpen;
+double xscale;
+double yscale;
+double xl;
+double yl;
+double xu;
+double yu;
+double maxy;
+char *progname;
+char *curfile;
+char basefile[100];
+
+Options opts[] = {
+{"-mag", &mag},
+{"-code", &code},
+{"-pen", &mfpen},
+{"-xscale", &xscale},
+{"-yscale", &yscale},
+{"-xneg", &xl},
+{"-xpos", &xu},
+{"-yneg", &yl},
+{"-ypos", &yu},
+{"-top", &maxy},
+{NULL, NULL}
+};
+
+
+main(argc, argv)
+int argc;
+char *argv[];
+{
+ FILE *fp;
+ int i;
+ progname = argv[0];
+ curfile = "Standard Input";
+ strcpy(basefile, DEF_BFILE);
+ line=1;
+ mag=1000.0;
+ code=32.0;
+ mfpen=0.5;
+ xscale=0.125;
+ yscale=0.125;
+ xl=0.0;
+ xu=8.0;
+ yl=0.0;
+ yu=8.0;
+ maxy=8.0;
+
+ if (argc < 2)
+ process("-");
+ else
+ {
+ for (i=1; i < argc; i++)
+ {
+ parse(argv[i]);
+ }
+ }
+
+ ffin();
+ exit(0);
+
+}
+
+parse(s)
+char *s;
+{
+ int i, n;
+ char *strchr();
+ double atof();
+
+ for (i=0; opts[i].keyword != NULL; i++)
+ {
+ if (strncmp(s, opts[i].keyword, strlen(opts[i].keyword)) == 0)
+ {
+ *opts[i].value = atof(strchr(s, '=')+1);
+ return;
+ }
+ }
+ process(s);
+}
+
+process(filename)
+char *filename;
+{
+ FILE *fp;
+
+ int coord_sys, object;
+
+ if (filename[0] == '-')
+ {
+ curfile = "Standard Input";
+ fp = stdin;
+ }
+ else
+ {
+ curfile=filename;
+ if ((fp = fopen(filename, "r")) == NULL)
+ {
+ fprintf(stderr,
+ "%s: cannot open the input file \"%s\"\n",
+ progname, filename);
+ return;
+ }
+ }
+
+ line = 1;
+ fgets(buf, sizeof(buf), fp);
+ if (strncmp(buf, "#FIG 2.1", 8) != 0)
+ {
+ put_msg("Not a fig 2.1 file");
+ return;
+ }
+ get_line(fp);
+ if (sscanf(buf, "%lf%d\n", &ppi, &coord_sys) != 2)
+ {
+ put_msg("Incomplete data");
+ return;
+ }
+ cinit();
+ while (get_line(fp) > 0)
+ {
+ if (sscanf(buf, "%d", &object) != 1)
+ {
+ put_msg("Incorrect format");
+ return;
+ }
+ switch(object)
+ {
+ case O_COMP:
+ case O_ECOMP:
+ break;
+ case O_ELLIPSE:
+ ellipse(fp);
+ break;
+ case O_POLYLINE:
+ polyline(fp);
+ break;
+ case O_SPLINE:
+ curve(fp);
+ break;
+ case O_TEXT:
+ text(fp);
+ break;
+ case O_ARC:
+ arc(fp);
+ break;
+ default:
+ fprintf(stderr, "%d is an ", object);
+ put_msg("unknown object");
+ break;
+ }
+ }
+ cfin();
+ if (fp != stdin) fclose(fp);
+
+}
+
+polyline(fp)
+FILE *fp;
+{
+ int c,
+ n,
+ type,
+ subtype,
+ style,
+ radius,
+ thickness,
+ color,
+ depth,
+ pen,
+ area_fill,
+ fa,
+ ba,
+ at,
+ as,
+ eflag;
+
+ double style_val,
+ athick,
+ awidth,
+ aht;
+
+ char epsfile[100];
+
+ c = 0;
+ n = sscanf(buf, "%d%d%d%d%d%d%d%d%lf%d%d%d",
+ &type,
+ &subtype,
+ &style,
+ &thickness,
+ &color,
+ &depth,
+ &pen,
+ &area_fill,
+ &style_val,
+ &radius,
+ &fa,
+ &ba);
+
+ if (n != N_POLYLINE)
+ {
+ put_msg("Malformed polyline");
+ return c;
+ }
+ if (subtype == 5) fscanf(fp, "%d%s", &eflag, epsfile);
+ if (fa) fscanf(fp, "%d%d%lf%lf%lf\n", &at, &as, &athick, &awidth, &aht);
+ if (ba) fscanf(fp, "%d%d%lf%lf%lf\n", &at, &as, &athick, &awidth, &aht);
+ if (thickness > 1)
+ printf(" pickup pencircle scaled %.2lfpt;\n",
+ dopen(thickness));
+ if (area_fill == FILL_BLACK)
+ printf(" cycleshade(0, false,\n");
+ else if (area_fill < FILL_BLACK && area_fill > 0)
+ printf(" cycleshade(%lfpt, false,\n", dofill());
+ else
+ printf(" curve(false, false,\n");
+ c = coords(type, fp);
+ if (thickness > 1)
+ printf(" pickup pencircle scaled %.2lfpt;\n",
+ mfpen);
+
+ return c;
+}
+
+
+curve(fp)
+FILE *fp;
+{
+ int n,
+ c,
+ i,
+ type,
+ style,
+ subtype,
+ thickness,
+ color,
+ depth,
+ pen,
+ area_fill,
+ fa,
+ ba,
+ at,
+ as;
+
+ double style_val,
+ athick,
+ awidth,
+ aht,
+ z;
+
+ c = 0;
+ n = sscanf(buf, "%d%d%d%d%d%d%d%d%lf%d%d",
+ &type,
+ &subtype,
+ &style,
+ &thickness,
+ &color,
+ &depth,
+ &pen,
+ &area_fill,
+ &style_val,
+ &fa,
+ &ba);
+ if (n != N_CURVE)
+ {
+ put_msg("Malformed spline");
+ return c;
+ }
+ if (fa) fscanf(fp, "%d%d%lf%lf%lf\n", &at, &as, &athick, &awidth, &aht);
+ if (ba) fscanf(fp, "%d%d%lf%lf%lf\n", &at, &as, &athick, &awidth, &aht);
+ if (thickness > 1)
+ printf(" pickup pencircle scaled %.2lfpt;\n",
+ dopen(thickness));
+ if (area_fill == FILL_BLACK)
+ printf(" cycleshade(0, true,\n");
+ else if (area_fill < FILL_BLACK && area_fill > 0)
+ printf(" cycleshade(%lfpt, true,\n", dofill());
+ else
+ printf(" curve(true, false,\n");
+ c = coords(type, fp);
+ if (subtype > 1)
+ for (i=0; i < c*4; i++)
+ fscanf(fp, "%lf", &z);
+ if (thickness > 1)
+ printf(" pickup pencircle scaled %.2lfpt;\n", mfpen);
+ return c;
+}
+
+coords(obj, fp)
+int obj;
+FILE *fp;
+{
+ int c, n, x, y;
+
+ c = 0;
+ if ((n = fscanf(fp, "%d%d", &x, &y)) != 2)
+ {
+ put_msg("Incomplete object");
+ return c;
+ }
+ printf(" (%lf, %lf)", x/ppi, maxy-(y/ppi));
+ for (c = 1;;)
+ {
+ if (fscanf(fp, "%d%d", &x, &y) != 2)
+ {
+ put_msg("Incomplete object");
+ fputs(buf, stderr);
+ return c;
+ }
+ if (x == 9999) break;
+ printf(",\n (%lf, %lf)", x/ppi, maxy-(y/ppi));
+ c++;
+ }
+ printf(");\n");
+ return c;
+
+}
+
+ellipse(fp)
+FILE *fp;
+{
+ int n,
+ type,
+ subtype,
+ style,
+ thickness,
+ color,
+ depth,
+ pen,
+ area_fill,
+ dir,
+ cx,
+ cy,
+ rx,
+ ry,
+ sx,
+ sy,
+ ex,
+ ey;
+
+ double style_val,
+ angle;
+
+ n = sscanf(buf, "%d%d%d%d%d%d%d%d%lf%d%lf%d%d%d%d%d%d%d%d",
+ &type,
+ &subtype,
+ &style,
+ &thickness,
+ &color,
+ &depth,
+ &pen,
+ &area_fill,
+ &style_val,
+ &dir,
+ &angle,
+ &cx,
+ &cy,
+ &rx,
+ &ry,
+ &sx,
+ &sy,
+ &ex,
+ &ey);
+ if (n != N_ELLIPSE)
+ {
+ put_msg("Malformed circle or ellipse");
+ return;
+ }
+
+ if (thickness > 1)
+ printf(" pickup pencircle scaled %.2lfpt;\n",
+ dopen(thickness));
+
+ if (subtype == 3 || subtype == 4)
+ {
+ if (area_fill == FILL_BLACK)
+ printf(" circshade(0, ");
+ else if (area_fill < FILL_BLACK && area_fill > 0)
+ printf(" circshade(%lfpt, ", dofill());
+ else
+ printf(" circle(");
+ printf("(%lf,%lf),%lf);\n",
+ cx/ppi, maxy-(cy/ppi), rx/ppi);
+ }
+ else if (subtype == 1 || subtype == 2)
+ {
+ if (area_fill == FILL_BLACK)
+ printf(" ellshade(0, ");
+ else if (area_fill < FILL_BLACK && area_fill > 0)
+ printf(" ellshade(%lfpt, ", dofill());
+ else
+ printf(" ellipse(");
+ printf("(%lf,%lf),%lf,%lf,0);\n",
+ cx/ppi, maxy-(cy/ppi), rx/ppi, ry/ppi);
+ }
+ if (thickness > 1)
+ printf(" pickup pencircle scaled %.2lfpt;\n", mfpen);
+
+}
+
+arc(fp)
+FILE *fp;
+{
+
+ int n,
+ type,
+ subtype,
+ style,
+ thickness,
+ color,
+ depth,
+ pen,
+ fill,
+ dir,
+ fa,
+ ba,
+ x1,
+ y1,
+ x2,
+ y2,
+ x3,
+ y3;
+
+ double style_val,
+ cx,
+ cy;
+
+
+ n = sscanf(buf, "%d%d%d%d%d%d%d%d%lf%d%d%d%lf%lf%d%d%d%d%d%d",
+ &type,
+ &subtype,
+ &style,
+ &thickness,
+ &color,
+ &depth,
+ &pen,
+ &fill,
+ &style_val,
+ &dir,
+ &fa,
+ &ba,
+ &cx,
+ &cy,
+ &x1,
+ &y1,
+ &x2,
+ &y2,
+ &x3,
+ &y3);
+
+ if (fa) get_line(fp);
+ if (ba) get_line(fp);
+
+ if (n != N_ARC)
+ {
+ put_msg("Malformed arc");
+ return n;
+ }
+ if (thickness > 1)
+ printf(" pickup pencircle scaled %.2lfpt;\n",
+ dopen(thickness));
+
+ printf(" arcthree((%lf,%lf), (%lf,%lf), (%lf,%lf));\n",
+ x1/ppi,
+ maxy-(y1/ppi),
+ x2/ppi,
+ maxy-(y2/ppi),
+ x3/ppi,
+ maxy-(y3/ppi));
+
+ if (thickness > 1)
+ printf(" pickup pencircle scaled %.2lfpt;\n",
+ mfpen);
+
+ return n;
+
+}
+
+text(fp)
+FILE *fp;
+{
+
+ int n,
+ x,
+ y;
+
+ int type,
+ font,
+ size,
+ pen,
+ color,
+ depth,
+ filler,
+ angle,
+ flags,
+ ht,
+ len;
+ char text[80],
+ junk[2],
+ *p,
+ *strrchr();
+
+ n = sscanf(buf, "%*d%d%d%d%d%d%d%lf%d%d%d%d%d%[^\1]%[\1]",
+ &type,
+ &font,
+ &size,
+ &pen,
+ &color,
+ &depth,
+ &angle,
+ &flags,
+ &ht,
+ &len,
+ &x,
+ &y,
+ text,
+ junk);
+ if ((n != 13) && (n != 14))
+ {
+ put_msg("Bad Text");
+ return 0;
+ }
+ p = &text[1];
+ printf("%% label((%lf,%lf),%s)\n", x/ppi, maxy-(y/ppi), p);
+ return(strlen(text));
+}
+
+cinit()
+{
+ static int once = 0;
+ static int curchar;
+ if (++once == 1)
+ {
+ curchar = (int)code;
+ printf("%%\n%% %s version %.2lf --- Preamble\n%%\n",
+ progname, VERSION);
+ printf("mag:=%g/1000; input %s; code:=%g;\n",
+ mag, basefile, code);
+ printf("mfpicenv;\ninterim hdwdr:=1; interim hdten:=1;\n");
+ printf("interim penwd:=%.2lfpt;\npickup pencircle scaled penwd;\n", mfpen);
+ }
+ printf("%%\n%% %s (char %d)\n%%\n", curfile, ++curchar);
+ printf("xscale:=%.3lf; yscale:=%.3lf; bounds(%.3lf,%.3lf,%.3lf,%.3lf);\n",
+ xscale, yscale, xl, xu, yl, yu);
+ printf("beginchar(incr code,xscale*(xpos-xneg)*in#,yscale*(ypos-yneg)*in#,0);\n");
+ printf(" setztr;\n");
+ printf(" pickup pencircle scaled %.2lfpt;\n", mfpen);
+}
+
+cfin()
+{
+ printf("endchar;\n");
+}
+
+ffin()
+{
+ if (line > 1) printf("endmfpicenv;\nend.\n");
+}
+
+get_line(fp)
+ FILE *fp;
+{
+ while (1)
+ {
+ if (NULL == fgets(buf, BUF_SIZE, fp))
+ {
+ return (-1);
+ }
+ line++;
+ if (*buf != '\n' && *buf != '#')
+ return (1);
+ /* Skip empty and comment lines */
+ }
+}
+
+
+
+
diff --git a/graphics/fig2mf/fig2MFman.tex b/graphics/fig2mf/fig2MFman.tex
new file mode 100644
index 0000000000..aab743ca8f
--- /dev/null
+++ b/graphics/fig2mf/fig2MFman.tex
@@ -0,0 +1,116 @@
+% Macros to format Unix-style manual pages
+%
+% Anthony Starks
+% ajs@merck.com
+%
+\emergencystretch=20pt
+\leftskip=20pt
+%\hsize=5.5in
+%\vsize=6in
+\parskip=4pt
+\parindent=0pt
+\newdimen\hangsize
+\newdimen\lfsize
+\lfsize=20pt
+\hangsize=2in
+\def\th#1#2{%
+ \headline={{\bf #1}\hfil {\rm Nifty Hacks}\hfil {\bf #1}}
+ \footline={{\sl Printed \the\month/\the\day/\the\year\hfill\folio}}}
+\uchyph=1
+\def\sect#1{\medskip\leftline{\bf#1}\medskip\leftskip=\lfsize}
+\def\name#1{\medskip\leftline{\bf NAME}\medskip #1\medskip\leftskip=\lfsize}
+\def\synopsis#1{\medskip\leftline{\bf SYNOPSIS}\medskip #1\medskip\leftskip=\lfsize}
+\def\description{\medskip\leftline{\bf DESCRIPTION}\medskip\leftskip=\lfsize}
+\def\see{\medskip\leftline{\bf SEE ALSO}\medskip\leftskip=\lfsize}
+\def\bugs{\medskip\leftline{\bf BUGS}\medskip\leftskip=\lfsize}
+\def\example{\medskip\leftline{\bf EXAMPLE}\medskip\leftskip=\lfsize}
+\def\author{\medskip\leftline{\bf AUTHOR}\medskip\leftskip=\lfsize}
+\def\files{\medskip\leftline{\bf FILES}\medskip\leftskip=\lfsize}
+\def\tool#1{{\it #1\/}}
+\def\file#1{{\tt #1\/}}
+\def\opt#1{{\it #1\/}}
+\def\itb{{\parindent=.5\hangsize\parskip=6pt\item{$\bullet$}}}
+\def\ito#1{\leftskip=\hangsize\item{{\it#1}}}
+\def\itoito#1{\leftskip=1.2\hangsize\item{{\bf#1}}}
+\def\endoptions{\par\leftskip=\lfsize}
+\def\tab{\qquad}
+\def\newline{\vskip 2\baselineskip}
+\def\computer#1{\medskip\qquad{\tt#1}\medskip}
+\def\beginlisting{\begingroup\parindent=.75in\parskip=0pt\obeyspaces\obeylines\tt}
+\def\endlisting{\endgroup}
+%
+% Manual page for fig2MF
+%
+% Anthony Starks
+% ajs@merck.com
+%
+%
+\def\F{{\sl fig2MF}}
+\name{fig2MF --- convert Fig code to mfpic METAFONT macro code}
+\synopsis{fig2MF [options] [files]}
+\description
+With \F{}, any tool that generates version 2.1 Fig graphics code (such as
+the X Windows drawing tool, xfig), can be used as a
+METAFONT font creation tool.
+
+\F{} reads from the named files or from the standard input file if
+no files are specified.
+The METAFONT code is written to the standard output file. The output
+is commented and formatted to aid manual editing.
+
+\F{} supports these Fig objects:
+\itb ellipses (and circles)
+\itb polylines
+\itb splines
+\itb arcs
+
+Compound objects are recognized but not are treated specially.
+
+\sect{OPTIONS}
+All of \F{}'s options take the form of \file{-opt=value} and
+can occur anywhere on the command line. The options effect the
+filenames that they precede on the command line, and may be repeated
+with different values for different files. For example,
+\computer{fig2MF -xpos=4 foo.fig -xpos=5 bar.fig >foobar.fig}
+sets the xpos value to 4 for the file \file{foo.fig}, and sets the xpos value
+to 5 for the file \file{bar.fig}. All of the other options take their default
+values. The METAFONT code is written to the file \file{foobar.mf}.
+$$\vbox{
+\halign{\tabskip=2em
+\tt#\hfil&
+#\hfil&
+#\hfil\cr
+\rm Option&Default Value&Description\cr
+\noalign{\medskip\hrule\medskip}
+-mag &1000&Font magstep\cr
+-code &32&Initial METAFONT font code value\cr
+-pen &0.5&Size of the METAFONT pen (points)\cr
+-xscale &0.125&x coordinate scaling factor\cr
+-yscale &0.125&y coordinate scaling factor\cr
+-xneg &0.0&Minimum x coordinate value of the figure (inches)\cr
+-xpos &8.0&Maximum x coordinate value of the figure (inches)\cr
+-yneg &0.0&Minimum y coordinate value of the figure (inches)\cr
+-ypos &8.0&Maximum y coordinate value of the figure (inches)\cr
+-top &8.0&Top of the whole coordinate system (inches)\cr
+\noalign{\medskip\hrule\medskip}
+}}$$
+The x, y coordinate and scaling factors are arbitrary and should be adjusted
+to fit both the Fig generating tool and the desired size of the font.
+\sect{FILES}
+graphbase.mf --- mfpic METAFONT macros.
+\sect{DIAGNOSTICS}
+\F{} complains about inaccessiable files, malformed objects and
+input that is not in Fig version 2.1 format.
+\bugs
+\itb Text objects and EPS boxes are ignored.
+
+\itb There is no attempt to determine the figure's bounding box.
+
+\itb Arrowed and non-solid lines styles are not supported.
+\see
+Thomas Leathrum, {\it Pictures in \TeX{} with METAFONT}
+
+bm2font(1), xfig(1), fig(4)
+\author
+Anthony Starks
+\bye
diff --git a/graphics/fig2mf/graphbase.mf b/graphics/fig2mf/graphbase.mf
new file mode 100644
index 0000000000..f3a4917c20
--- /dev/null
+++ b/graphics/fig2mf/graphbase.mf
@@ -0,0 +1,1277 @@
+%%% Date: Mon, 12 Oct 92 22:32:32 EST
+%%% Message-Id: <9210121232.AA18641@ee.latrobe.edu.au>
+%%% To: ajs@msdrl.com
+%%% Subject: graphbase.mf 0.2 gt mod 1 Mon 12 Oct 1992.
+%%% Cc: ecsgrt@ee.latrobe.edu.au
+%%% Status: OR
+%%%
+%%% 12:10 GMT Mon 12 Oct 1992 - Geoffrey Tobin.
+%%%
+%%% Dear Anthony,
+%%%
+%%% Latest mod of "graphbase.mf".
+%%%
+%%% This is still a long way from what it ought to be for Fig 2.1, but
+%%% maybe you can use some of the new code. Much of it is comments!
+%%%
+%%% I've modified onedot based on Knuth's "drawdot", written a hatchpath
+%%% macro to complement shadepath, attempted a gray level formula to match
+%%% human light sensitivity, some macros to draw as well as shade or
+%%% hatch, and an arrowpath macro to draw an arrow for arbitrary path and
+%%% to draw that path.
+%%%
+%%% THe 3-point arc code is included, with arcthreearrow to draw an arrow
+%%% as well.
+%%%
+%%% Some code for drawing Interpolated Splines is included. The macros to
+%%% test are ispline, isplinearrow, and isplineshade.
+%%%
+%%% Backward arrows are on my agenda.
+%%%
+%%% All the Best!
+%%% Geoffrey Tobin
+%%%
+%%%
+%%% File: graphbase.mf
+%%%
+
+mode_setup;
+message "mfpic version 0.2 graphbase - gt mod 1 - 10:16 GMT Mon 12 Oct 1992";
+
+% set up local environment
+
+def mfpicenv =
+begingroup
+
+% miscellaneous utilities
+
+% gt - op_pair operates with "op"
+% on both parts of a pair p.
+
+save op_pair;
+
+vardef op_pair (text op) (expr p) =
+ (op (xpart p), op (ypart p))
+enddef;
+
+save floorpair, ceilingpair;
+
+def floorpair = op_pair (floor) enddef;
+def ceilingpair = op_pair (ceiling) enddef;
+
+% gt - Should there be more error-checking,
+% eg of types, in these utility routines?
+% That would slow them down.
+
+% gt - textpairs converts the text t into the
+% array of n pairs, pts, that it contains.
+
+save textpairs;
+
+def textpairs (text t) (suffix pairs_, n_) =
+ n_ := 0;
+ for q=t:
+ pairs_[incr n_] := q;
+ endfor;
+enddef;
+
+% gt - Watch out! Need to ensure that "p_", etc.,
+% don't clash with any name in the passed text "t".
+% That's a nasty error to trace!
+%
+% A name conflict between local variables and variables
+% in a text parameter is especially likely in low-level
+% utility macros, such as minpair, maxpair and corner.
+%
+% Unfortunately, we can't *ensure* it won't happen.
+% So I appended the underscore to reduce the
+% probability of that happening.
+%
+% Evidently that's why Knuth uses "u_" in "max" and
+% "min" in "plain.mf".
+
+% gt - corner may be used for finding
+% a corner of the bounding box of the
+% set of points listed in u and t.
+% Other uses may be imaginable. (?)
+
+save corner;
+
+vardef corner (text xop) (text yop)
+ (expr u)(text t) =
+ save p_;
+ pair p_;
+ p_ := u;
+ for q=t:
+ p_ := (xop (xpart p_, xpart q),
+ yop (ypart p_, ypart q));
+ endfor;
+ p_
+enddef;
+
+% gt - bottom right, bottom right,
+% top left, top right corners.
+
+save blpair, brpair, tlpair, trpair;
+
+def blpair = corner (min) (min) enddef;
+def brpair = corner (max) (min) enddef;
+def tlpair = corner (min) (max) enddef;
+def trpair = corner (max) (max) enddef;
+
+def minpair = blpair enddef;
+def maxpair = trpair enddef;
+
+% setup
+% gt - sets the graphics coordinates.
+
+save bounds,
+ xneg,xpos,yneg,ypos;
+
+def bounds(expr a,b,c,d) =
+ xneg:=a;
+ xpos:=b;
+ yneg:=c;
+ ypos:=d;
+enddef;
+
+% conversion
+
+save xconv;
+
+def xconv(expr xvalue) =
+ ((xvalue-xneg)/(xpos-xneg))*w
+enddef;
+
+save unxconv;
+
+def unxconv(expr pvalue) =
+ ((pvalue/w)*(xpos-xneg)+xneg)
+enddef;
+
+save yconv;
+
+def yconv(expr yvalue) =
+ ((yvalue-yneg)/(ypos-yneg))*h
+enddef;
+
+save ztr;
+
+transform ztr;
+
+save setztr;
+
+def setztr =
+ ztr:=identity
+ shifted -(xneg,yneg)
+ xscaled (w/(xpos-xneg))
+ yscaled (h/(ypos-yneg));
+enddef;
+
+% pen width
+% in pixel coordinates
+
+save penwd;
+
+newinternal penwd;
+
+% gt - initial value of penwd.
+
+interim penwd := 0.5pt;
+
+% arrowheads
+% in pixel coordinates
+
+% hdwdr = arrowhead's ratio of width to length,
+% hdten = tension used in drawing its barbs.
+
+save hdwdr, hdten;
+
+newinternal hdwdr, hdten;
+
+% gt - initial values of hdwdr, hdten.
+
+interim hdwdr := 1;
+interim hdten := 1;
+
+% draw an arrowhead.
+
+save head, p,side;
+
+def head(expr front, back, width, t) =
+ pair p[], side;
+ side := (width/2) *
+ ((front-back) rotated 90);
+ p1 := back + side;
+ p2 := back - side;
+ draw front{back-front}..tension t..p1;
+ draw front{back-front}..tension t..p2;
+enddef;
+
+% draw an arrowhead of length hlen
+% for a path f.
+
+save headpath, p;
+
+def headpath(expr f,hlen) =
+ pair p[];
+ p2:=point infinity of f;
+ p1:=direction infinity of f;
+ if p1<>(0,0):
+ head(p2,p2-(hlen*unitvector(p1)),
+ hdwdr,hdten);
+ fi;
+enddef;
+
+% shading and hatching routines
+% in pixel coordinates
+
+% gt - modified onedot based on
+% plain metafont's "drawdot".
+% Used in stipple shading.
+%
+% Note:
+% currentpen_path, def_pen_path_,
+% t_, and penspeck are defined
+% in plain metafont ("plain.mf"
+% or "plain.base").
+
+save onedot;
+
+def onedot(expr p)(suffix v) =
+ if unknown currentpen_path:
+ def_pen_path_
+ fi;
+ addto v
+ contour currentpen_path
+ shifted p.t_
+ withpen penspeck
+enddef;
+
+% gt - draw path f in picture v.
+% ("onepath" is the old "onedot",
+% but f is intended to be a general path.)
+% Used, eg, in hatching and in drawpaths.
+
+save onepath;
+
+def onepath (expr f) (suffix v) =
+ addto v doublepath f
+ withpen currentpen;
+enddef;
+
+% gt - Paths must be continuous - I think
+% - but using suffix, we can pass arrays
+% of paths.
+%
+% My eventual goal is to do as much as
+% feasible, and memory-affordable, in
+% graphics coordinates, so we can rotate
+% and otherwise transform sets of paths
+% before drawing.
+
+% gt - draw the n paths f[] in picture v.
+
+save drawpaths;
+
+def drawpaths (expr n) (suffix f, v) =
+ for i=1 upto n:
+ onepath (f[i], v);
+ endfor;
+enddef;
+
+% clip picture v to interior of path f.
+
+save clip;
+
+vardef clip(expr f)(suffix v) =
+ save vt;
+ picture vt;
+ vt:=v;
+ cull vt keeping (1,infinity);
+ addto vt contour f;
+ cull vt keeping (2,infinity);
+ vt
+enddef;
+
+% gt - find bounding box of path f.
+
+save boundingbox, p;
+
+def boundingbox (expr f) (suffix ll, ur) =
+ ur := ll := point 0 of f;
+ pair p[];
+ for i=0 upto length f:
+ p0 := point i of f;
+ p1 := precontrol i of f;
+ p2 := postcontrol i of f;
+ ll := minpair (ll, p0, p1, p2);
+ ur := maxpair (ur, p0, p1, p2);
+ endfor;
+enddef;
+
+% gt - shading.
+
+% gt - I'm not so happy with dot densities
+% over a uniform range.
+% Here's code to approximate what may
+% be the human eye's light sensitivity.
+%
+% Mind you, this sort of stuff is done much
+% faster in C.
+
+save exp;
+
+vardef exp (expr x) =
+ mexp (256 * x)
+enddef;
+
+% graya scales the spacing sp;
+% grayb scales the graylevel g.
+
+save graya, grayb;
+
+newinternal graya, grayb;
+
+% initial values of gray parameters.
+
+interim graya := 0.5 pt;
+interim grayb := 3/20;
+
+% setgraypars sets gray parameters.
+% experimentation is recommended.
+
+save setgraypars;
+
+def setgraypars (expr a, b) =
+ graya := a;
+ grayb := b;
+enddef;
+
+% gt - grayspace gives the dot spacing
+% for graylevel g.
+%
+% Not sure how this model performs.
+
+save grayspace;
+
+vardef grayspace (expr g) =
+ if g <= 1: % white
+ infinity
+ elseif g >= 21: % black
+ 0
+ else: % gray
+ graya / (1 - exp (-g * grayb))
+ fi
+enddef;
+
+% gt - stipple upright box with lower left
+% at ll, upper right at ur, in picture v;
+% 2sp is dot spacing (rows offset by sp).
+%
+% NB: "stipple" means "shade with dots",
+% if I understand my English dictionary.
+%
+% Thomas Leathrum devised the trick whereby
+% the dots are arranged on a regular grid
+% of mesh size sp by sp with the pixel
+% origin as one crosspoint. This ensures
+% that objects shaded with the same stipple
+% density may be cleanly overlaid.
+
+save shadebox, sll, mn, m, n, twosp, p;
+
+def shadebox (expr sp, ll, ur) (suffix v) =
+ pair sll;
+ sll:=sp*(ceilingpair(ll/sp));
+ pair mn;
+ mn:=floorpair((ur-sll)/sp);
+ m:=xpart mn;
+ n:=ypart mn;
+ twosp:=2sp;
+ v:=nullpicture;
+ pair p[];
+ p2:=sll;
+ for i=0 upto m:
+ p3:=p2 if odd i: +(0,sp) fi;
+ for j=0 upto n:
+ if (not odd (i+j)):
+ onedot (p3, v);
+ p3:=p3+(0,twosp);
+ fi;
+ endfor;
+ p2:=p2+(sp,0);
+ endfor;
+enddef;
+
+% stipple interior of closed path f;
+% if spacing not positive, fill.
+
+save shadepath, ll, ur, v;
+
+def shadepath (expr sp, f) =
+ if not cycle f: ;
+ elseif sp<=0:
+ fill f;
+ elseif sp < infinity:
+ pair ll, ur;
+ boundingbox (f, ll, ur);
+ picture v;
+ shadebox (sp, ll, ur, v);
+ addto currentpicture
+ also clip(f,v);
+ fi;
+enddef;
+
+% gt - hatch an upright box in picture v,
+% with line separation sep x sep.
+%
+% Notice the similarity to shadebox.
+
+save hatchbox, llx, lly, urx, ury, sll,
+ mn, m, n, f;
+
+def hatchbox (expr sep, ll, ur) (suffix v) =
+ llx := xpart ll;
+ lly := ypart ll;
+ urx := xpart ur;
+ ury := ypart ur;
+ pair sll;
+ sll := sep * ceilingpair (ll/sep);
+ pair mn;
+ mn := floorpair ((ur-sll)/sep);
+ m := xpart mn;
+ n := ypart mn;
+ v := nullpicture;
+ path f;
+ f := (xpart sll, lly)--(xpart sll, ury);
+ for i=0 upto m:
+ onepath (f, v);
+ f := f translated (sep, 0);
+ endfor;
+ f := (llx, ypart sll)--(urx, ypart sll);
+ for j=0 upto n:
+ onepath (f, v);
+ f := f translated (0, sep);
+ endfor;
+enddef;
+
+save hatchpath, ll, ur, v;
+
+def hatchpath (expr sep, f) =
+ if not cycle f: ;
+ elseif sep<=0:
+ fill f;
+ elseif sep < infinity:
+ pair ll, ur;
+ boundingbox (f, ll, ur);
+ picture v;
+ hatchbox (sep, ll, ur, v);
+ addto currentpicture
+ also clip (f, v);
+ fi;
+enddef;
+
+% gt - shading & hatching macros
+% with a syntax like draw, fill,
+% unfill and erase.
+% sp, sep are in pixel coords,
+% f in graphics coordinates;
+% f is transformed transparently.
+
+save shade;
+
+def shade (expr sp) expr f =
+ shadepath (sp, f transformed ztr);
+enddef;
+
+save hatch;
+
+def hatch (expr sep) expr f =
+ hatchpath (sep, f transformed ztr);
+enddef;
+
+% gt - common combinations.
+
+save drawshade;
+
+def drawshade (expr sp) expr f =
+ draw f transformed ztr;
+ shade (sp) f;
+enddef;
+
+save drawhatch;
+
+def drawhatch (expr sep) expr f =
+ draw f transformed ztr;
+ hatch (sep) f;
+enddef;
+
+% * rest of macros start in graphing
+% coordinates but convert to pixel
+% to draw
+% * variables ending in "_px"
+% converted to pixel
+% * exceptions are the TeX dimensions
+% here called:
+% ptwd, hlen, dlen, slen, len, sp, sep
+% all of which are in pixel coordinates
+% * macros beginning with "mk" operate
+% entirely in graphing coordinates
+
+% general path construction
+
+save mkpath;
+
+vardef mkpath(expr smooth, cyclic, n)
+ (suffix pts) =
+ if smooth:
+ if cyclic:
+ pts[1]{pts[2]-pts[n]}
+ else:
+ pts[1]
+ fi
+ for i=2 upto n-1:
+ ..pts[i]{pts[i+1]-pts[i-1]}
+ endfor
+ if cyclic:
+ ..pts[n]{pts[1]-pts[n-1]}..cycle
+ else:
+ ..pts[n]
+ fi
+ else:
+ for i=1 upto n-1:
+ pts[i] --
+ endfor
+ pts[n]
+ if cyclic:
+ -- cycle
+ fi
+ fi
+enddef;
+
+% points, lines, and arrows
+
+save pointd, p;
+
+def pointd(expr a,ptwd) =
+ pair p_px;
+ p_px:=a transformed ztr;
+ fill fullcircle scaled ptwd shifted p_px;
+enddef;
+
+save line;
+
+def line(expr a,b) =
+ draw (a..b) transformed ztr;
+enddef;
+
+% gt - arrowpath draws path f
+% with an arrowhead;
+% hlen is in pixel coordinates;
+% f is in graphics coords;
+% f is transformed transparently.
+% Compare shade, hatch, etc.,
+% and contrast shadepath.
+
+save arrowpath, f_px;
+
+def arrowpath (expr hlen) expr f =
+ path f_px;
+ f_px := f transformed ztr;
+ draw f_px;
+ headpath (f_px, hlen);
+enddef;
+
+% gt - arrow now uses arrowpath.
+
+save arrow;
+
+def arrow(expr tl,hd,hlen) =
+ arrowpath (hlen) tl..hd ;
+enddef;
+
+% gt - "px" was too frequent
+% in dottedline, and made the code
+% hard to read, so I've deleted it.
+% Only a and b are in graphics coords.
+
+save dottedline,
+ p, v, l, delta, n;
+
+def dottedline (expr a, b, dlen, slen) =
+ pair p[];
+ p1 := a transformed ztr;
+ p3 := b transformed ztr;
+ l := length (p3-p1);
+ if (l > 2dlen) and
+ (dlen >= 0) and (slen >= 0):
+ else:
+ pair v;
+ v := unitvector (p3-p1);
+ n := floor ((l+slen-dlen) / (dlen+slen));
+ delta := (l-dlen) / n - (dlen+slen);
+ for i=1 upto n:
+ p2 := p1 + dlen * v;
+ draw p1..p2;
+ p1 := p2 + (slen+delta) * v;
+ endfor;
+ fi;
+ draw p1..p3;
+enddef;
+
+save dottedarrow;
+
+def dottedarrow(expr tl,hd,dlen,
+ slen,hlen) =
+ dottedline(tl,hd,dlen,slen);
+ headpath((tl..hd) transformed ztr,hlen);
+enddef;
+
+% axes and axis marks
+
+save axes;
+
+def axes(expr hlen) =
+ arrow((0,yneg),(0,ypos),hlen);
+ arrow((xneg,0),(xpos,0),hlen);
+enddef;
+
+save xmarks;
+
+def xmarks(expr len)(text t) =
+ for a=t:
+ draw (xconv(a),yconv(0)-(len/2))..
+ (xconv(a),yconv(0)+(len/2));
+ endfor;
+enddef;
+
+save ymarks;
+
+def ymarks(expr len)(text t) =
+ for a=t:
+ draw (xconv(0)-(len/2),yconv(a))..
+ (xconv(0)+(len/2),yconv(a));
+ endfor;
+enddef;
+
+% upright rectangles
+
+save mkrect;
+
+vardef mkrect(expr ll,ur) =
+ ll--(xpart ll,ypart ur)--
+ ur--(xpart ur,ypart ll)--cycle
+enddef;
+
+save rect;
+
+def rect(expr ll,ur) =
+ draw mkrect(ll,ur) transformed ztr;
+enddef;
+
+save dottedrect;
+
+def dottedrect(expr ll,ur,dlen,slen) =
+ dottedline(ll,(xpart ll,ypart ur),
+ dlen,slen);
+ dottedline((xpart ll,ypart ur),ur,
+ dlen,slen);
+ dottedline(ur,(xpart ur,ypart ll),
+ dlen,slen);
+ dottedline((xpart ur,ypart ll),ll,
+ dlen,slen);
+enddef;
+
+save block;
+
+def block(expr ll,ur) =
+ fill mkrect(ll,ur) transformed ztr;
+enddef;
+
+% gt - rectshade now uses shade.
+
+save rectshade;
+
+def rectshade(expr sp,ll,ur) =
+ shade (sp) mkrect (ll, ur);
+enddef;
+
+% circles and ellipses
+
+save mkellipse;
+
+vardef mkellipse(expr center,radx,rady,
+ angle) =
+ save t;
+ transform t;
+ t := identity
+ xscaled (2 * radx)
+ yscaled (2 * rady)
+ rotated angle
+ shifted center;
+ fullcircle transformed t
+enddef;
+
+save ellipse;
+
+def ellipse(expr center,radx,rady,
+ angle) =
+ draw
+ mkellipse(center,radx,rady,angle)
+ transformed ztr;
+enddef;
+
+save circle;
+
+def circle(expr center,rad) =
+ ellipse(center,rad,rad,0);
+enddef;
+
+% gt - ellshade now uses shade.
+
+save ellshade;
+
+def ellshade (expr sp, center,
+ radx, rady, angle) =
+ shade (sp)
+ mkellipse (center, radx, rady, angle);
+enddef;
+
+save circshade;
+
+def circshade(expr sp, center,rad) =
+ ellshade(sp,center,rad,rad,0);
+enddef;
+
+% circular arcs
+
+% gt - mkarc now calculates
+% n using ceiling, not floor;
+% and saves theta, not i.
+
+save mkarc;
+
+vardef mkarc(expr center,from,sweep) =
+ if sweep=0:
+ from
+ else:
+ begingroup
+ save n, theta, p;
+ n := 1 + ceiling (abs (sweep) / 45);
+ if n<3: n:=3; fi;
+ theta:=sweep/(n-1);
+ pair p[];
+ p1:=from;
+ for i=2 upto n:
+ p[i]:=p[i-1]
+ rotatedabout (center,theta);
+ endfor;
+ mkpath(true,false,n,p)
+ endgroup
+ fi
+enddef;
+
+% gt - note that when sweep is a multiple
+% of 360 degrees, disp is logically
+% infinite, not zero; then the center is
+% at infinity. In practice, arccenter
+% ought not to be called in that case.
+
+save arccenter;
+
+vardef arccenter(expr from,to,sweep) =
+ save midpt, disp;
+ pair midpt;
+ midpt:=(0.5)[from,to];
+ disp:=
+ if ((sweep mod 360)=0):
+ 0
+ else:
+ cosd(sweep/2)/sind(sweep/2)
+ fi;
+ midpt+(disp*((to-from) rotated 90)/2)
+enddef;
+
+% gt - mkarcto makes an arc given two points
+% on the arc and the sweep angle.
+% If sweep is a multiple of 360 degrees,
+% then the arc is a straight line;
+% if sweep is also nonzero, then that
+% line should be infinite, but I use
+% from--to instead.
+
+save mkarcto;
+
+vardef mkarcto (expr from, to, sweep) =
+ if from = to:
+ from
+ elseif (sweep mod 360) = 0:
+ from--to
+ else
+ begingroup
+ save center;
+ pair center;
+ center:=arccenter (from, to, sweep);
+ mkarc (center, from, sweep)
+ endgroup
+ fi
+enddef;
+
+% gt - arc now uses mkarcto.
+
+save arc;
+
+def arc(expr from,to,sweep) =
+ draw mkarcto (from, to, sweep)
+ transformed ztr;
+enddef;
+
+% gt - arcarrow now uses mkarcto
+% and arrowpath.
+
+save arcarrow;
+
+def arcarrow(expr hlen,from,to,sweep) =
+ arrowpath (hlen) mkarcto (from, to, sweep);
+enddef;
+
+% gt - mkchordto makes a cyclic path from
+% the arc from "from" to "to" with a sweep
+% angle of "sweep", and its chord from
+% "to" to "from".
+
+save mkchordto;
+
+vardef mkchordto (expr from, to, sweep) =
+ mkarcto (from, to, sweep) -- cycle
+enddef;
+
+% gt - arcshade now uses mkchordto
+% and shade.
+
+save arcshade;
+
+def arcshade(expr sp,from,to,sweep) =
+ shade (sp) mkchordto (from, to, sweep);
+enddef;
+
+% gt - three-point arcs.
+
+save mkarcthree;
+
+vardef mkarcthree (expr first, mid, last) =
+ save p, sweep, n, theta, center;
+ pair p[];
+ p1 := first;
+ sweep := 2 (angle (last-mid) - angle (mid-first));
+ if abs (sweep) <= 90:
+ n := 3;
+ p2 := mid;
+ p3 := last;
+ else:
+ n := 1 + ceiling (abs (sweep) / 45);
+ theta := sweep / (n-1);
+ pair center;
+ center := arcthreecenter (first, mid, last);
+ for i=2 upto n:
+ p[i] := p[i-1] rotatedabout (center, theta);
+ endfor;
+ fi;
+ mkpath (true, false, n, p)
+enddef;
+
+save arcthreecenter;
+
+vardef arcthreecenter (expr first, mid, last) =
+ save c, m, d;
+ pair c, m[], d[];
+ d1 := (mid - first) rotated 90;
+ d2 := (last - mid) rotated 90;
+ m1 := 0.5 [first, mid];
+ m2 := 0.5 [mid, last];
+ c = m1 + whatever * d1 = m2 + whatever * d2;
+ c
+enddef;
+
+save arcthree;
+
+def arcthree (expr first, mid, last) =
+ draw mkarcthree (first, mid, last) transformed ztr;
+enddef;
+
+save arcthreearrow;
+
+def arcthreearrow (expr hlen, first, mid, last) =
+ arrowpath (hlen) mkarcthree (first, mid, last);
+enddef;
+
+% modified polar coordinates
+
+% gt - mklinedir makes a path from point "a"
+% to a point displaced "len" in direction "theta"
+% from "a".
+
+save mklinedir;
+
+vardef mklinedir (expr a, theta, len) =
+ a -- (a + len * (dir theta))
+enddef;
+
+% gt - linedir now uses mklinedir.
+
+save linedir;
+
+def linedir(expr a,theta,len) =
+ draw mklinedir (a, theta, len)
+ transformed ztr;
+enddef;
+
+% gt - arrowdir now uses mklinedir
+% and arrowpath.
+
+save arrowdir;
+
+def arrowdir(expr hlen,a,theta,len) =
+ arrowpath (hlen)
+ mklinedir (a, theta, len);
+enddef;
+
+% gt - mkarcth makes an arc path with
+% given center, radius "rad", initial
+% angle "frtheta", and final angle
+% "totheta".
+
+save mkarcth;
+
+vardef mkarcth (expr center,
+ frtheta, totheta, rad) =
+ save from;
+ pair from;
+ from := center + rad * (dir frtheta);
+ mkarc (center, from, totheta-frtheta)
+enddef;
+
+% gt - arcth now uses mkarcth.
+
+save arcth;
+
+def arcth(expr center,
+ frtheta,totheta,rad) =
+ draw mkarcth (center, frtheta,
+ totheta, rad)
+ transformed ztr;
+enddef;
+
+% gt - arcth now uses mkarcth
+% and arrowpath.
+
+save arctharrow;
+
+def arctharrow(expr hlen,center,
+ frtheta,totheta,rad) =
+ arrowpath (hlen)
+ mkarcth (center, frtheta,
+ totheta, rad);
+enddef;
+
+% gt - mkwedge makes a wedge-shaped path
+% with apex at "center", radius "rad",
+% initial angle "frtheta", and final angle
+% "totheta".
+
+save mkwedge;
+
+vardef mkwedge (expr center, frtheta, totheta, rad) =
+ center -- mkarcth (from, frtheta, totheta, rad)
+ -- cycle
+enddef;
+
+% gt - wedge draws a sector of a circle.
+
+save wedge;
+
+def wedge (expr center, frtheta, totheta, rad) =
+ draw mkwedge (center, frtheta, totheta, rad)
+ transformed ztr;
+enddef;
+
+% gt - wedgeshade now uses mkwedge and shade.
+
+save wedgeshade;
+
+def wedgeshade (expr sp, center,
+ frtheta, totheta, rad) =
+ shade (sp) mkwedge (center, frtheta, totheta, rad);
+enddef;
+
+% gt - drawshadewedge draws and shades a wedge.
+
+save drawshadewedge;
+
+def drawshadewedge (expr sp, center,
+ frtheta, totheta, rad) =
+ draw mkwedge (center, frtheta, totheta, rad)
+ transformed ztr;
+ shade (sp) mkwedge (center, frtheta, totheta, rad);
+enddef;
+
+% curves
+
+% gt - watch out for that "text containing a local
+% variable's name" conflict! I dearly wish that
+% weren't a danger.
+% Perhaps it's not so likely at the level of "mkcurve",
+% as the "mk" macros are often fed numeric constants.
+
+save mkcurve;
+
+vardef mkcurve(expr smooth,cyclic)
+ (text t) =
+ save n_, p_;
+ pair p_[];
+ textpairs (t) (p_, n_);
+ mkpath(smooth,cyclic,n_,p_)
+enddef;
+
+save curve;
+
+def curve(expr smooth,cyclic)
+ (text t) =
+ draw mkcurve(smooth,cyclic,t)
+ transformed ztr;
+enddef;
+
+% gt - curvedarrow now uses arrowpath.
+
+save curvedarrow;
+
+def curvedarrow(expr smooth,hlen)
+ (text t) =
+ arrowpath (hlen)
+ mkcurve (smooth, false, t);
+enddef;
+
+% shading of cyclic curves
+
+% gt - cycleshade now uses shade.
+
+save cycleshade;
+
+def cycleshade(expr sp,smooth)(text t) =
+ shade (sp) mkcurve (smooth,true,t);
+enddef;
+
+% gt - interpolated splines with controls.
+
+% gt - mkipath uses the interpolation points,
+% p[], and the left and right control points,
+% l[] and r[].
+% Observe that for cyclic I-splines, l[n] is
+% used, not l1, though they are equal; this
+% simplifies the algorithm.
+
+save mkipath;
+
+vardef mkipath (expr closed, n)
+ (suffix p, l, r) =
+ for i=1 upto n-1:
+ p[i]..controls r[i] and l[i+1]..
+ endfor
+ if closed:
+ cycle
+ else:
+ p[n]
+ fi
+enddef;
+
+% gt - mkisplineA uses the I-spline data,
+% in the order that Fig 2.1 gives them,
+% points line pl and control line cl,
+% stores them in p[], l[] and r[],
+% then calls mkipath.
+%
+% pl should have the form:
+% (x1,y1) ... (xn,yn)
+% and cl the form:
+% (lx1,ly1) (rx1,ry1) ... (lxn,lyn) (rxn,ryn)
+% which reflect how Fig outputs its data.
+%
+% Don't feed it the "9999 9999", please!
+%
+% Perhaps the input should be massaged by a
+% preprocessor program (e.g. in C), to separate
+% the initially interleaved left and right control
+% points, before being given to graphbase?
+% That would simplify mkisplineA, and run faster.
+
+save mkisplineA;
+
+vardef mkisplineA (expr closed)
+ (text pl) (text cl) =
+ save p, l, r, n, i, isleft;
+ pair p[], l[], r[];
+ boolean isleft;
+ textpairs (pl) (p, n);
+ i := 1;
+ isleft := true;
+ for b=cl:
+ if isleft:
+ l[i] := b;
+ isleft := false;
+ else:
+ r[i] := b;
+ i := i+1;
+ isleft := true;
+ fi;
+ endfor;
+ mkipath (closed, n, p, l, r)
+enddef;
+
+% gt - mkisplineB uses the points line,
+% and the separated left and right controls.
+%
+% See how much simpler this is than
+% mkisplineA.
+
+save mkisplineB;
+
+vardef mkisplineB (expr closed)
+ (text pl) (text lc) (text rc) =
+ save p, l, r, n, i;
+ pair p[], l[], r[];
+ textpairs (pl) (p, n);
+ textpairs (lc) (l, i);
+ textpairs (rc) (r, i);
+ mkipath (closed, n, p, l, r)
+enddef;
+
+% gt - the usual variations.
+%
+% These use mkisplineA. I'd prefer
+% mkisplineB.
+
+% draw an interpolated spline,
+% with points line pl and interleaved
+% control line cl.
+
+save ispline;
+
+def ispline (expr closed)
+ (text pl) (text cl) =
+ draw mkisplineA (closed) (pl) (cl)
+ transformed ztr;
+enddef;
+
+save isplinearrow;
+
+def isplinearrow (expr hlen, closed)
+ (text pl) (text cl) =
+ arrowpath (hlen)
+ mkisplineA (closed) (pl) (cl);
+enddef;
+
+% gt - isplineshade assumes that the
+% I-spline is closed.
+
+save isplineshade;
+
+def isplineshade (expr sp)
+ (text pl) (text cl) =
+ shade (sp)
+ mkisplineA (true) (pl) (cl);
+enddef;
+
+% functions
+
+% gt - better be on the safe side with
+% the function text, so use "_" on local
+% variables in "mkfcn".
+
+save mkfcn;
+
+vardef mkfcn(expr smooth,bmin,bmax,bst)
+ (suffix bv)(text fcnpr) =
+ save p_, i_;
+ pair p_[];
+ i_ := 0;
+ for bv=bmin step bst
+ until bmax+(bst/2):
+ p_[incr i_] := fcnpr;
+ endfor;
+ mkpath (smooth, false, i_ , p_)
+enddef;
+
+save function;
+
+def function(expr smooth,xmin,xmax,st)
+ (text fx) =
+ draw mkfcn (smooth, xmin, xmax, st,
+ x, (x,fx))
+ transformed ztr;
+enddef;
+
+save parafcn;
+
+def parafcn(expr smooth,tmin,tmax,st)
+ (text ft) =
+ draw mkfcn (smooth, tmin, tmax, st,
+ t, ft)
+ transformed ztr;
+enddef;
+
+% gt - mksfn constructs a path from
+% two functions and the verticals
+% at either side.
+%
+% mksfn is used by shadefcn.
+
+save mksfn;
+
+vardef mksfn (expr smooth, xmin, xmax, st)
+ (text fcni) (text fcnii) =
+ mkfcn(smooth,xmin,xmax,st,x,(x,fcni))
+ --
+ reverse
+ mkfcn(smooth,xmin,xmax,st,x,(x,fcnii))
+ -- cycle
+enddef;
+
+% gt - description:
+% shadefcn shades between two functions over
+% the range xmin to xmax, stepping by st,
+% with dot spacing sp.
+% it does not draw the functions.
+
+% gt - shadefcn now uses mksfn.
+% I don't see the connection between the dot
+% spacing sp and the function step size st.
+
+save shadefcn, st;
+
+def shadefcn(expr sp, xmin, xmax)
+ (text fcni)(text fcnii) =
+ st := unxconv (sp);
+ shade (sp)
+ mksfn (false, xmin, xmax, st) (fcni) (fcnii);
+enddef;
+
+% gt - drawshadefcn draws both functions fcni
+% and fcnii, and shades between them.
+
+save drawshadefcn;
+
+def drawshadefcn (expr sp, smooth, xmin, xmax, st)
+ (text fcni) (text fcnii) =
+ function (smooth, xmin, xmax, st) (fcni);
+ function (smooth, xmin, xmax, st) (fcnii);
+ shadefcn (sp, xmin, xmax) (fcni) (fcnii);
+enddef;
+
+enddef; % mfpicenv
+
+def endmfpicenv =
+ endgroup;
+enddef;
+
+
diff --git a/graphics/fig2mf/house.fig b/graphics/fig2mf/house.fig
new file mode 100644
index 0000000000..1f5a25a687
--- /dev/null
+++ b/graphics/fig2mf/house.fig
@@ -0,0 +1,317 @@
+#FIG 2.1
+80 2
+1 3 0 1 0 0 0 0 0.000 1 0.000 377 456 3 3 377 456 380 457
+2 2 0 1 0 0 0 0 0.000 0 0 0
+ 412 397 412 460 425 460 425 397 412 397 9999 9999
+2 2 0 1 0 0 0 0 0.000 0 0 0
+ 282 397 282 460 295 460 295 397 282 397 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 459 459 539 459 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 459 449 539 449 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 459 439 539 439 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 459 429 539 429 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 459 419 539 419 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 459 409 539 409 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 459 399 539 399 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 429 459 459 459 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 429 449 459 449 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 429 439 459 439 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 429 429 459 429 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 429 419 459 419 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 429 409 459 409 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 389 459 409 459 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 389 449 409 449 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 389 439 409 439 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 389 429 409 429 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 389 419 409 419 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 389 409 409 409 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 429 399 459 399 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 389 399 409 399 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 239 459 279 459 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 239 449 279 449 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 239 439 279 439 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 239 429 279 429 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 299 459 319 459 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 299 449 319 449 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 299 439 319 439 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 299 429 319 429 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 299 419 319 419 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 239 419 279 419 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 299 409 319 409 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 239 409 279 409 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 299 399 319 399 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 239 399 279 399 9999 9999
+2 2 0 2 0 0 0 0 0.000 0 0 0
+ 409 394 429 394 429 464 409 464 409 394 9999 9999
+2 2 0 2 0 0 0 0 0.000 0 0 0
+ 279 394 299 394 299 464 279 464 279 394 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 669 379 474 379 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 334 359 369 359 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 239 369 254 369 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 669 369 449 369 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 239 349 309 349 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 669 349 394 349 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 369 339 669 339 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 239 339 339 339 9999 9999
+2 1 0 2 0 0 0 0 0.000 0 0 0
+ 239 359 284 359 9999 9999
+2 1 0 2 0 0 0 0 0.000 0 0 0
+ 669 359 419 359 9999 9999
+2 1 0 2 0 0 0 0 0.000 0 0 0
+ 239 375 239 209 669 209 669 519 239 519 239 394 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 489 389 539 389 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 389 389 459 389 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 249 389 319 389 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 304 369 399 369 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 279 379 429 379 9999 9999
+2 1 0 2 0 0 0 0 0.000 0 0 0
+ 459 389 459 519 9999 9999
+2 3 0 2 0 0 0 0 0.000 0 0 0
+ 219 399 354 352 484 399 491 385 354 334 213 384 219 399 9999 9999
+2 1 0 2 0 0 0 0 0.000 0 0 0
+ 319 519 319 384 389 384 389 519 9999 9999
+2 2 0 2 0 0 0 0 0.000 0 0 0
+ 539 384 539 469 619 469 619 384 539 384 9999 9999
+2 2 0 2 0 0 0 0 0.000 0 0 0
+ 319 249 319 314 389 314 389 249 319 249 9999 9999
+2 2 0 2 0 0 0 0 0.000 0 0 0
+ 519 249 519 314 589 314 589 249 519 249 9999 9999
+2 3 0 2 0 0 0 0 0.000 0 0 0
+ 219 214 214 198 454 111 695 200 689 214 454 129 219 214 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 469 159 534 159 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 374 159 439 159 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 429 139 479 139 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 399 149 504 149 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 469 169 564 169 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 344 169 439 169 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 469 179 589 179 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 314 179 439 179 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 289 189 619 189 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 259 199 649 199 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 389 509 669 509 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 389 499 669 499 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 389 489 669 489 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 389 479 669 479 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 389 469 539 469 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 619 469 669 469 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 619 459 669 459 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 619 449 669 449 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 619 439 669 439 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 619 429 669 429 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 619 419 669 419 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 619 409 669 409 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 619 399 669 399 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 619 389 669 389 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 389 309 519 309 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 389 299 519 299 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 389 289 519 289 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 389 279 519 279 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 389 269 519 269 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 389 259 519 259 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 239 219 669 219 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 239 229 669 229 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 239 239 669 239 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 239 249 669 249 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 239 319 669 319 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 239 329 669 329 9999 9999
+2 2 0 1 0 0 0 0 0.000 0 0 0
+ 324 389 324 519 384 519 384 389 324 389 9999 9999
+2 2 0 1 0 0 0 0 0.000 0 0 0
+ 239 519 669 519 669 554 239 554 239 519 9999 9999
+2 2 0 1 0 0 0 0 0.000 0 0 0
+ 544 389 544 424 614 424 614 389 544 389 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 544 400 614 400 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 544 413 614 413 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 558 389 558 424 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 572 389 572 424 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 586 389 586 424 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 600 389 600 424 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 600 429 600 464 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 586 429 586 464 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 572 429 572 464 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 558 429 558 464 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 544 453 614 453 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 544 440 614 440 9999 9999
+2 2 0 1 0 0 0 0 0.000 0 0 0
+ 544 429 544 464 614 464 614 429 544 429 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 324 297 384 297 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 369 284 369 309 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 339 284 339 309 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 354 284 354 309 9999 9999
+2 2 0 1 0 0 0 0 0.000 0 0 0
+ 324 284 384 284 384 309 324 309 324 284 9999 9999
+2 2 0 1 0 0 0 0 0.000 0 0 0
+ 324 254 384 254 384 279 324 279 324 254 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 354 254 354 279 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 339 254 339 279 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 369 254 369 279 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 324 267 384 267 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 524 267 584 267 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 569 254 569 279 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 539 254 539 279 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 554 254 554 279 9999 9999
+2 2 0 1 0 0 0 0 0.000 0 0 0
+ 524 254 584 254 584 279 524 279 524 254 9999 9999
+2 2 0 1 0 0 0 0 0.000 0 0 0
+ 524 284 584 284 584 309 524 309 524 284 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 554 284 554 309 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 539 284 539 309 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 569 284 569 309 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 524 297 584 297 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 589 259 669 259 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 589 269 669 269 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 589 279 669 279 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 589 289 669 289 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 589 299 669 299 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 589 309 669 309 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 239 469 319 469 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 239 479 319 479 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 239 489 319 489 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 239 499 319 499 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 239 509 319 509 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 239 259 319 259 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 239 269 319 269 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 239 279 319 279 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 239 289 319 289 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 239 299 319 299 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 239 309 319 309 9999 9999
+2 2 0 1 0 0 0 0 0.000 0 0 0
+ 439 154 439 184 469 184 469 154 439 154 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 444 159 464 159 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 444 164 464 164 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 444 169 464 169 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 444 174 464 174 9999 9999
+2 1 0 1 0 0 0 0 0.000 0 0 0
+ 444 179 464 179 9999 9999
diff --git a/graphics/fig2mf/many.fig b/graphics/fig2mf/many.fig
new file mode 100644
index 0000000000..67ce3e836c
--- /dev/null
+++ b/graphics/fig2mf/many.fig
@@ -0,0 +1,22 @@
+#FIG 2.1
+80 2
+5 1 0 1 -1 0 0 0 0.000 0 0 0 295.748 325.976 304 269 334 369 264 374
+1 1 0 1 -1 0 0 0 0.000 1 0.000 444 154 76 31 444 154 519 124
+1 3 0 1 -1 0 0 0 0.000 1 0.000 304 334 152 152 304 334 456 486
+2 3 0 1 -1 0 0 0 0.000 -1 0 0
+ 104 114 254 144 139 259 104 114 9999 9999
+2 2 0 1 -1 0 0 0 0.000 0 0 0
+ 244 99 244 39 134 39 134 99 244 99 9999 9999
+2 4 0 1 -1 0 0 0 0.000 7 0 0
+ 644 194 644 44 559 44 559 194 644 194 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 504 249 524 229 544 239 559 239 559 299 639 299 589 229 644 249 639 254 9999 9999
+2 3 0 1 -1 0 0 0 0.000 0 0 0
+ 594 324 539 309 499 349 514 404 569 419 609 379 594 324 9999 9999
+3 2 0 1 -1 0 0 0 0.000 0 0
+ 349 34 349 34 334 34 289 59 309 119 334 109 339 79 374 104 9999 9999
+ 0.000 0.000 349.000 34.000 349.000 34.000 345.583 34.000 337.563 33.077 321.771 37.169 295.617 41.988 280.871 79.900 287.351 108.960 318.217 123.275 328.961 115.261 339.692 101.928 330.819 82.389 347.677 75.406 356.427 81.656 0.000 0.000
+3 3 0 1 -1 0 0 0 0.000 0 0
+ 469 29 439 44 454 79 489 79 504 44 469 29 9999 9999
+ 479.614 28.688 459.651 29.275 443.357 32.106 434.054 57.503 443.870 72.321 463.311 85.139 479.689 85.139 499.130 72.320 509.500 57.750 498.500 30.250 479.614 28.688 459.651 29.275
+4 0 0 12 0 -1 0 0.000 4 12 106 239 224 This is text from xfig.
diff --git a/graphics/fig2mf/mitsu.fig b/graphics/fig2mf/mitsu.fig
new file mode 100644
index 0000000000..14d9994109
--- /dev/null
+++ b/graphics/fig2mf/mitsu.fig
@@ -0,0 +1,8 @@
+#FIG 2.1
+80 2
+2 3 0 1 -1 0 0 21 0.000 7 0 0
+ 255 636 175 636 133 560 210 560 255 636 9999 9999
+2 3 0 1 -1 0 0 21 0.000 7 0 0
+ 133 418 172 488 129 562 89 495 133 418 9999 9999
+2 3 0 1 -1 0 0 21 0.000 7 0 0
+ 7 636 87 636 129 560 52 560 7 636 9999 9999
diff --git a/graphics/fig2mf/parc-place.fig b/graphics/fig2mf/parc-place.fig
new file mode 100644
index 0000000000..d2ed6dd4de
--- /dev/null
+++ b/graphics/fig2mf/parc-place.fig
@@ -0,0 +1,12 @@
+#FIG 2.1
+80 2
+6 4 354 524 639
+2 2 0 12 -1 0 0 0 0.000 7 0 0
+ 14 604 14 404 154 404 154 604 14 604 9999 9999
+2 3 0 12 -1 0 0 0 0.000 7 0 0
+ 174 404 294 364 294 559 174 604 174 404 174 404 9999 9999
+2 3 0 12 -1 0 0 0 0.000 7 0 0
+ 234 429 354 389 354 584 234 629 234 429 234 429 9999 9999
+2 2 0 12 -1 0 0 0 0.000 7 0 0
+ 374 584 374 384 514 384 514 584 374 584 9999 9999
+-6
diff --git a/graphics/fig2mf/plane.fig b/graphics/fig2mf/plane.fig
new file mode 100644
index 0000000000..ba0a0b5b2b
--- /dev/null
+++ b/graphics/fig2mf/plane.fig
@@ -0,0 +1,10 @@
+#FIG 2.1
+80 2
+6 4 514 289 634
+2 3 0 1 -1 0 0 0 0.000 -1 0 0
+ 84 514 44 554 289 554 84 514 84 514 9999 9999
+2 3 0 1 -1 0 0 0 0.000 -1 0 0
+ 44 554 4 594 284 554 44 554 9999 9999
+2 3 0 1 -1 0 0 21 0.000 -1 0 0
+ 289 554 39 634 39 589 289 554 9999 9999
+-6
diff --git a/graphics/fig2mf/powells.fig b/graphics/fig2mf/powells.fig
new file mode 100644
index 0000000000..92c83b576f
--- /dev/null
+++ b/graphics/fig2mf/powells.fig
@@ -0,0 +1,44 @@
+#FIG 2.1
+80 2
+6 -1 164 414 639
+5 1 0 5 -1 0 0 0 0.000 0 0 0 203.853 285.618 174 209 284 304 179 364
+5 1 0 5 -1 0 0 0 0.000 0 0 0 235.434 286.131 174 209 334 289 169 359
+6 24 544 139 639
+2 2 0 1 -1 0 0 0 0.000 0 0 0
+ 94 639 94 564 69 564 69 639 94 639 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 94 564 139 544 139 619 94 639 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 69 564 24 544 24 619 69 639 9999 9999
+-6
+6 149 544 264 639
+2 2 0 1 -1 0 0 0 0.000 0 0 0
+ 219 639 219 564 194 564 194 639 219 639 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 219 564 264 544 264 619 219 639 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 194 564 149 544 149 619 194 639 9999 9999
+-6
+6 274 544 389 639
+2 2 0 1 -1 0 0 0 0.000 0 0 0
+ 344 639 344 564 319 564 319 639 344 639 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 344 564 389 544 389 619 344 639 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 319 564 274 544 274 619 319 639 9999 9999
+-6
+2 1 0 5 -1 0 0 0 0.000 -1 0 0
+ 104 204 174 204 9999 9999
+2 1 0 5 -1 0 0 0 0.000 -1 0 0
+ 104 524 174 524 9999 9999
+2 2 0 1 -1 0 0 0 0.000 0 0 0
+ 414 639 -1 639 -1 544 414 544 414 639 9999 9999
+2 2 0 1 -1 0 0 0 0.000 0 0 0
+ 414 539 414 164 -1 164 -1 539 414 539 9999 9999
+3 2 0 10 -1 0 0 0 0.000 0 0
+ 174 204 164 214 159 229 159 249 159 499 159 509 169 519 179 524 9999 9999
+ -120.000 120.000 167.852 209.312 165.352 211.812 161.984 217.262 159.595 225.334 158.247 233.638 159.000 244.444 159.001 305.952 158.999 442.047 159.000 501.278 157.968 506.509 160.460 512.523 166.305 517.058 170.598 520.152 173.098 521.402 -120.000 120.000
+3 2 0 5 -1 0 0 0 0.000 0 0
+ 104 204 114 214 119 229 119 249 119 499 119 509 109 519 99 524 9999 9999
+ -140.000 125.000 110.148 209.312 112.648 211.812 116.016 217.262 118.405 225.334 119.753 233.638 119.000 244.444 119.001 305.952 118.999 442.047 119.000 501.278 120.032 506.509 117.541 512.523 111.695 517.057 107.402 520.152 104.902 521.402 -140.000 125.000
+-6
diff --git a/graphics/fig2mf/qd.fig b/graphics/fig2mf/qd.fig
new file mode 100644
index 0000000000..8f1e1bfc57
--- /dev/null
+++ b/graphics/fig2mf/qd.fig
@@ -0,0 +1,16 @@
+#FIG 2.1
+80 2
+6 -1 444 599 624
+2 3 0 1 -1 0 0 21 0.000 -1 0 0
+ 319 624 599 624 599 479 319 624 319 624 9999 9999
+2 3 0 1 -1 0 0 16 0.000 -1 0 0
+ 374 584 284 584 519 464 519 514 374 584 374 584 9999 9999
+2 3 0 1 -1 0 0 11 0.000 -1 0 0
+ 339 544 264 544 449 444 449 489 339 544 339 544 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 319 624 -1 624 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 279 584 59 584 54 584 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 264 544 119 544 9999 9999
+-6
diff --git a/graphics/fig2mf/shade.fig b/graphics/fig2mf/shade.fig
new file mode 100644
index 0000000000..773be0fa64
--- /dev/null
+++ b/graphics/fig2mf/shade.fig
@@ -0,0 +1,22 @@
+#FIG 2.1
+80 2
+1 3 0 1 -1 0 0 2 0.000 1 0.000 99 99 21 21 99 99 120 120
+1 3 0 1 -1 0 0 3 0.000 1 0.000 159 99 21 21 159 99 180 120
+1 3 0 1 -1 0 0 4 0.000 1 0.000 219 99 21 21 219 99 240 120
+1 3 0 1 -1 0 0 5 0.000 1 0.000 279 99 21 21 279 99 300 120
+1 3 0 1 -1 0 0 6 0.000 1 0.000 339 99 21 21 339 99 360 120
+1 3 0 1 -1 0 0 7 0.000 1 0.000 399 99 21 21 399 99 420 120
+1 3 0 1 -1 0 0 8 0.000 1 0.000 459 99 21 21 459 99 480 120
+1 3 0 1 -1 0 0 9 0.000 1 0.000 519 99 21 21 519 99 540 120
+1 3 0 1 -1 0 0 1 0.000 1 0.000 39 99 21 21 39 99 60 120
+1 3 0 1 -1 0 0 10 0.000 1 0.000 38 158 21 21 38 158 59 179
+1 3 0 1 -1 0 0 11 0.000 1 0.000 579 99 21 21 579 99 600 120
+1 3 0 1 -1 0 0 12 0.000 1 0.000 99 159 21 21 99 159 120 180
+1 3 0 1 -1 0 0 13 0.000 1 0.000 159 159 21 21 159 159 180 180
+1 3 0 1 -1 0 0 14 0.000 1 0.000 219 159 21 21 219 159 240 180
+1 3 0 1 -1 0 0 15 0.000 1 0.000 279 159 21 21 279 159 300 180
+1 3 0 1 -1 0 0 16 0.000 1 0.000 339 159 21 21 339 159 360 180
+1 3 0 1 -1 0 0 17 0.000 1 0.000 399 159 21 21 399 159 420 180
+1 3 0 1 -1 0 0 18 0.000 1 0.000 459 159 21 21 459 159 480 180
+1 3 0 1 -1 0 0 19 0.000 1 0.000 519 159 21 21 519 159 540 180
+1 3 0 1 -1 0 0 21 0.000 1 0.000 579 159 21 21 579 159 600 180
diff --git a/graphics/fig2mf/tf b/graphics/fig2mf/tf
new file mode 100644
index 0000000000..9e1cfea358
--- /dev/null
+++ b/graphics/fig2mf/tf
@@ -0,0 +1,4 @@
+./fig2MF $* >foo.mf
+mf '\mode:=localfont; input foo.mf'
+tex '\font\foo=foo \foo \char33 \bye'
+xdvi -s 5 texput &
diff --git a/graphics/fig2mf/thick.fig b/graphics/fig2mf/thick.fig
new file mode 100644
index 0000000000..ff79239d03
--- /dev/null
+++ b/graphics/fig2mf/thick.fig
@@ -0,0 +1,20 @@
+#FIG 2.1
+80 2
+2 1 0 7 -1 0 0 0 0.000 -1 0 0
+ 104 229 84 274 149 274 129 244 154 224 9999 9999
+2 1 0 9 -1 0 0 0 0.000 -1 0 0
+ 474 229 454 274 519 274 499 244 524 224 9999 9999
+2 1 0 4 -1 0 0 0 0.000 -1 0 0
+ 101 130 81 175 146 175 126 145 151 125 9999 9999
+2 1 0 6 -1 0 0 0 0.000 -1 0 0
+ 472 128 452 173 517 173 497 143 522 123 9999 9999
+2 1 0 3 -1 0 0 0 0.000 -1 0 0
+ 472 28 452 73 517 73 497 43 522 23 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 109 29 89 74 154 74 134 44 159 24 9999 9999
+2 1 0 2 -1 0 0 0 0.000 -1 0 0
+ 277 28 257 73 322 73 302 43 327 23 9999 9999
+2 1 0 5 -1 0 0 0 0.000 -1 0 0
+ 272 133 252 178 317 178 297 148 322 128 9999 9999
+2 1 0 8 -1 0 0 0 0.000 -1 0 0
+ 269 229 249 274 314 274 294 244 319 224 9999 9999
diff --git a/graphics/fig2mf/type.fig b/graphics/fig2mf/type.fig
new file mode 100644
index 0000000000..a31e0e96c4
--- /dev/null
+++ b/graphics/fig2mf/type.fig
@@ -0,0 +1,238 @@
+#FIG 2.1
+80 2
+5 1 0 1 -1 0 0 0 0.000 1 0 0 166.034 491.898 147 452 122 488 142 529
+5 1 0 1 -1 0 0 0 0.000 1 0 0 361.034 481.898 342 442 317 478 337 519
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 142 529 337 519 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 142 454 337 444 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 337 519 337 627 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 142 529 142 637 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 142 636 337 626 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 122 490 317 480 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 182 527 182 633 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 222 526 222 632 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 262 524 262 630 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 302 521 302 627 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 162 529 162 635 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 204 525 204 631 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 242 525 242 631 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 283 522 283 628 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 322 521 322 627 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 152 529 152 635 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 173 527 173 633 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 193 527 193 633 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 214 526 214 632 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 233 525 233 631 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 252 524 252 630 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 273 523 273 629 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 293 522 293 628 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 311 520 311 626 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 330 520 330 626 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 142 635 107 612 104 588 39 542 25 553 2 535 2 59 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 4 58 147 127 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 142 635 107 612 104 588 39 542 25 553 2 535 2 59 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 337 442 337 130 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 329 130 329 444 329 445 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 320 130 320 444 320 445 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 311 130 311 445 311 446 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 301 130 301 446 301 447 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 292 130 292 444 292 445 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 281 130 281 446 281 447 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 272 130 272 447 272 448 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 261 130 261 448 261 449 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 251 130 251 447 251 448 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 241 130 241 448 241 449 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 232 130 232 448 232 449 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 222 130 222 450 222 451 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 213 130 213 447 213 448 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 203 130 203 451 203 452 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 193 130 193 449 193 450 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 182 130 182 450 182 451 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 174 130 174 451 174 452 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 165 130 165 453 165 454 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 156 130 156 453 156 454 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 145 452 145 130 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 147 125 337 125 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 130 466 325 456 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 132 463 327 453 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 134 461 329 451 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 135 459 330 449 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 141 457 336 447 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 142 456 337 446 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 125 479 320 469 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 125 474 320 464 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 128 471 323 461 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 129 469 324 459 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 122 482 317 472 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 125 477 320 467 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 123 500 318 490 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 26 554 56 554 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 34 546 44 546 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 29 552 54 552 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 32 549 50 549 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 107 64 107 50 73 50 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 73 50 73 65 73 62 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 74 64 108 64 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 108 49 214 101 214 114 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 60 43 177 43 197 51 198 51 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 197 51 154 51 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 155 51 248 100 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 213 101 246 101 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 198 52 198 64 197 64 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 180 64 198 64 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 215 115 249 115 249 101 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 74 50 59 44 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 108 64 214 116 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 60 45 60 57 73 64 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 4 58 60 58 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 336 125 213 60 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 200 59 214 59 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 114 52 114 68 115 68 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 119 53 119 69 120 69 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 125 56 125 72 126 72 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 130 59 130 75 131 75 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 136 62 136 78 137 78 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 142 65 142 81 143 81 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 148 69 148 85 149 85 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 153 72 153 88 154 88 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 159 74 159 90 160 90 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 165 77 165 93 166 93 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 171 78 171 94 172 94 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 176 82 176 98 177 98 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 182 85 182 101 183 101 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 188 89 188 105 189 105 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 194 92 194 108 195 108 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 200 96 200 112 201 112 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 206 97 206 113 207 113 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 211 100 211 116 212 116 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 79 50 79 65 79 62 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 87 51 87 64 87 63 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 95 51 95 64 95 63 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 64 46 64 61 64 58 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 69 48 69 63 69 60 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 219 102 219 115 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 225 102 225 115 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 232 102 232 115 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 239 101 239 114 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 244 101 244 114 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 190 51 190 64 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 184 51 184 64 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 177 52 177 63 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 168 52 168 58 9999 9999
+2 1 0 1 -1 0 0 0 0.000 -1 0 0
+ 101 51 101 64 101 63 9999 9999