[comp.windows.open-look] PVWAVE and the SPARCprinter

brown@ftms.UUCP (Vidiot) (04/23/91)

There is a couple of minor problems when PVWAVE is used with the SPARCprinter
NeWSprint software.  But it is easily fixed.  The first problem has to do with
drawing dashed lines.  The minutely small line segments that PVWAVE can end up
drawing are too small for xnews to handle.  The fix makes sure that line
segments are at least a certain length.  This bug has been reported to Sun
and the fix was provided by Sun (Thanks).  The other problem has to do with
the thin lines that the SPARCprinter draws, as compared to the LaserWriter
series of printers.  My fix (added to the Sun fix) changes the definition
of setlinewidth so that it adds 15 to whatever value PVWAVE uses.  I leave it
to PVWAVE to decide what they really want to do.

I hope the following lines of code can be useful to you.

Edit the PVWAVE prolog file and change the line:

	/R {rlineto} bdef

to:

% Relative line to: The first part of the ifelse is for Sun's NeWSprint.
% It can't handle very short line segments, so the following makes sure that
% the line segments are long enough.  Otherwise, it leaves the definition
% alone for the other laser printers.
systemdict /setcanvas known {
    /_RDict 3 dict def
    _RDict begin
        /_xoff 0 def
        /_yoff 0 def
        /_thrsh .5 def    % draw lines that are at least 1/2 pixel long.
    end
    currentpacking false setpacking
    /R {
        dict begin
            /_yoff _yoff 3 -1 roll add def
            /_xoff _xoff 3 -1 roll add def
            _xoff _yoff dtransform abs _thrsh ge exch abs _thrsh ge or {
                _xoff _yoff rlineto
                /_xoff 0 def /_yoff 0 def
            } if
        end
    } dup 0 _RDict put bdef
    setpacking

    % Change the definition of setlinewidth so that 15 is added to the value
    % that PVWAVE uses.  With the SPARCprinter's thinner lines, the PVWAVE
    % lines are just too thin.
    /oldsetlinewidth /setlinewidth load def
    /setlinewidth { 15 add oldsetlinewidth } def
}{
    /R {rlineto} bdef
} ifelse
-- 
harvard\
  ucbvax!uwvax!astroatc!ftms!brown
rutgers/
INTERNET: spool.cs.wisc.edu!astroatc!ftms!brown