/usr/share/lout/include/figf is in lout-common 3.39-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 | ###############################################################################
# #
# Lout @Fig package for drawing figures (Version 2.0) #
# #
# Version 1.0 by Jeffrey H. Kingston, October 1991. #
# Version 2.0 by Jeffrey H. Kingston, 22 December 1992. #
# Symbol names changed by JHK 5 March 1993 to avoid clashes with EPS files. #
# @CurveBox and @ShadowBox added by JHK April 1995. #
# #
# See "Fig - a Lout package for drawing figures" for user information. #
# #
# This package is now obsolete, having been replaced by @Diag. #
# #
# This program is free software; you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation; either Version 3, or (at your option) #
# any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program; if not, write to the Free Software #
# Foundation, Inc., 59 Temple Place, Suite 330, Boston MA 02111-1307 USA #
# #
# As a special exception, when this file is read by Lout when processing #
# a Lout source document, you may use the result without restriction. #
# #
###############################################################################
@SysPrependGraphic { "figf.lpg" }
export in cm pt em sp vs ft dg
"<<" "**" "++" "--" @Max @Min
@Distance @XDistance @YDistance @Angle
@Prev "::" @Label @BaseOf @MarkOf @ShowLabels @Figure
@Frame @Box @CurveBox @ShadowBox @Square @Diamond @Polygon @Ellipse
@Circle @HLine @VLine @Line @HArrow @VArrow @Arrow @Arc
def @Fig
named maxlabels { 200 }
named linestyle { solid }
named linewidth { 0.5 pt }
named linecap { round }
named dashlength { 0.15 cm }
named paint { nopaint }
named margin { 0.4c }
named arrow { noarrow }
named headstyle { open }
named headwidth { 0.05 cm }
named headlength { 0.15 cm }
body @Body
@Begin
# Like @Graphic, but affects the graphics state of right parameter
def @InnerGraphic
left ps
right x
{
@BackEnd @Case {
PostScript @Yield { { ps gsave // grestore } @Graphic x }
PDF @Yield { }
}
}
def in precedence 39 left x {
@BackEnd @Case {
PostScript @Yield { x "in" }
PDF @Yield { "__mul(__in, "x")" }
}
}
def cm precedence 39 left x {
@BackEnd @Case {
PostScript @Yield { x "cm" }
PDF @Yield { "__mul(__cm, "x")" }
}
}
def pt precedence 39 left x {
@BackEnd @Case {
PostScript @Yield { x "pt" }
PDF @Yield { "__mul(__pt, "x")" }
}
}
def em precedence 39 left x {
@BackEnd @Case {
PostScript @Yield { x "em" }
PDF @Yield { "__mul(__em, "x")" }
}
}
def sp precedence 39 left x {
@BackEnd @Case {
PostScript @Yield { x "sp" }
PDF @Yield { "__mul(__louts, "x")" }
}
}
def vs precedence 39 left x {
@BackEnd @Case {
PostScript @Yield { x "vs" }
PDF @Yield { "__mul(__loutv, "x")" }
}
}
def ft precedence 39 left x {
@BackEnd @Case {
PostScript @Yield { x "ft" }
PDF @Yield { "__mul(__loutf, "x")" }
}
}
def dg precedence 39 left x {
@BackEnd @Case {
PostScript @Yield { x "dg" }
PDF @Yield { }
}
}
def "<<"
precedence 38
left length
right angle
{
@BackEnd @Case {
PostScript @Yield {
0 0 length angle "lfigatangle"
}
PDF @Yield {
}
}
}
def "**"
precedence 37
left point
right length
{
@BackEnd @Case {
PostScript @Yield {
point length "lfigpmul"
}
PDF @Yield {
}
}
}
def "++"
precedence 36
associativity left
left x
right y
{
@BackEnd @Case {
PostScript @Yield {
x y "lfigpadd"
}
PDF @Yield {
}
}
}
def "--"
precedence 36
associativity left
left x
right y
{
@BackEnd @Case {
PostScript @Yield {
y x "lfigpsub"
}
PDF @Yield {
}
}
}
def @Max
precedence 36
left x
right y
{
@BackEnd @Case {
PostScript @Yield {
x y "lfigpmax"
}
PDF @Yield {
}
}
}
def @Min
precedence 36
left x
right y
{
@BackEnd @Case {
PostScript @Yield {
x y "lfigpmin"
}
PDF @Yield {
}
}
}
def @Distance
precedence 35
left x
right y
{
@BackEnd @Case {
PostScript @Yield {
x y "lfigdistance"
}
PDF @Yield {
}
}
}
def @XDistance
precedence 35
left x
right y
{
@BackEnd @Case {
PostScript @Yield {
x y "lfigxdistance"
}
PDF @Yield {
}
}
}
def @YDistance
precedence 35
left x
right y
{
@BackEnd @Case {
PostScript @Yield {
x y "lfigydistance"
}
PDF @Yield {
}
}
}
def @Angle
precedence 35
left x
right y
{
@BackEnd @Case {
PostScript @Yield {
x y "lfigangle"
}
PDF @Yield {
}
}
}
def @Prev
{
@BackEnd @Case {
PostScript @Yield {
"lfigprevious"
}
PDF @Yield {
}
}
}
def "::"
precedence 33
left name
right x
{
@BackEnd @Case {
PostScript @Yield {
{ "currentdict end" maxlabels "dict begin begin"
// "("name") lfigpromotelabels" } @Graphic x
}
PDF @Yield {
}
}
}
def @Label
right name
{
@BackEnd @Case {
PostScript @Yield {
"/"name "lfigpointdef"
}
PDF @Yield {
}
}
}
def @MarkOf
precedence 32
left point
right x
{
@BackEnd @Case {
PostScript @Yield {
{ point "translate" } @InnerGraphic
{
/0io |0io @OneCol @OneRow x |0io /0io
}
}
PDF @Yield {
}
}
}
def @BaseOf
precedence 32
left point
right x
{
@BackEnd @Case {
PostScript @Yield {
{ point "translate" } @InnerGraphic
{
/0io |0io @OneRow @OneCol {
| @OneCol @OneRow x ^/
} |0io /0io
}
}
PDF @Yield {
}
}
}
def @ShowLabels
{
@BackEnd @Case {
PostScript @Yield {
"lfigshowlabels" @Graphic
}
PDF @Yield {
}
}
}
def @Figure
named shape { }
named linestyle { linestyle }
named linewidth { linewidth }
named linecap { linecap }
named dashlength { dashlength }
named arrow { arrow }
named headstyle { headstyle }
named headwidth { headwidth }
named headlength { headlength }
named paint { paint }
named margin { 0c }
right x
{
@BackEnd @Case {
PostScript @Yield {
@HContract @VContract
{
#fill the shape
paint @Case
{
nopaint @Yield {}
{ nochange darkblue blue lightblue darkgreen green lightgreen
darkred red lightred darkcyan cyan lightcyan darkmagenta
magenta lightmagenta darkyellow yellow lightyellow darkgray
gray lightgray darkgrey grey lightgrey black white }
@Yield
{ "/lfig"paint "[" shape "] gsave lfigpaintpath grestore" }
}
# stroke the path and add any arrowheads
linestyle @Case
{
{ solid dashed cdashed dotted noline } @Yield
{
linewidth "setlinewidth" "lfig"linecap "setlinecap"
dashlength "/lfig"linestyle "[" shape "] lfigdopath"
arrow @Case
{
noarrow @Yield { pop pop }
{ forward back both } @Yield
{ dashlength "/lfig"linestyle "/"lfigblack
headstyle @Case
{ { open halfopen closed } @Yield "lfig"headstyle }
headlength headwidth "lfig"arrow
}
}
}
}
}
@Graphic
{
^/margin ^|margin @OneCol @OneRow x |margin
/margin
}
}
PDF @Yield {
}
}
}
def @Frame
right x
{
@Figure
shape {xsize 0 @Label X 0 ysize @Label Y}
{ x }
}
def @Box
named linestyle { linestyle }
named linewidth { linewidth }
named linecap { linecap }
named dashlength { dashlength }
named paint { paint }
named margin { margin }
right x
{
@Figure
shape {
# 0 0 @Label SW
# xsize 0 @Label SE
# xsize ysize @Label NE
# 0 ysize @Label NW
# SE ** 0.5 @Label S
# NW ** 0.5 @Label W
# W ++ SE @Label E
# S ++ NW @Label N
# NE ** 0.5 @Label CTR
# SW SE NE NW SW
lfigbox
}
linestyle { linestyle }
linewidth { linewidth }
linecap { linecap }
dashlength { dashlength }
paint { paint }
margin { margin }
x
}
def @CurveBox
named linestyle { linestyle }
named linewidth { linewidth }
named linecap { linecap }
named dashlength { dashlength }
named paint { paint }
named margin { margin }
right x
{
@Figure
shape {
lfigcurvebox
}
linestyle { linestyle }
linewidth { linewidth }
linecap { linecap }
dashlength { dashlength }
paint { paint }
margin { margin }
{ 0c @HShift x }
}
def @ShadowBox
named linestyle { linestyle }
named linewidth { linewidth }
named linecap { linecap }
named dashlength { dashlength }
named paint { paint }
named margin { margin }
named shadow { 0.2f }
right x
{
@BackEnd @Case {
PostScript @Yield {
@VContract @HContract 0c @HShift "lfigshadow" @Graphic
{
^/shadow ^|shadow 0c @HShift
@Figure
shape {
lfigbox
}
linestyle { linestyle }
linewidth { linewidth }
linecap { linecap }
dashlength { dashlength }
paint { paint }
margin { margin }
0c @HShift x
|shadow /shadow
}
}
PDF @Yield {
@VContract @HContract 0c @HShift
# "lfigshadow" @Graphic is this:
{ "__mul(__xmark, 2) 0 m __xsize 0 l" # xmark 2 mul 0 moveto xsize 0 lineto
"__xsize __sub(__ysize, __mul(__xmark, 2)) l" # xsize ysize xmark 2 mul sub lineto
"__sub(__xsize, __xmark) __sub(ysize, __mul(__xmark, 2)) l" # xsize xmark sub ysize xmark 2 mul sub lineto
"__sub(__xsize, __xmark) __xmark l" # xsize xmark sub xmark lineto
"__mul(__xmark, 2) __xmark l h f" # xmark 2 mul xmark lineto closepath fill
} @Graphic
{
^/shadow ^|shadow 0c @HShift
@Figure
shape {
lfigbox
}
linestyle { linestyle }
linewidth { linewidth }
linecap { linecap }
dashlength { dashlength }
paint { paint }
margin { margin }
0c @HShift x
|shadow /shadow
}
}
}
}
def @Square
named linestyle { linestyle }
named linewidth { linewidth }
named linecap { linecap }
named dashlength { dashlength }
named paint { paint }
named margin { margin }
right x
{
@Figure
shape {
# {xsize ysize} ** 0.5 @Label CTR
# CTR ++ {{xsize xsize} @Max {ysize ysize}}**0.5 @Label NE
# CTR ++ { {CTR @Distance NE} << 135 } @Label NW
# CTR ++ { {CTR @Distance NE} << 225 } @Label SW
# CTR ++ { {CTR @Distance NE} << 315 } @Label SE
# SW ** 0.5 ++ SE ** 0.5 @Label S
# NW ** 0.5 ++ NE ** 0.5 @Label N
# SW ** 0.5 ++ NW ** 0.5 @Label W
# SE ** 0.5 ++ NE ** 0.5 @Label E
# SW SE NE NW SW
lfigsquare
}
linestyle { linestyle }
linewidth { linewidth }
linecap { linecap }
dashlength { dashlength }
paint { paint }
margin { margin }
x
}
def @Diamond
named linestyle { linestyle }
named linewidth { linewidth }
named linecap { linecap }
named dashlength { dashlength }
named paint { paint }
named margin { margin }
right x
{
@Figure
shape {
# {xsize 0} ** 0.5 @Label S
# {0 ysize} ** 0.5 @Label W
# S ++ W @Label CTR
# CTR ++ W @Label N
# CTR ++ S @Label E
# S E N W S
lfigdiamond
}
linestyle { linestyle }
linewidth { linewidth }
linecap { linecap }
dashlength { dashlength }
paint { paint }
margin { margin }
x
}
def @Polygon
named linestyle { linestyle }
named linewidth { linewidth }
named linecap { linecap }
named dashlength { dashlength }
named paint { paint }
named margin { margin }
named sides { 3 }
named angle { "dup 180 exch div" }
right x
{
@Figure
shape { sides angle lfigpolygon }
linestyle { linestyle }
linewidth { linewidth }
linecap { linecap }
dashlength { dashlength }
paint { paint }
margin { margin }
x
}
def @Ellipse
named linestyle { linestyle }
named linewidth { linewidth }
named linecap { linecap }
named dashlength { dashlength }
named paint { paint }
named margin { margin }
right x
{
@Figure
shape {
# {xsize 0} ** 0.5 @Label S
# {0 ysize} ** 0.5 @Label W
# S ++ W @Label CTR
# CTR ++ W @Label N
# CTR ++ S @Label E
# CTR ++ {xsize 0} ** 0.3536 ++ {0 ysize} ** 0.3536 @Label NE
# CTR ++ {xsize 0} ** 0.3536 -- {0 ysize} ** 0.3536 @Label SE
# CTR -- {xsize 0} ** 0.3536 ++ {0 ysize} ** 0.3536 @Label NW
# CTR -- {xsize 0} ** 0.3536 -- {0 ysize} ** 0.3536 @Label SW
# S [ CTR ] E [ CTR ] N [ CTR ] W [ CTR ] S
lfigellipse
}
linestyle { linestyle }
linewidth { linewidth }
linecap { linecap }
dashlength { dashlength }
paint { paint }
margin { margin }
x
}
def @Circle
named linestyle { linestyle }
named linewidth { linewidth }
named linecap { linecap }
named dashlength { dashlength }
named paint { paint }
named margin { margin }
right x
{
@Figure
shape {
# {xsize ysize} **0.5 @Label CTR
# CTR ++ {{xsize 0} @Max {ysize 0}}**0.5 @Label E
# CTR ++ { {CTR @Distance E} << 45 } @Label NE
# CTR ++ { {CTR @Distance E} << 90 } @Label N
# CTR ++ { {CTR @Distance E} << 135 } @Label NW
# CTR ++ { {CTR @Distance E} << 180 } @Label W
# CTR ++ { {CTR @Distance E} << 225 } @Label SW
# CTR ++ { {CTR @Distance E} << 270 } @Label S
# CTR ++ { {CTR @Distance E} << 315 } @Label SE
# S [ CTR ] E [ CTR ] N [ CTR ] W [ CTR ] S
lfigcircle
}
linestyle { linestyle }
linewidth { linewidth }
linecap { linecap }
dashlength { dashlength }
paint { paint }
margin { margin }
x
}
def @HLine
named linestyle { linestyle }
named linewidth { linewidth }
named linecap { linecap }
named dashlength { dashlength }
named paint { paint }
named margin { 0c }
named arrow { arrow }
named headstyle { headstyle }
named headwidth { headwidth }
named headlength { headlength }
right x
{
@Figure
shape {
# 0 ymark @Prev @Label FROM
# xsize ymark @Prev @Label TO
lfighline
}
linestyle { linestyle }
linewidth { linewidth }
linecap { linecap }
dashlength { dashlength }
paint { paint }
margin { margin }
arrow { arrow }
headstyle { headstyle }
headwidth { headwidth }
headlength { headlength }
x
}
def @VLine
named linestyle { linestyle }
named linewidth { linewidth }
named linecap { linecap }
named dashlength { dashlength }
named paint { paint }
named margin { 0c }
named arrow { arrow }
named headstyle { headstyle }
named headwidth { headwidth }
named headlength { headlength }
right x
{
@Figure
shape {
# xmark ysize @Prev @Label FROM
# xmark 0 @Prev @Label TO
lfigvline
}
linestyle { linestyle }
linewidth { linewidth }
linecap { linecap }
dashlength { dashlength }
paint { paint }
margin { margin }
arrow { arrow }
headstyle { headstyle }
headwidth { headwidth }
headlength { headlength }
x
}
def @HArrow
named linestyle { linestyle }
named linewidth { linewidth }
named linecap { linecap }
named dashlength { dashlength }
named paint { paint }
named margin { 0c }
named arrow { forward }
named headstyle { headstyle }
named headwidth { headwidth }
named headlength { headlength }
right x
{
@Figure
shape {
# 0 ymark @Prev @Label FROM
# xsize ymark @Prev @Label TO
lfighline
}
linestyle { linestyle }
linewidth { linewidth }
linecap { linecap }
dashlength { dashlength }
paint { paint }
margin { margin }
arrow { arrow }
headstyle { headstyle }
headwidth { headwidth }
headlength { headlength }
x
}
def @VArrow
named linestyle { linestyle }
named linewidth { linewidth }
named linecap { linecap }
named dashlength { dashlength }
named paint { paint }
named margin { 0c }
named arrow { forward }
named headstyle { headstyle }
named headwidth { headwidth }
named headlength { headlength }
right x
{
@Figure
shape {
# xmark ysize @Prev @Label FROM
# xmark 0 @Prev @Label TO
lfigvline
}
linestyle { linestyle }
linewidth { linewidth }
linecap { linecap }
dashlength { dashlength }
paint { paint }
margin { margin }
arrow { arrow }
headstyle { headstyle }
headwidth { headwidth }
headlength { headlength }
x
}
def @Line
named from { 0 ysize }
named to { xsize 0 }
named linestyle { linestyle }
named linewidth { linewidth }
named linecap { linecap }
named dashlength { dashlength }
named paint { paint }
named margin { 0c }
named arrow { arrow }
named headstyle { headstyle }
named headwidth { headwidth }
named headlength { headlength }
right x
{
@Figure
shape {
from @Prev @Label FROM
to @Prev @Label TO
}
linestyle { linestyle }
linewidth { linewidth }
linecap { linecap }
dashlength { dashlength }
paint { paint }
margin { margin }
arrow { arrow }
headstyle { headstyle }
headwidth { headwidth }
headlength { headlength }
x
}
def @Arrow
named from { 0 ysize }
named to { xsize 0 }
named linestyle { linestyle }
named linewidth { linewidth }
named linecap { linecap }
named dashlength { dashlength }
named paint { paint }
named margin { 0c }
named arrow { forward }
named headstyle { headstyle }
named headwidth { headwidth }
named headlength { headlength }
right x
{
@Figure
shape {
from @Prev @Label FROM
to @Prev @Label TO
}
linestyle { linestyle }
linewidth { linewidth }
linecap { linecap }
dashlength { dashlength }
paint { paint }
margin { margin }
arrow { arrow }
headstyle { headstyle }
headwidth { headwidth }
headlength { headlength }
x
}
def @Arc
named from { 0 ysize }
named to { xsize 0 }
named ctr { 0 0 }
named direction { clockwise }
named linestyle { linestyle }
named linewidth { linewidth }
named linecap { linecap }
named dashlength { dashlength }
named paint { paint }
named margin { 0c }
named arrow { noarrow }
named headstyle { headstyle }
named headwidth { headwidth }
named headlength { headlength }
right x
{
@Figure
shape {
from @Label FROM
to @Label TO
ctr @Label CTR
FROM [ CTR
direction @Case { {clockwise anticlockwise} @Yield direction }
] TO
}
linestyle { linestyle }
linewidth { linewidth }
linecap { linecap }
dashlength { dashlength }
paint { paint }
margin { margin }
arrow { arrow }
headstyle { headstyle }
headwidth { headwidth }
headlength { headlength }
x
}
@BackEnd @Case {
PostScript @Yield {
{ "grestore save gsave" maxlabels "dict begin lfigdict begin"
// "end end restore"
} @Graphic @Body
}
PDF @Yield {
}
}
@End @Fig
|