This appendix describes a set of macros for accessing some of the PostScript builtin functions. Each of these macros issues a single PostScript command. The extra services provided by TeXdraw are the interpretation of coordinates in user units relative to the current drawing segment and the writing of a pending TeXdraw move to the PostScript file. This last operation establishes the current point in PostScript. The user of these commands should be familiar with the concepts of path construction and filling in PostScript. Further details on the PostScript functions used can found in the PostScript Language Reference Manual, Second Edition, Adobe Systems, Addison-Wesley, 1990.
These macros are distributed in file `txdps.tex'.
The \PSsetlinecap
and \PSsetlinejoin
commands control the
way line ends and line joins are rendered. The default values set by
TeXdraw (round caps and round join) are appropriate for most
drawings. Changes to these parameters apply to the current and
subsequent paths.
\PSsetlinecap type
0
gives a butt cap;
1
gives a round cap; and 2
gives a projecting square cap.
The initial value is corresponds to a round cap.
\PSsetlinejoin type
0
gives a miter join;
1
gives a round join; and 2
gives a bevel join. The
initial value corresponds to a round join.
PostScript paths and fill operations can be controlled by a number of
functions. By design, TeXdraw always maintains a defined PostScript
current point. Some of the following macros cause the PostScript
current point to become undefined. The PostScript current point must be
set again (say with a \PSmoveto
command) before invoking basic
TeXdraw commands.
\PSstroke
\setgray
) and the current line pattern (set
with \lpatt
). The PostScript current point becomes undefined.
\PSnewpath
\PSclosepath
\PSfill
\setgray
.
The following line commands interpret coordinates relative to the current TeXdraw scaling and drawing segment. The specified coordinate affects the drawing size as determined by TeXdraw.
\PSlineto (x y)
\lvec
. The PostScript current point must
be defined before this command is issued.
\PSmoveto (x y)
(x y)
. The
PostScript current point becomes defined.
The following macros provide access to the general arc commands in PostScript. The coordinates are interpreted relative to the current TeXdraw scaling and drawing segment. The specified coordinate affects the drawing size as determined by TeXdraw.
\PSarc r:radius sd:start-angle ed:end-angle (x y)
\PSarcn r:radius sd:start-angle ed:end-angle (x y)
The macro \writeps
provides the general facility to write
arbitrary PostScript commands to the PostScript file. This macro is
used by the preceding commands and by the TeXdraw commands
themselves. This facility has to be used with care since changes in
position or scaling resulting from the PostScript commands are not known
to TeXdraw.
\writeps {<ps-commands>}
Go to the first, previous, next, last section, table of contents.