groff
[Top][All Lists]
Advanced

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

Re: [Groff] Device-independence of intermediate output


From: Ted Harding
Subject: Re: [Groff] Device-independence of intermediate output
Date: Thu, 31 Jan 2002 20:56:03 -0000 (GMT)

On 31-Jan-02 Tadziu Hoffmann wrote:
>> The ancient Postscript device (called post) had a resolution
>> of 720. To run this on the modern ps device with resolution
>> 72000 you must provide a scaling factor of 100. With that
>> scaling facility, it would be possible to process an ancient
>> intermediate "post" output file without changing the file.
>> This is wanted by the "sacred roff bible"  CSTR#54/#97.
>> [Bernd Warken]
> 
> But this is a problem of the postprocessor, not the
> intermediate language.  Currently the output for the
> ps device contains the line
> 
>   x res 72000 1 1
> 
> Which already contains all the necessary information, namely
> that "all the numbers in this data stream have been calculated
> assuming a reolution of 72000".
> If you want to print this data stream to a device with different
> resolution, the postprocessor must do the translation, as at
> this time it is the only one that knows the real resolution of
> the output device.
> On the other hand, if you know beforehand that you want to
> print a data stream for device x on device y, why not give
> troff a device description with the correct resolution for
> device y?

I can see a compromise on this issue, which would consist
of a simple extension to the "-Z" option. At present:

       -Z     Do not postprocess the output of  troff.   Normally
              groff  will automatically run the appropriate postĀ­
              processor.

If we had instead

       -Z     Do not postprocess the output of troff.
       -Zdev2 Postprocess the output of  troff with the
              postprocessor appropriate to 'dev2'.
              Normally groff  will automatically run the
              postĀ­processor appropriate to the device
              specified by '-T'. '-Tdev1' produces
              intermediate output suitable for 'dev1';
              '-Xdev2' causes this output to be sent
              to the postprocessor for device 'dev2'.

then I think we could have it both ways. The only effect
of '-Zdev2' would be to change the groff pipeline. For
this to work properly, grodev2 would have to be able to
read the line

        x r n v h

and work out what scaling factors are required to convert from
'dev1' resolution to 'dev2' resolution (which grodev2 should
know about anyway). Therefore, for instance,

        groff -Tps -Zpost groff_file

would be a possible invocation, to cover Bernd's example.

The alternative is simply to treat such other devices as
simply further devices added to groff's repertoire, on the
same footing as the ones we already know and love. This would
possibly be cleaner. But in any case, formatting a troff
source file on a device that the source was not written
in terms of is always likely to lead to problems of one
sort or another, whichever way you do it. And also, for
'grodev2' to work properly, there needs to be a branch
'devdev2' under "fonts" anyway.

Best wishes to all,
Ted.

--------------------------------------------------------------------
E-Mail: (Ted Harding) <address@hidden>
Fax-to-email: +44 (0)870 167 1972
Date: 31-Jan-02                                       Time: 20:56:03
------------------------------ XFMail ------------------------------

reply via email to

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