I've removed the "%%EOF" comment from the embedded font in SVN (your 
suggested change).  I'm still stumped as to why this matters, but it 
should be benign.

Mike

Paul Novak wrote:
> I am using matplotlib SVN revision 6810, and GSview 4.9 for Windows.
>
> Paul
>
> Michael Droettboom wrote:
>> Which version of matplotlib and ghostscript are you using?  With 
>> matplotlib SVN trunk and gs 7.07, I can't reproduce this here, either 
>> with your provided ps file or generating it myself.
>>
>> Paul Novak wrote:
>>> Hello,
>>>
>>> I am having some problems with the PS backend. I used the following
>>> script to create a PostScript file
>>>
>>> #!/usr/bin/env python
>>> import matplotlib
>>> matplotlib.use('PS')
>>> import matplotlib.pyplot as plt
>>> import numpy
>>>
>>> x1 = numpy.arange(0,5)
>>> y1 = x1
>>> plt.plot(x1, y1)
>>> plt.savefig('ps_backend.ps')
>>> plt.show()
>>>
>>>
>>> When I tried to open the PostScript file in GSview, there is the
>>> following warning, and the file does not render properly. I have
>>> attached the PostScript file and a screenshot of the incorrect 
>>> rendering.
>>>
>>> DSC Error
>>> At line 233:
>>>    %%Page: 1 1
>>> This %%Page: line occurred in the trailer, which is not legal.
>>> EPS files should be encapsulated in %%BeginDocument / %%EndDocument.
>>> If is possible that an EPS file was incorrectly encapsulated,
>>> and that we have been confused by the %%Trailer in an EPS file.
>> Something is leading Ghostscript to believe this is an encapsulated 
>> postscript file when it isn't.  That's odd.  Did you change the 
>> extension of the file or something?
>>>
>>>
>>> The error can be eliminated by removing the line with %%EOF at line 
>>> 230, but I don't know anything about PostScript or if that change 
>>> would have any other effects. I only found this solution after 
>>> comparing with the output from the Cairo backend. The same change to 
>>> PostScript output can be achieved with the following diff (from svn 
>>> diff), but again, I don't know if it is appropriate.
>>>
>>> Index: ttconv/pprdrv_tt.cpp
>>> ===================================================================
>>> --- ttconv/pprdrv_tt.cpp    (revision 6810)
>>> +++ ttconv/pprdrv_tt.cpp    (working copy)
>>> @@ -1070,7 +1070,6 @@
>>>          } /* end of if Type 42 not understood. */
>>>
>>>      stream.putline("FontName currentdict end definefont pop");
>>> -    stream.putline("%%EOF");
>>>      } /* end of ttfont_trailer() */
>>>
>>>  /*------------------------------------------------------------------
>> I'm surprised that this works, as the %%EOF comments are generally 
>> just considered informational.  But it doesn't hurt to remove this 
>> line (and save 6 bytes per file!) so I'm fine with removing this line 
>> if we can confirm this is the source of the error.
>>
>> Mike
>>>
>>>
>>> Paul Novak
>>>
>>> ------------------------------------------------------------------------ 
>>>
>>>
>>> ------------------------------------------------------------------------ 
>>>
>>>
>>> ------------------------------------------------------------------------------
>>>  
>>>
>>> This SF.net email is sponsored by:
>>> SourcForge Community
>>> SourceForge wants to tell your story.
>>> http://p.sf.net/sfu/sf-spreadtheword
>>> ------------------------------------------------------------------------ 
>>>
>>>
>>> _______________________________________________
>>> Matplotlib-users mailing list
>>> Matplotlib-users@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>

-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA


------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to