[XeTeX] xetex and pstricks-add

caapv 208 caapv208 at yahoo.co.jp
Mon Aug 25 03:46:09 CEST 2008


--- HAF MED <wap.haf at gmail.com> wrote:

> HELLO ;
> 
> I have remarked that a example in doc of
> pstricks-add don't works well with
> xetex.
> 
> \documentclass{article}
> \usepackage{pstricks-add}
> \usepackage{fontspec}
> 
> \begin{document}
> \begin{pspicture}(\linewidth,5)
> \psbrace(0,0.5)(\linewidth,0.5){\fbox{Text}}%
>
\psbrace[bracePos=0.25,nodesepB=10pt,rot=90](0,2)(\linewidth,2){\fbox{Text}}
>
\psbrace[ref=lC,nodesepA=-3.5cm,nodesepB=15pt,rot=90](0,4)(\linewidth,4){%
> \fbox{some very, very long wonderful Text}}
> \end{pspicture}
> \end{document}
> 
> the texte in the laste brace is not *vertical*
> 
> is the probleme in xetex or in the package
> pstricks-add
> > _______________________________________________
> XeTeX mailing list
> postmaster at tug.org
> http://tug.org/mailman/listinfo/xetex
> 

For those who are willing to fix the bug in xdvipdfmx,

PSTricks outputs PostScript code via 2 kinds of TeX
specials
using \pstverb and \pstVerb.
Any PS code generated by \pstverb is supposed be executed
in
a block enclosed by a save/restore pair, so that the
effect
should be local.  \pstverb is usually used to draw graphic
objects and xdvipdfmx let the distiller_template (e.g.
ghostscript)
to render the code into a PDF for inclusion.
On the other hand, PS code generated by \pstVerb may
modify
user dictionaries and/or the PS graphic state, and affects
the appearance of anything comes after on the same page.
Hence the default behaviour of xdvipdfmx for \pstVerb
outputs
is to store the contents in a temporary file and let the
distiller_template to run it when rendering of graphic
objects
is requested.
However, some of the \pstVerb outputs must not be treated
that
way.  For example, coordinate transformations are such
cases,
since they are supposed to transform not only PSTricks
generated
graphic objects but also TeX generated texts and specials
generated
by other packages.  So in this case and similar cases, the
contents of specials must be translated into PDF streams
and
be embedded directly in the document.  Needless to say,
the
distiller_template must not run such coordinate
transformations
when rendering graphics, since the transformations are
already
applied.
Since xdvipdfmx does not have a built-in PostScript
interpreter,
there is a simple heuristic to guess the purpose of
\pstVerb
outputs, which works fairly well provided that each
special is
a single purpose.

Unfortunately, \psbrace of pstricks-add generates a single
giant
\pstVerb special, which
 - performs coordinate shift for placing the brace,
 - draws the brace,
 - calculates the angle of the brace placement and stores
the result
   in an entry in a user dictionary (namely, /Alpha in
tx at dict),
at the same time.  Since it applies a coordinate
transformation,
xdvipdfmx does not store the contents into the temporary
file to
be run when further coordinate transformation is
calculated for
rotating the label text.

Certain degree of PostScript interpretation seems
necessary to
extract only the relevant code from the contents of a
special
and store it into the temporary definition file.

Regards,
SMiyata

--------------------------------------
For All Sports Lovers! SPORTS OHEN PROJECT 2008
http://pr.mail.yahoo.co.jp/yells/


More information about the XeTeX mailing list