groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Groff] PIC patch (was A little greeting card)


From: Deri James
Subject: [Groff] PIC patch (was A little greeting card)
Date: Fri, 1 Jan 2010 23:22:20 +0000
User-agent: KMail/1.12.2 (Linux/2.6.31.6-desktop-1mnb; KDE/4.3.2; x86_64; ; )

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

[Prev in Thread] Current Thread [Next in Thread]