$Id: TODO,v 1.9 2003/07/03 15:44:47 geuzaine Exp $

------------------------------------------------------------------------

* Enhance the polygon/line/point offset stuff

------------------------------------------------------------------------

* SVG output?

From Lassi A. Tuura" <lassi.tuura@cern.ch>:

SVG can also be produced from PS, search google for ps2svg.ps; works
fine for the files I produced with gl2ps.  SVG is easy to produce in
itself and similar to postscript; see http://www.w3.org/Graphics/SVG.
Here's an abbreviated sample from a cube printed with gl2ps and
coverted with ps2svg (M = moveto, L = lineto):
<svg width="100%" viewBox="0 0 594 840" stroke="rgb(0,0,0)" fill="none">
<g stroke-miterlimit="10">
 <g transform="matrix(1,0,0,-1,0,840)">
   <path stroke="none" fill="rgb(65,10,10)"
     d="M256.018,103.084L238.296,230.246L182.367,162.194Z"/>
   <path stroke="none" fill="rgb(65,10,10)"
     d="M256.018,103.084L182.367,162.194L187.264,56.048Z"/>
   <path stroke="none" fill="rgb(10,10,10)"
     d="M187.264,56.048L182.367,162.194L74.7287,183.309Z"/>
   [...]
  </g>
</g>
</svg>

------------------------------------------------------------------------

* Handle transparency (is this possible in postscript?)

From Lassi A. Tuura" <lassi.tuura@cern.ch>:

>> Also, I could take a look at how PS3 defines
>> transparency (yes, it does) for full RGBA support.

I looked into this some more.  Executive summary: It's PDF 1.4 and above
only, not PostScript.  It's PS overprint sort-of-redefined for PDF and
on steroids, and originals from Illustrator.  Ghostscript 7 and onwards
have an internal rendering mode that matches PDF 1.4, and give you easy
direct access to it from PostScript language level (plus supporting it
when rendering PDF of course).

Here's the ugly details:
  -- It's easy with ghostscript 7.x
      * add after the initial gsave (0 0 300 300 == bbox):
          0 .pushpdf14devicefilter
          << >> 0 0 300 300 .begintransparencygroup

      * when you want to do transparent colour, add this
          .5 setopacityalpha .4 .setshapealpha
        (first is stroke, second is shape -- I think :-)

      * to redefine easy commands, add alpha to "C" and redefine prolog:
          /.pushpdf14devicefilter known {
            /C { dup .setopacityalpha .setshapealpha setrgbcolor } BD
            /CI { 0 .pushpdf14devicefilter .begintransparencygroup } BD
            /CE { .endtransparencygroup .popdevicefilter } BD
          } {
            /C { pop setrgbcolor } BD
            /CI { pop pop pop pop pop } BD
            /CE { } BD
          } ifelse

        Then just after "gsave" invoke "<< >> llx lly urx ury CI", and
        just before last "grestore" add "CE".

        This gets you transparency when viewed and/or converted via GS,
        and ignores it for anything else (like your average printer).
        If you convert with ps2pdf, the graphic with transparency ends
        up as a bitmap embedded into the file (yikes!).

  -- It should be easy enough to do in PDF 1.4, but I haven't yet looked
     into the mechanics of this.  The model seems a bit clumsy in that
     you need to define a different PDF object for everything that has
     different alpha values, but otherwise all you need to do is to set
     /CA and /ca in the /ExtGState of the Object/XObject/Group.

  -- While it is possible to define new /ExtGState via pdfmark in PS,
     I haven't yet found out if distiller/ps2pdf can actually be taught
     to *change* the current graphics state for the various objects.  It
     looks like this might not work, which is an odd omission from Adobe
     given how simply ghostscript does it.  OTOH, outputting straight
     PDF should be fairly simple for gl2ps' needs.

  -- Forget about interpolated transparency?  I haven't found anything
     that would even hint at being able to interpolate alpha over a
     shape.  It could well be possible (there are various blend modes
     and masks and what not supported in PDF 1.4), but the specs are
     hard to read and I can't put much more time into this.

------------------------------------------------------------------------

* Escape special chars. 

From Jennifer, Jeff, Trevor, and Sophia" <cafun@ameritech.net>:

>> I do have a suggestion though for the  "gl2psText" routine.
>> I have noted that if your string has a "special" character to 
>> postscript then the
>> postscript file becomes corrupted.  This happens when
>> you try and print a string which has only one "(" in it.
>> For instance this string will cause a bad eps file "(this is a 
>> string".  Note that only one bracket is in this string.
>>
>> This can be fixed, I believe, by checking for this character and 
>> placing an escape in front
>> of it.  I was thinking about making the change for you but I do not 
>> know much about
>> PS and I am sure that there are probably other special characters 
>> which should also be
>> included in this check.
>
>
> Good idea. Looking at the PostScript reference, we should escape '(', 
> ')' and '\'.
>
> But should we make this escaping optional? Some people might still 
> want to use the special characters with their original meaning (e.g. 
> to access special characters using their octal codes '\XXX'). 

Now that you mention it I could see where some may want to do this.

>
>
> What should we do for LaTeX output? 

I have not used your LaTeX ouput option so I am not sure how this would 
effect it.
