groff
[Top][All Lists]
Advanced

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

[Groff] Patches to clean papersize selection.


From: Fabrizio Polacco
Subject: [Groff] Patches to clean papersize selection.
Date: Fri, 7 Jan 2000 20:38:09 +0200
User-agent: Mutt/1.0i

Hi,
as I have two old requests to get groff recognize the "global" paper
selection in Debian systems (/etc/papersize); I studied the matter and I
propose the following changes:

in grolj4/lj4.cc:

  handle_unknown_desc_command():
  * add a new "unknown" command to DESC, named "paperfile", whose arg is
    the name of the file containing the name to be looked in the table.


in grops/ps.cc:

  * created a static global var (not the best way to share values
    between classes :-)
  * added the same new "unknown" command "paperfile". Here we don't have
    a table of fonts, so I used the same algorithm found in
    devps/Makefile .
  * added the check in ps_printer constructor, to see if the paper size
    was loaded from the new command.

This way, I can substitute the line 

        papersize a4

in the DESC of lj4 and ps font (which is actually added by the Makefile)
with 

        paperfile /etc/papersize

to get it from the configuration file, without the need of setting the
-p option (which is not so trivial when you, as example, issue command
"man" :-)

This last change is not in the patch, as it could be considered "debian
specific" :-)

I have tested it working good in lj4, but I did not get any difference
for postscript. I hope I haven't missed something, as I know little if
not none about postscript.

The patch makes use of the strcasecmp change I sent in a previous
message.

A better approach would be to use Yves Arrouye's libpaper.

Cheers,
fab
-- 
| address@hidden     address@hidden    address@hidden
| 6F7267F5 fingerprint 57 16 C4 ED C9 86 40 7B 1A 69 A1 66 EC FB D2 5E
| address@hidden                  gsm: +358 (0)40 707 2468

Attachment: g15p
Description: Text document


reply via email to

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