[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Groff] Device-independence of intermediate output
From: |
Bernd Warken |
Subject: |
Re: [Groff] Device-independence of intermediate output |
Date: |
Fri, 1 Feb 2002 00:16:39 +0100 |
User-agent: |
Mutt/1.2.5i |
On Thu, Jan 31, 2002 at 08:02:43AM +0100, Werner LEMBERG wrote:
>
> Compatibility is always a good thing IMHO. Please give more details.
>
Suppose you've got some intermediate output generated by some roff
formatter; you want to feed this into some groff device different from
the one specified in the output.
Classical troff documented a scaling facility that allowed to translate
the output for one device to any other native device by resolution
scaling - with a small loss of precision due to integer rounding.
It is easy to implement this for groff.
It will be a bit harder to extend this concept further to support
arbitrary non-groff devices. This could be left for a second stage.
The rough structure of the device/resolution translation between groff
devices is as follows.
- Everything can be done within src/libs/libdriver/input.cc.
- I use a preprocessor macro during the test phase to shield off the
resolution translation.
- The resolution translation is triggered as soon as the resolution
provided with the `x r' command differs from the device's resolution.
- The command arguments that need to be scaled are positional offsets,
while color values, font positions, character codes, etc. are not
scaled.
There are some subtle issues that I would like to discuss at a later
stage. Thanks for helping.
Bernd Warken