From Stephen.Harker at spme.monash.edu.au  Sun Nov 30 23:57:36 2003
From: Stephen.Harker at spme.monash.edu.au (Stephen.Harker@spme.monash.edu.au)
Date: Mon Dec  1 00:17:35 2003
Subject: [Rd] R postscript generation error (lines versus points) (PR#5285)
In-Reply-To: <3FC26745.50807@stat.auckland.ac.nz>
References: <20031124032202.820FCEFC2@slim.kubism.ku.dk>
	<x2islat94a.fsf@biostat.ku.dk> <3FC26745.50807@stat.auckland.ac.nz>
Message-ID: <20031130225736.GA1108@harker.spme.monash.edu.au>

For what worth it may be to the R development team: The main comment I
have had, so far, on the submission of a bug report to the ghostscript
list was as given below.  I submitted a report plus a test file
derived from the R file as submitted to the R-bugs list.  The
following comments appear to confirm a ghostscript bug.

[Bug 687173] line misalignment with respect to points in 8.11 but not
 8.00
http://bugs.ghostscript.com/show_bug.cgi?id=687173


------- Additional Comments From alexcher@coscript.com  2003-11-28 04:38 -------
Ghostscript uses fixed point repressntation of the device coordinates.
So there is a trade-off between the range and precission.

File gxfixed.h was changed on 2003/02/15 22:37:01 to have 8 bit precission.
The previous 12 bits was too large to accomodate large format inkjet printers
at modern resolutions of 720 and 1200 dpi.

The long chain of rlineto operations in the source file accumulates
roniding errors, which becomes visible at the end of the line.

There are several ways to improve the precission.
(1) Use to 64-bit fixed numbers. This is very easy to do but may affect the
    performance.
(2) Keep current point calculations in float point. Most precission problems
    are caused by inprecise current point calculations.
(3) Replace all fixed arithmetic with floating pont one. This can improve
    the performance on some platforms.

One can also work around the problem by:
(1) compiling a private version of GS with higher precission and lower range.
(2) fixing the PS file using UNIX text tools.

-- 
Stephen Harker                           Stephen.Harker@spme.monash.edu.au
School of Physics & Materials Engineering
Monash University                       http://www.ph.adfa.edu.au/s-harker/
                                 Baloney Baffles brains: Eric Frank Russell


[Rd] R postscript generation error (lines versus points) (PR#5285)
Stephen.Harker@spme.monash.edu.au