Debian Codegraph @

texmf-dist/tex/generic/texdraw/txdps.tex

raw
1 % TeXdraw macros to access PostScript builtins
2
3 % $Id: txdps.tex 1.10 2019/04/18 TeXdraw-v2r3 $
4
5 % Copyright (C) 1991-2019 Peter Kabal
6
7 % This work is licensed under the Creative Commons Attribution (CC-BY)
8 % License, any version. To view the licenses, visit
9 % creativecommons.org/licenses/by or send a letter to
10 % Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.
11
12 % Peter Kabal
13 % Department of Electrical & Computer Engineering
14 % McGill University
15
16 % peter dot kabal at mcgill dot ca
17 % http://www-mmsp.ece.mcgill.ca/MMSP/Documents/Software/
18
19 % ===============================================================
20
21 \chardef\catamp=\the\catcode`\@
22 \catcode`\@=11
23
24 % The TeXdraw macros assume that a PostScript currentpoint is always
25 % defined. When using the following macros, always finish off with
26 % by reestablishing a PostScript currentpoint. This can be done with
27 % a \PSmoveto command.
28
29 \def\PSsetlinecap #1 {\writeps{#1 setlinecap}}
30 \def\PSsetlinejoin #1 {\writeps{#1 setlinejoin}}
31 \def\PSstroke {\writeps{stroke}}
32 \def\PSnewpath {\writeps{newpath}}
33 \def\PSclosepath {\writeps{closepath}}
34 \def\PSfill {\writeps{fill}}
35 \def\PSlineto (#1 #2){\getpos (#1 #2)\a@rgx\a@rgy
36 \s@etpospix \a@rgx \a@rgy
37 \writeps {\the\x@pix\space \the\y@pix\space lineto}}
38 \def\PSmoveto (#1 #2){\getpos (#1 #2)\a@rgx\a@rgy
39 \s@etpospix \a@rgx \a@rgy
40 \writeps {\the\x@pix\space \the\y@pix\space moveto}}
41 \def\PSarc r:#1 sd:#2 ed:#3 (#4 #5){\getpos (#4 #5)\a@rgx\a@rgy
42 \s@etpospix \a@rgx \a@rgy
43 \coordtopix {#1}\t@pixa
44 \writeps{\the\x@pix\space \the\y@pix\space
45 \the\t@pixa\space #2 #3 arc}}
46 \def\PSarcn r:#1 sd:#2 ed:#3 (#4 #5){\getpos (#4 #5)\a@rgx\a@rgy
47 \s@etpospix \a@rgx \a@rgy
48 \coordtopix {#1}\t@pixa
49 \writeps{\the\x@pix\space \the\y@pix\space
50 \the\t@pixa\space #2 #3 arcn}}
51
52 \catcode`\@=\catamp