groff
[Top][All Lists]
Advanced

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

Re: [Groff] Misformatting of CR font in PIC macros


From: Roger Leigh
Subject: Re: [Groff] Misformatting of CR font in PIC macros
Date: Fri, 4 Feb 2011 10:18:18 +0000
User-agent: Mutt/1.5.20 (2009-06-14)

On Fri, Feb 04, 2011 at 10:48:42AM +0100, Werner LEMBERG wrote:
> 
> > The left-hand boxes in the figure contain "Filename" in Roman and
> > below it "hash.c" in Courier.  While in the pic macros both have the
> > same x offset, "hash.c" is offset further to the right than
> > "Filename", when both were expected to be exactly left-aligned.
> > Note that changing \fC to \fR results in perfect alignment.
> 
> The difference in formatting is due to the different width of spaces
> in the two fonts.  You shouldn't write
> 
>   \fR foo \fP...
>   \fC bar \fP...
> 
> but rather
> 
>   \fRfoo\fP...
>   \fCbar\fP...
> 
> groff is not LaTeX :-) spaces after a `\fX' command are *not*
> suppressed.

Wow, thanks for the amazingly fast reponses everyone!

I did wonder about the space there, but because it was generated by
fig2dev (fig→pic), I assumed that it would be correct, but it's
actually fig2dev being buggy here:

diff -urN transfig-3.2.5.c.original/fig2dev/dev/genpic.c 
transfig-3.2.5.c/fig2dev/dev/genpic.c
--- transfig-3.2.5.c.original/fig2dev/dev/genpic.c      2011-02-04 
09:59:54.585215258 +0000
+++ transfig-3.2.5.c/fig2dev/dev/genpic.c       2011-02-04 10:00:22.170225762 
+0000
@@ -443,7 +443,7 @@
        size = PICFONTMAG(t);
        if (!OptNoUnps) {
          unpsfont(t);
-         fprintf(tfp, "\"\\s%d\\f%s ", size, PICFONT(t->font));
+         fprintf(tfp, "\"\\s%d\\f%s", size, PICFONT(t->font));
        } else {
          fprintf(tfp, ".ps\n.ps %d\n", size );
          fprintf(tfp, ".ft\n.ft %s\n", PICPSFONT(t) );

It's also losing numerical precision with %.2f format strings which
clip off the extra precision and result in really awful alignment.
Fixing these issues results in a perfect figure, so this is not a
groff issue in any way.


Many thanks again!
Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux             http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?       http://gutenprint.sourceforge.net/
   `-    GPG Public Key: 0x25BFB848   Please GPG sign your mail.

Attachment: signature.asc
Description: Digital signature


reply via email to

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