# [pstricks] How work psdiabox, pstriabox, psovalbox and pscircle

Arno Blouin arno_b at users.sourceforge.net
Wed Jul 12 09:15:26 CEST 2006

ARno wrote:
> > I am working on a graphical pstricks generator
> > (http://latexdraw.sourceforge.net/)
> > and I want to want know how the psdiabox, pstriabox, psovalbox and
> > pscircle commands are made; i.e., how the width and the height of the
> > triangle, the diamond, the circle and of the ellipse are computed. I am
> > not conversant with the code of the pstricks.tex file.

The object is placed into a TeX box and the width
\wd\hbox and height \ht\hbox and \dp\hbox are
passed to PostScript to draw the border lines.

It is _not_ possible to get the width and height
without knowing the font size and font shape.

Herbert

I know that.

Look at this exemple:
\begin{pspicture}(0,-4.78)(12.72,4.78)
\rput(0.3,-4.5){\psgrid(0,0)(0,0)(12,9)}
\usefont{T1}{ptm}{m}{n}
\rput(5.820781,2.51){\psdiabox[linewidth=0.6,framesep=0]{coucoucou}}
\rput(5.820781,1.01){\psdiabox[linewidth=0.02,framesep=0]{coucou}}
\rput(5.820781,0.21){\psdiabox[linewidth=0.2,framesep=0]{coucou}}
\rput(5.820781,-1.39){\psdiabox[linewidth=1.0,framesep=0]{coucou}}
\rput(5.8007812,-3.37){\psdiabox[linewidth=0.6,framesep=0]{coucou}}
\end{pspicture}

I want to know how the height and the width of these
rhombus are computed given a text of width 'w' and of
height 'h'. The thickness seems to play a part.



More information about the PSTricks mailing list