bug-groff
[Top][All Lists]
Advanced

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

[bug #63757] [gropdf] doesn't handle "papersize" directive as other driv


From: Deri James
Subject: [bug #63757] [gropdf] doesn't handle "papersize" directive as other drivers do
Date: Wed, 8 Feb 2023 17:22:57 -0500 (EST)

Follow-up Comment #4, bug #63757 (project groff):

Both patches seem fine but the gropdf one will need a slight massage. Since
groff_font specifies that the papersize entry in the DESC file may contain
multiple entries of 3 types (paper name, file path or x,y dimension). The
current code only expects one entry, which can any of the 3 types. The patch
changes the behaviour to loop over all the entries and selecting the first
which is valid. It uses white space to separate entries.

Since file paths may contain spaces, this would cause issues, but given that
its intention is to include /etc/papersize (which does not contain spaces)
this "problem" is moot. This problem is probably in font.cpp as well.

Since I suspect this patch was created before a specific warning was added
about an unrecognised paper size I need to add some code fo this. Given that
another change by the patch is that a failed entry is allowed because it
continues to look at following entries, but no error if none are valid. Also,
it uses the papersize given in the -p flag as the first entry to check, so if
that fails it will look at the entry in the DESC file which will probably be
valid so the incorrect -p papersize will not be reported. I think this
behaviour is undesirable, so I will change it so that if the -p flag papersize
is given any DESC paper sizes are not checked, so that a warning will be given
for an invalid paper size on the command line.

Given papersize.tmac is now included to make it easier to tell troff the
intended document size with -dpaper=, wouldn't it make sense to pass this
information on to whichever device driver is chosen. It would avoid commands
such as -dpaper=letter -P-pletter, you would only need the -dpaper=... We
already have an API for this, \X'papersize=x,y' so I have attached a patch
which works for grodvi and gropdf. If only we had an environment variable
GROFF_OPTIONS which users could set to "-dpaper=letter". I don't know if grops
supports this API but it should be very easy to add since it would use the
same code as it uses to parse the -p flag.

(file #54340)

    _______________________________________________________

Additional Item Attachment:

File name: papersize.patch                Size:1 KB
    <https://file.savannah.gnu.org/file/papersize.patch?file_id=54340>



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?63757>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

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