[pst-text] Typesetting text along a spiral

Denis Girou Denis.Girou at idris.fr
Thu Jul 2 20:40:42 CEST 1998


-----------------------------------------------------------------------------
This is the PSTricks mailing list, devoted to discussions about computational
graphics in (La)TeX using the PSTricks package from Timothy van Zandt.
For help using this mailing list, see instructions at the end of message.
-----------------------------------------------------------------------------

  Somebody ask me recently how to typeset text along a spiral.
With polar curves (graceful to Ulrich Dirr), it is of course very easy.

D.G.

% Typesetting text along a spiral or any polar curve - D.G. - July 1998

\documentclass{article}

\usepackage{pst-plot}
\usepackage{pst-text}

\makeatletter

% D.G. addition - Jun.  9, 1998 - Polar plots using the \psplot macro
% Code added according the way suggested by Ulrich Dirr <udirr at das-team.com>

% For polar plots
\newif\ifpolarplot
\def\psset at polarplot#1{\@nameuse{polarplot#1}}
\psset at polarplot{false}

\def\psplot at i#1#2#3{%
  \pst at killglue
  \begingroup
    \use at par
    \@nameuse{beginplot@\psplotstyle}%
% D.G. modification begin - Jun.  9, 1998
    \ifpolarplot
      \addto at pscode{%
        \psplot at init
        /x #1 def
        /x1 #2 def
        /dx x1 x sub \psk at plotpoints div def
        /xy {% Adapted from \parametricplot at i
          #3 dup x cos mul exch x sin mul
          \pst at number\psxunit mul exch
          \pst at number\psyunit mul exch
        } def}%
    \else
% D.G. modification end
      \addto at pscode{%
        \psplot at init
        /x #1 def
        /x1 #2 def
        /dx x1 x sub \psk at plotpoints div def
        /xy {
          x \pst at number\psxunit mul
          #3 \pst at number\psyunit mul
        } def}%
% D.G. modification begin - Jun.  9, 1998
    \fi
% D.G. modification end
    \gdef\psplot at init{}%
    \@pstfalse
    \@nameuse{testqp@\psplotstyle}%
    \if at pst
      \psplot at ii
    \else
      \psplot at iii
    \fi
  \endgroup
  \ignorespaces}

\makeatother

\pagestyle{empty}

\textwidth=18cm
\oddsidemargin=-2cm
\evensidemargin=-2cm

\newcommand{\Text}{%
\Large
You can draw everything you want along this spiral curve.
You can draw everything you want along this spiral curve.
You can draw everything you want along this spiral curve.}

\begin{document}

\psset{polarplot=true,plotpoints=300}

\begin{pspicture}(-3.6,-3.5)(4.2,4)
  \pstextpath[l]{\psplot[unit=5]
                        {-400}{400}{1 2.7182818 x 200 div exp 1 add div}}
                {\Text}
\end{pspicture}
\hfill
\begin{pspicture}(-4.6,-3.5)(4.2,4)
  \pstextpath[l]{\psplot[linestyle=none,unit=5]
                        {-400}{400}{1 2.7182818 x 200 div exp 1 add div}}
                {\Text}
\end{pspicture}

\begin{pspicture}(-4,-4.5)(4,4)
  \pstextpath[l]{\psplot[linestyle=none,unit=2]
                        {0}{360}{2 x mul cos abs sqrt 2 mul}}
                {\Text}
\end{pspicture}

\end{document}

-----------------------------------------------------------------------------
The list interface (subscription, information, access to the archives) is on:
http://www.tug.org/cgi-bin/lwgate/pstricks
Otherway to unsubscribe, send mail to pstricks-request at mail.tug.org
with a blank subject and in body the line unsubscribe <email-address>
-----------------------------------------------------------------------------



More information about the PSTricks mailing list