[texhax] pgf: how to deform fonts

Reinhard Kotucha reinhard.kotucha at web.de
Sat Nov 26 01:28:44 CET 2011


On 2011-11-25 at 22:43:39 +0100, Herbert Voss wrote:

 > Am 25.11.2011 22:19, schrieb Reinhard Kotucha:
 > > On 2011-11-25 at 11:24:33 -0500, Victor Ivrii wrote:
 > >
 > >   >  I am trying to draw a cube with digits on its visible faces. Therefore
 > >   >  digits on the side faces should be deformed. Is there any easy way to
 > >   >  do this?
 > 
 > > In PostScript one would write
 > 
 > or using a package
 > 
 > \documentclass{minimal}
 > \usepackage{pst-solides3d}
 > 
 > \begin{document}
 > 
 > \begin{pspicture}(-1in,-1in)(1in,1in)
 > \psSolid[
 > object=cube,
 > a=2,
 > action=draw**,
 > numfaces=all,fontsize=40,
 > fillcolor=magenta!20]
 > \end{pspicture}
 > 
 > \end{document}

I presented the PostScript example because I'm much more familiar with
PostScript than with pgf/TikZ and because such things are well
described in the PostScript Reference Manual.

Though I used PostScript quite extensively in the past and am
absolutely convinced that it's a great thing, with the advent of
pdfTeX it became quite inconvenient to use.

I'm still using PostScript occasionally, but my favorite is LuaTeX
now.  The strength of PostScript, when compared with TeX, is its
ability to do floating point arithmetic efficiently.  The drawback of
pgf is that arithmetic is done with TeX, the drawback of pstricks is
that it depends on an external PostScript interpreter.

In most cases efficiency isn't very important, but I already created
TeX files which took more than 8 hours to compile and had to abort
them in order to shut down the machine before going home.

I'm now doing such things with LuaTeX and am amazed how easy it is.
With Lua instead of PostScript as a programming language you can do
everything more conveniently and more precise (PS uses single
precision floats, Lua uses double precision).  LuaTeX can support PS
and PDF, dependent on \pdfoutput, and even emitting SVG is simple.

It's probably easier to adapt pgf than pstricks in order to use Lua
for arithmetic.  Of course, such an adaption is not necessarily
"rounding-error-compatible".  As far as pgf is concerned, only the
low-level stuff has to be replaced.  pstricks seems to be more
problematic in this respect.

Herbert, I'm convinced that it's worthwhile to have a look at LuaTeX.

Regards,
  Reinhard

-- 
----------------------------------------------------------------------------
Reinhard Kotucha                                      Phone: +49-511-3373112
Marschnerstr. 25
D-30167 Hannover                              mailto:reinhard.kotucha at web.de
----------------------------------------------------------------------------
Microsoft isn't the answer. Microsoft is the question, and the answer is NO.
----------------------------------------------------------------------------


More information about the texhax mailing list