groff
[Top][All Lists]
Advanced

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

[Groff] Re: ESC/P2 printer driver


From: Werner LEMBERG
Subject: [Groff] Re: ESC/P2 printer driver
Date: Wed, 29 Oct 2003 12:36:48 +0100 (CET)

Sorry for the late reply.  For stupid reasons I haven't received mail
from the groff mailing list for some months.

> The ESC/P driver would be quite a simple driver.  All I want in this
> case is an 80 col x 60 line extended ASCII output with bold, italics
> etc.  This could probably be based on grotty.

Yes, this seems a natural choice.

> I've had a look in detail at the grotty driver, and I'm now starting
> to look at the grolj4 driver.  AFAICT I need to write a DESC file,
> font metrics for each supported font (I'm trying to get these from
> Epson for their proportional typefaces) and possibly a roff file in
> addition.

Right.

> Is there any documentation of libdriver or the overall architecture
> of groff?  Where should I start?

Unfortunately, there is no special documentation of the libdriver
library.  Basically, it's quite simple.  To cite
src/libs/libdriver/input.cpp:

   A device postprocessor just needs to fill in the methods for the
   class `printer' (or rather a derived class) without having to worry
   about the syntax of the intermediate output format.  Consequently,
   the programming of groff postprocessors is similar to the
   development of device drivers.

The following should be done:

  . Have a look at src/include/printer.h.  The member functions in
    class `printer' which are tagged with `virtual' can be
    reimplemented for the particular device.  Functions which look
    like

      virtual ... = 0;

    must be implemented.  Default and dummy functions are in
    src/libs/libdriver/printer.cpp.

  . Provide a make_printer() function which returns a new printer
    object.

  . Additional parameters from the `DESC' file should be scanned in a
    handle_unknown_font_command() function which has to be registered
    with font::set_unknown_desc_command_handler().

  . Additional parameters from a font description file should be
    scanned in a handle_unknown_font_command() function which has to
    be part of a derived class of `font' (defined in src/include/font.h).

  . In main(), call do_file() repeatedly with the file names given on
    the command line.

> BTW, if and when this is ready for inclusion, I guess you'll want me
> to fill out a FSF copyright assignment thing.  I'll be happy to do
> so.

This is excellent!


    Werner

reply via email to

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