This directory contains the source code for yahp2ps (you got it: 'Yet
Another HPGL to PostScript Converter).  This program takes an HPGL plot
file as input and produces a PostScript language page description as
output.  This description produces, when interpreted, a printed page
that resembles as closely as possible the result you would have gotten
by sending the original HPGL plot file to a plotter.

  yahp2ps supports most of the HPGL language, including specialties like
filled polygons. You shold have no trouble printing anything that
doesn't use the HPGL fonts. One thing I decided not to emulate was the
behaviour of the plotter when it gets a request to draw a circle arc of
n degrees with a step angle of s, and both n and s are prime (or at
least mutually prime). I don't know what your plotter does under this
circumstances, mine gets stuck in an endless loop until power cycle.

  Most of the program is non-PostScript specific.  If you want to
produce a HPGL-TO-WHATEVER converter, all you should have to do is
replace the 'machine.c' module by something with the same functionality
(Murphy permitting). I have compiled and run it on a 68030 BSD 4.3 Unix
machine, but it sould be pretty portable. The only problem I can think
of (but then, it's been a long time since I last thought) is that I
assume data of type 'Number' to be at least 32-bit integral (I hate
floating point math).

Restrictions:

    * No text commands are implemented. I will eventually get around to
      do this some time, but I haven't had the time. This restriction
      also implies that you can't get centered chars at segment endings.
    * No color support (I haven't been even near a color PostScript
      printer). You may define a thickness and a gray level for each
      pen, however. On a related topic, if an area is written over with
      one pen, and later with another, the last gray level will prevail.
    * Only DIN A4 paper size has been really tested.  There are
      provisions for the other sizes in the code (there are provisions
      for text support too), but I havn't got around to test them.
    * No commands requiring responses from the plotter are implemented
      (for instance the commands for digitizing).
    * The prelude isn't "Adobe conformant". It doesn't do anything
      weird anyway, it's just that the field names and such stuff
      aren't there. I use the 'setmatrix' PostScript command to allow
      distorting and restoring of user space without affecting other
      parameters, but this should have no ill effects since it's done
      under controlled conditions.
    * No documentation (I guess I will eventually resign and decide to
      learn how to use [tn]roff). The program's function is quite
      obvious, though, so that you shouldn't have problems using it.
      If you do, try entering 'yahp2ps -' to get the 'Usage' line.
      If that doesn't help, look at 'main' in 'yahp2ps.c', if everything
      else fails, contact me.


yahp2ps is free software.  See the file COPYING for copying permission. 

            Federico Heinz
