Re: Re: Tips on correct .ps syntax
Ken Sharp <ken.sharp <at> artifex.com>
2009-03-23 08:16:32 GMT
At 00:57 23/03/2009 +0000, Paul Smedley wrote:
> > I looked at the job, and I can't see any equation characters in it. It
> uses
> > TimesNewRoman to write 'log25' and does some clipping, doesn't seem to do
> > much else. Also the job renders blank, because all the x/y values are
> > rather too large, given the CTM in force at the time. This is true for GS
> > and Acrobat Distiller. In effect all the objects are drawn off the page or
> > clipped out.
>When I say equation characters I really mean that any document created
>using the equation editor in Lotus Wordpro is likely to show the
>problem with blank characters.
Oh, right, I was looking for math symbols
> In Wordpro at least, these equations
>are objects in the document, so maybe this is where the code is
>getting screwed up in translating that to a position on the page in
>the postscript code.
Tha would seem very likely, I could tell better if there were some
non-equation stuff in the file too.
>Can you point me to the too large x/y values?
Well pretty much all of them really, here are some examples:
600 7676 m
857 7676 l
857 7822 l
600 7822 l cp
clip n d2w
...
1440 18514 m
(l) t
If the CTM (see below) was 'properly' scaled, these could be valid numbers,
but at the time these are executed the CTM is ~ [1 0 0 0.5 0 0], which
means the x co-ordinates are as you see them, and the y co-ordinates are
divided by 2. Note that the device-specific CUPS code sets the resolution
to non-square [720 360]. It looks like the PostScript job expects a square
600 dpi resolution though:
/dpi 600 def /dpiY 600 def 0 0 translate 72 dpi div 72 dpiY div scale
/mdevice matrix currentmatrix def
Since PS nominally uses 72 points to the inch, this means that the
rectangular clip path is positioned at ~ lower left = 600,3836 upper right
= 857, 3911 or 8.3, 53.2 and 11.9, 54.3 inches. The 't' is located at 1440,
9257 or 20,128.5 inches. All are well of the physical media (unless you use
very large paper
>I assume CTM =
>cleartomark?
Nope, the Current Transformation Matrix. This underlies the whole
PostScript imaging model, its the way user space (which is very large and
effectively infinitely sub-divisible) is mapped to device space (which has
discrete pixels). Because PS uses a matrix, you can achieve all kinds of
useful effects with it.
> > I could be mistaken of course, I haven't taken the time to debug the file
> > thoroughly.
>You've given me some more to look at - thanks!
Since you mentioned above that the equations are separate objects, it looks
to me like the 'w2d' and 'd2w' routines are possibly where the problem
arises. w2d creates a 'mxworld' matrix, and sets the CTM to the identity
([1 0 0 1 0 0] d2w uses the matrix created in w2d. The names hint at
transforming between two 'spaces'.
If you can create a PostScript file which contains a small amount of
working text as well as the missing 'equations' it might be easier to tell
what's happening.
Ken