[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Groff] Bugs around variable `device'
From: |
Bernd Warken |
Subject: |
[Groff] Bugs around variable `device' |
Date: |
Fri, 1 Feb 2002 15:47:33 +0100 |
User-agent: |
Mutt/1.2.5i |
The shell command
echo test | troff -T ps | grotty
produces some random error message such as
grotty:<standard input>:10:fatal error: width of character not equal
to horizontal resolution
The right error message, however, should be
device not suitable for postprocessor
The reason for this flaw is that groff assumes that the device is the
same over the whole command queue. But that's not true as is shown
above.
If you dig for the error you find some subtle bugs around the global
variable `device' defined in `include/device.h' and used in
`libdriver/input.cc'. This variable `device' should only be used for
the troff formatting process, but not during the postprocessing.
For the postprocessing, a different variable to store the
postprocessor name should be created, which must be set by each
postprocessor before calling the parser for the intermediate output,
e.g. for grotty
postprocessor_name = "grotty";
Additionally, a global dictionnary should be provided that maps a
device name to a postprocessor name, e.g.
{
{"ps", "grops"}
{"ascii", "grotty"}
{"latin1", "grotty"}
\[ell]
}
A natural place to declare these variables is the file `driver.h' that
is included anyway.
This problem exists independently of the output resolution scaling,
but must be fixed first.
Bernd Warken
- [Groff] Bugs around variable `device',
Bernd Warken <=