[Rd] R postscript generation error (lines versus points) (PR#5285)

Stephen.Harker at spme.monash.edu.au Stephen.Harker at spme.monash.edu.au
Mon Dec 1 00:29:36 MET 2003


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 at 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 at 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



More information about the R-devel mailing list