%% BEGIN pst-char.tex
%%
%% Stroking and filling characters with line and fill styles with PSTricks 97.
%% See the PSTricks User's Guide for description.
%% See chartest.tex for sample input.
%%
\def\fileversion{97 patch 1}
\def\filedate{1998/07/03}
%%
%% COPYRIGHT 1993, by Timothy Van Zandt, tvz@Princeton.EDU
%% See pstricks.tex for copying restrictions.
%%

\message{ v\fileversion, \filedate}

\csname PSTcharpathLoaded\endcsname
\let\PSTcharpathLoaded\endinput

\ifx\PSTricksLoaded\endinput\else
  \def\next{\input pstricks.tex}
  \expandafter\next
\fi

\edef\TheAtCode{\the\catcode`\@}
\catcode`\@=11

\def\tx@CharPathShow{%
  /tx@CharPathSavedShow /show load def
  /show {
    % These 3 lines check whether charpath yields anything interesting.
    dup gsave newpath 0 0 moveto
    true charpath pathbbox grestore
    3 -1 roll eq 3 1 roll eq and
    % If not, just use show.
    { tx@CharPathSavedShow }
    % Otherwise, use charpath.
    { true charpath }
    ifelse }
  def }

\def\pscharpath{\def\pst@par{}\pst@object{pscharpath}}
\def\pscharpath@i{\pst@makebox\pscharpath@ii}
\def\pscharpath@ii{%
  \leavevmode\hbox{%
    \pstVerb{\tx@CharPathShow}%
    \box\pst@hbox
    \pstVerb{/show /tx@CharPathSavedShow load def}%
    \begin@ClosedObj
      \def\pst@linetype{1}%
      \psdashadjustfalse
      \showpointsfalse
      \let\pst@newpath\@empty
      \def\use@pscode{%
        \pst@Verb{%
          gsave
            \tx@STV
            \pst@code
          grestore
% DG/SR modification begin - Jul.  3, 1998 - Patch 1
%          \if@star\else CP newpath moveto \fi}}%
          \if@star\else CP newpath moveto \fi}
        \gdef\pst@code{}}%
% DG/SR modification end
    \end@ClosedObj}}

\def\pscharclip{\def\pst@par{}\pst@object{pscharclip}}
\def\pscharclip@i{\pst@makebox\pscharclip@ii}
\def\pscharclip@ii{%
  \leavevmode
  \begingroup
    \begin@psclip
    {\@startrue\pscharpath@ii}%
    \pstVerb{clip \if@star\else currentpoint newpath moveto\fi}%
    \def\endpscharclip{\end@psclip\endgroup}%
    \ignorespaces}
\def\endpscharclip{\pst@misplaced\endpscharclip}

\catcode`\@=\TheAtCode\relax

\endinput
%%
%% END pst-char.tex
