# [texhax] pgf: how to deform fonts

Reinhard Kotucha reinhard.kotucha at web.de
Fri Nov 25 22:19:21 CET 2011

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?

\pgftransformcm (page 639) allows you to change the current
transformation matrix.  You have to either use it within a PS/PDF
group or transform back manually afterwards.

\begin{pgfscope}
\pgftransformcm{1}{0.2}{0}{1}{\pgfpoint{0}{0}}
<some graphics elements or text>
\end{pgfscope}

or

\pgftransformcm{1}{0.2}{0}{1}{\pgfpoint{0}{0}}
<some graphics elements or text>
\pgftransformcm{1}{5}{0}{1}{\pgfpoint{0}{0}}

In PostScript one would write

gsave
1 .2 0 1 0 0 concat
(hello) show
grestore

with

a b c d e f concat

=>

x' = a*x + b*y + e
y' = c*x + d*y + f

By default, a b c d is the unity matrix and e and f are zero.

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.
----------------------------------------------------------------------------