Hi developers-
GMT (gmt.soest.hawaii.edu <http://gmt.soest.hawaii.edu/>) is using PostScript
to make plots and one application builds an animation from sequences of
PostScript plots converted to PNG with ghostscript (9.22) and then to MP4 with
ffmpeg. We have found a problem that may be a ghostscript bug, or
alternatively we are doing something wrong. When using a perspective view
(i.e., using a matrix concatenation to simulate perspective), the resulting
oblique text strings "jitter" when viewed as a movie. For an example, see
www.soest.hawaii.edu/pwessel/bug_200.mp4
<http://www.soest.hawaii.edu/pwessel/bug_200.mp4>. As the movie plays, you
will see the INDIVIDUAL letters in the word HELL jitter relative to each other,
despite being set via a single show command (here just a snippet of our code;
setting currentpoint, font etc are omitted here)
(HELL) dup dup stringwidth pop -2 div exch sh -2 div rmoveto show
where sh is defined as
/sh {gsave matrix setmatrix 0 0 moveto true charpath flattenpath pathbbox
newpath 4 1 roll pop pop pop grestore} bind def
[a complete PS example of a single frame can be found here:
www.soest.hawaii.edu/pwessel/bug.ps
<http://www.soest.hawaii.edu/pwessel/bug.ps>.
At first we suspected flattenpath but HELL (using Helvetica) has no curved
segments (?). We also tried to override the flattening with 0.2 setflat, but
no difference. We suspect some sort of roundoff but it affects the different
letters in the word differently, and that is not under our control. Could any
of the operators above be subject to round-off that affect individual letters?
Perhaps developers know where this may happen and if there is anything we can
do on our side to remedy the problem. As you can see there is no jittering for
plotting a circle or lines. The map frame annotations show the same jittering
so it affects all text.
Thanks for any insight! We can provide more details, all individual PS files,
etc upon request. FYI, we have tried both tif and jpg instead of png but no
difference. We also made PDFs and used OS X Automator to build PNGs and made a
movie using QuickTime Pro; same jittering (not sure if OS X High Sierra uses
ghostscript in Preview etc).
Paul Wessel
Lead developer
The Generic Mapping Tools