Bug 14384

Summary: evince render ps file with broken glyph.
Product: libspectre Reporter: Carlos Garcia Campos <carlosgc>
Component: generalAssignee: Carlos Garcia Campos <carlosgc>
Status: RESOLVED FIXED QA Contact: Carlos Garcia Campos <carlosgc>
Severity: normal    
Priority: medium CC: cloos, ganadist
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Carlos Garcia Campos 2008-02-05 02:41:14 UTC
Bug forwarded from Evince: http://bugzilla.gnome.org/show_bug.cgi?id=514474

"When opened http://ftp.mizi.com/~ganadist/moz.ps (PS file generated with
mozilla) with evince, Only first page looks good.

But evince renders broken glyphs from second page."

This happens with every ps generated with mozilla.
Comment 1 James Cloos 2008-02-07 13:32:51 UTC
As far as I’ve been able to test — I was working on a report about this when I saw the bug posted to Evince — this only happens on ps generated by the 1.8 versions of gecko.

I found some older ps, which says:

%%Creator: Mozilla PostScript module (rv:1.7.8/0)

which renders correctly.

(The main user-visible change between rv:1.7 and rv:1.8 is that the latter will use the same fonts in the ps that were used to render the page on screen.  That is also the only really significant difference I can see in the ps.)

Comment 2 Carlos Garcia Campos 2008-02-16 03:13:32 UTC
The problem is here:

%%EndProlog
%%BeginResource: font Verdana.Regular.0.0.Set0

According to the spec (http://partners.adobe.com/public/developer/en/ps/psrefman.pdf pages 630) Resources sections should be inside the Prolog. Moving the EndProlog after the last EndResource fixes the problem, since libspectre sends the prolog to the interpreter for every page. 

I wonder why gv works though. 
Comment 3 James Cloos 2008-02-17 01:27:40 UTC
Well spotted!

Moving the %%EndProlog below the fonts (aka just above the ‘%%Page: 1 1’) does let evince render the full printout.

As for gv, it treats anything between the %%EndProlog and the %%Page: comments as an implicit %%Setup block, and presumably applies that for each page.

Now that I knew what to search for, I found https://bugzilla.mozilla.org/show_bug.cgi?id=335356 which details some bugs with the DCS conformance, including this one.

That bug report references https://bugzilla.mozilla.org/show_bug.cgi?id=322621 in which a fix for this was committed.  But it looks like the fix was never back-ported to gecko 1.8, so it will only be in the firefox 3 and seamonkey 1.2 versions.

I added a comment to the zilla bug; maybe it'll lead to something.

But in any case it seems that anything between the Prolog and the first Page has to be applied to each page to deal with broken PS like these....
Comment 4 Carlos Garcia Campos 2008-06-19 09:49:39 UTC
I've just committed a work around for this problem to git master. Thanks for your help. 

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.