groff
[Top][All Lists]
Advanced

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

Re: groff: gropdf, unlike grops, does not understand com10 paper size


From: G. Branden Robinson
Subject: Re: groff: gropdf, unlike grops, does not understand com10 paper size
Date: Tue, 12 Apr 2022 07:11:43 +1000
User-agent: NeoMutt/20180716

[fixing my junk Subject line and really looping in groff@gnu this time]

Thanks for the quick follow-up, Deri.  I'm quoting the whole original
mail I sent since I didn't manage to get it to the groff list as I
intended.

The context is a Debian bug report.  The reporter, brian m. carlson, is
CCed via the Debian bug tracking system.

At 2022-04-11T16:17:41+0100, Deri wrote:
> On Monday, 11 April 2022 09:33:00 BST G. Branden Robinson wrote:
> > package groff
> > tag 1009248 + upstream
> > thanks
> > 
> > [looping in gropdf author Deri James and groff development list]
> > 
> > Hi Brian,
> > 
> > > Package: groff
> > > Version: 1.22.4-8
> > > Severity: normal
> > > 
> > > If one invokes groff with -Tpdf, it does not understand the com10
> > > paper size used in North American Commercial / Number 10 envelopes,
> > > and the paper size used is A4.  However, if one uses -Tps, then the
> > > same invocation is recognized, and the correct size is used.
> > 
> > [snip]
> > 
> > Yes, I can reproduce this.
> > 
> > The problem seems to amount to the fact that grops(1), being written in
> > C++, uses the "libgroff" library, which defines the paper formats that
> > most output drivers recognize[1], whereas gropdf(1), being written in
> > Perl, defines its own list, which does not include "com10".[2]
> > 
> > Deri, would it be possible to add the missing paper formats to
> > gropdf.pl?  I reckon I can figure it out if you're busy.  Let me know.
> > 
> > [...]
> > 
> > > Ideally, since this is supported in grops and it's documented to work,
> > > I could indeed use -Tpdf for envelopes.  In the mean time, I've used
> > > ps2pdf as a workaround.
> > > 
> > > envelope.me
> > > ----
> > > .nf
> > > .po 0.5c
> > > .sp 0.5c
> > > .ft P
> > > Hôtel de Ville de Toronto
> > > 100 Rue Queen O
> > > Toronto ON M5H 2N2
> > > Canada
> > > .sp 2c
> > > .in 8.5c
> > > New York City Hall
> > > 1 City Hall
> > > New York NY 10007-1298
> > > États-Unis
> > > ---
> > > 
> > > 
> > > -- System Information:
> > > Debian Release: bookworm/sid
> > > 
> > >   APT prefers stable-security
> > >   APT policy: (500, 'stable-security'), (500, 'unstable'), (500,
> > >   'stable'), (500, 'oldstable'), (1, 'experimental')> 
> > > Architecture: amd64 (x86_64)
> > > Foreign Architectures: i386
> > 
> > Regards,
> > Branden
> > 
> > [1]
> > https://git.savannah.gnu.org/cgit/groff.git/tree/src/libs/libgroff/paper.cpp#n62
> > [2]
> > https://git.savannah.gnu.org/cgit/groff.git/tree/src/devices/gropdf/gropdf.pl#n146
> 
> Hi Branden,
> 
> I am very happy for you to improve the coverage of paper sizes. A few
> points to note:-
> 
> If you add to the bottom of the table in gropdf the "c6" line will need a 
> comma in the appropriate place.

Yup, good old aggregate initializers.

> All sizes are in points, width, height.

Acknowledged.

> Width is always the shorter edge, even for C-Series (envelopes).

Cool.  That's consistent with our other documentation of paper formats,
e.g., in groff_tmac(5).

[[
       papersize
                enables the paper size to be set on the command line by
                giving a -d paper=size option to troff.  Possible values
                for size are the ISO and DIN formats “A0–A6”, “B0–B6”,
                “C0–C6”, and “D0–D6”; the U.S. formats “letter”,
                “legal”, “tabloid”, “ledger”, “statement”, and
                “executive”; and the envelope formats “com10”,
                “monarch”, and “DL”.  All formats, even those for
                envelopes, are in portrait orientation, with their
                longer dimension as the length.  Appending “l” (ell) to
                any of these denotes landscape orientation instead.  An
                output device typically requires command‐line options -p
                and -l to override the paper dimensions and orientation,
                respectively, defined in its DESC file; see subsection
                “Paper sizes” of groff(1).  This macro file is normally
                loaded at startup by the troffrc file.
]]

> There are several other paper sizes which may be candidates for
> inclusion in both grops and gropdf, e.g.
> https://www.prepressure.com/library/paper-size

Wow--I've never seen such a comprehensive list before.

At present I'm content to ensure that gropdf(1) recognizes all the same
format names as libgroff; if a contributor would like to undertake a
more ambitious expansion, I'd welcome discussion on this list.

Regards,
Branden

Attachment: signature.asc
Description: PGP signature


reply via email to

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