After having looked at Ted's greeting card example I realised that 'pic' 
outputs:-

\X'ps: exec gsave currentpoint 2 copy translate %.4f rotate neg exch neg exch 
translate'

to achieve the rotation and terminates it with:-

\X'ps: exec grestore'

I wanted the PDF driver (gropdf) I've been working on to work with pic so I 
included these lines in the parser to rotate as appropriate. However I 
discovered that pic did not output the 'grestore' line when using pdf as the 
output device (but it did output the 'rotate' line).

The reason is because the 'rotate' line uses this condition:- 

.if \n(0p \{\

but the 'grestore' uses this condition:-

.if '\*(.T'ps' \{\

Register '0p' is set in ps.tmac (and pdf.tmac) but of course '.T' is different 
for 'ps' and 'pdf'.

This diff can patch 'pic' to use the same condition for both lines.

--- src/preproc/pic/troff.cpp~  2010-01-01 18:00:29.000000000 +0000
+++ src/preproc/pic/troff.cpp   2010-01-01 18:00:29.000000000 +0000
@@ -462,7 +462,7 @@
       fputs("\n.sp -1\n", stdout);
     }
   if (rotate_flag)
-    printf(".if '\\*(.T'ps' \\{\\\n"
+    printf(".if \\n(" GROPS_REG " \\{\\\n"
           "\\X'ps: exec grestore'\n.sp -1\n"
           ".\\}\n");
 }

Is this Ok Werner?

Cheers

Deri


Reply via email to