diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /graphics/texdraw/txdps.tex |
Initial commit
Diffstat (limited to 'graphics/texdraw/txdps.tex')
-rw-r--r-- | graphics/texdraw/txdps.tex | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/graphics/texdraw/txdps.tex b/graphics/texdraw/txdps.tex new file mode 100644 index 0000000000..482e3faf40 --- /dev/null +++ b/graphics/texdraw/txdps.tex @@ -0,0 +1,52 @@ +% TeXdraw macros to access PostScript builtins + +% $Id: txdps.tex 1.10 2019/04/18 TeXdraw-v2r3 $ + +% Copyright (C) 1991-2019 Peter Kabal + +% This work is licensed under the Creative Commons Attribution (CC-BY) +% License, any version. To view the licenses, visit +% creativecommons.org/licenses/by or send a letter to +% Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. + +% Peter Kabal +% Department of Electrical & Computer Engineering +% McGill University + +% peter dot kabal at mcgill dot ca +% http://www-mmsp.ece.mcgill.ca/MMSP/Documents/Software/ + +% =============================================================== + +\chardef\catamp=\the\catcode`\@ +\catcode`\@=11 + +% The TeXdraw macros assume that a PostScript currentpoint is always +% defined. When using the following macros, always finish off with +% by reestablishing a PostScript currentpoint. This can be done with +% a \PSmoveto command. + +\def\PSsetlinecap #1 {\writeps{#1 setlinecap}} +\def\PSsetlinejoin #1 {\writeps{#1 setlinejoin}} +\def\PSstroke {\writeps{stroke}} +\def\PSnewpath {\writeps{newpath}} +\def\PSclosepath {\writeps{closepath}} +\def\PSfill {\writeps{fill}} +\def\PSlineto (#1 #2){\getpos (#1 #2)\a@rgx\a@rgy + \s@etpospix \a@rgx \a@rgy + \writeps {\the\x@pix\space \the\y@pix\space lineto}} +\def\PSmoveto (#1 #2){\getpos (#1 #2)\a@rgx\a@rgy + \s@etpospix \a@rgx \a@rgy + \writeps {\the\x@pix\space \the\y@pix\space moveto}} +\def\PSarc r:#1 sd:#2 ed:#3 (#4 #5){\getpos (#4 #5)\a@rgx\a@rgy + \s@etpospix \a@rgx \a@rgy + \coordtopix {#1}\t@pixa + \writeps{\the\x@pix\space \the\y@pix\space + \the\t@pixa\space #2 #3 arc}} +\def\PSarcn r:#1 sd:#2 ed:#3 (#4 #5){\getpos (#4 #5)\a@rgx\a@rgy + \s@etpospix \a@rgx \a@rgy + \coordtopix {#1}\t@pixa + \writeps{\the\x@pix\space \the\y@pix\space + \the\t@pixa\space #2 #3 arcn}} + +\catcode`\@=\catamp |