Re: [Matplotlib-users] Bug exporting mathtext to eps file in 0.91.2 on windows

2008-03-19 Thread Mark Bakker
I have confirmed that it is a bug in (at least the windows version) of mpl
0.91.2.
When saving eps files, and using mathtext, the cm fonts don't get saved, and
the
greek symbols (and others I presume) don't show up in the eps file.

This works in mpl 0.90.1, where the eps file does store the fonts.
%%BeginFont: Cmmi10

When running the same problem with 0.91.2, the fonts are not stored.
Either using ps.fonttype 3 or 42.

Anybody who can fix this?

Thanks, Mark

On Wed, Mar 19, 2008 at 11:21 AM, Bernhard Voigt [EMAIL PROTECTED]
wrote:

 Hi Mark!

 The problem seems to be that the computer modern font (cm) is not
 included in the eps file. The snipped of the eps file I sent before
 defines the font cmmi10:

 %!PS-Adobe-3.0 Resource-Font
 %%Title: cmmi10
 %%Copyright: Copyright (C) 1994, Basil K. Malyshev. All Rights
 Reserved.012BaKoMa Fonts Colle
 ction, Level-B.
 %%Creator: Converted from TrueType by PPR
 .
 /FontName /Cmmi10 def

 And later, when the \chi glyph should be drawn, the font is changed to:
 /Cmmi10 findfont
 16.0 scalefont
 setfont
 0.00 4.921875 moveto
 /chi glyphshow

 Which is the same in your file, but your file only contains the
 Bitstreem Vera Sans font for the axis ticks. Cmmi10 is missing :-(

 Your pdf, however, does contain the cmmi10 font, you can check via
 file-properties-fonts.

 You should have the following in your matplotlibrc file (well, you
 said you have it, but let me repeat):
 mathtext.fontset : cm
 mathtext.fallback_to_cm : True
 ps.useafm : False
 ps.fonttype : 3

 Check the settings using the interpreter prompt:

 In [10]: p.rcParams['mathtext.fontset']
 Out[10]: 'cm'
 etc...

 Well, if they are all correctly set, it's probably a bug in the ps
 backend not including the mathtext font.

 A workaround would be to convert the pdf file to ps (either use
 command line options of acroread or print to file), edit the ps file
 to be a eps by changing the header to %!PS-Adobe-2.0 EPSF-2.0 and make
 sure the bounding box is specified (see
 http://www.postscript.org/FAQs/language/node82.html for details)

 Bernhard


 On Wed, Mar 19, 2008 at 10:22 AM, Mark Bakker [EMAIL PROTECTED] wrote:
  Hello Mike -
 
  Thanks for taking a look at this.
  Easy example:
 
  from pylab import *
  plot([1,2,3])
  text(1,1.5,r'$\chi$')
  savefig('d:/temp/test.eps')
 
  There shoud now be a line and the symbol chi.
  Works great in the pdf file, not in the eps file.
  Both are attached.
 
  Strangely enough at the end of the eps file there are statements:
 
  0.00 3.703125 moveto
  /chi glyphshow
 
  Which looks to me like writing chi.
  I have now tried this on 4 windows machines, with different
 installations of gsview, but it doesn't work on any.
 
  It works fine under mpl vs. 0.90.1. That has the same statement for chi,
 but defines chi internally inside the eps file (which is much bigger).
 
  Thanks, Mark
 
 
 
 
 
 
 
  On Tue, Mar 18, 2008 at 7:09 PM, mdroe [EMAIL PROTECTED] wrote:
 
   It looks like it may be Windows-specific.  I can create .eps files
 with
   math on mpl-0.91.2, Python 2.5, gs-7.07 on Linux without problems.
   Someone with a Windows installation may need to look at this.
  
   Just so I can have a deeper look -- can you please attach
  
a) the Python source of a minimal plot that causes this problem
b) your .eps file output (so I can compare it against mine).
  
   Mike
  
 
 

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Bug exporting mathtext to eps file in 0.91.2 on windows

2008-03-19 Thread Michael Droettboom
Unfortunately, I'm still unable to reproduce the problem myself.  Have 
you tried installing the CM fonts (copying them to C:\Windows\Fonts)?  
Maybe GS is trying to re-embed them and can't find them.

Cheers,
Mike

Mark Bakker wrote:
 I have confirmed that it is a bug in (at least the windows version) of 
 mpl 0.91.2.
 When saving eps files, and using mathtext, the cm fonts don't get 
 saved, and the
 greek symbols (and others I presume) don't show up in the eps file.

 This works in mpl 0.90.1, where the eps file does store the fonts.
 %%BeginFont: Cmmi10

 When running the same problem with 0.91.2, the fonts are not stored.
 Either using ps.fonttype 3 or 42.

 Anybody who can fix this?

 Thanks, Mark

 On Wed, Mar 19, 2008 at 11:21 AM, Bernhard Voigt 
 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote:

 Hi Mark!

 The problem seems to be that the computer modern font (cm) is not
 included in the eps file. The snipped of the eps file I sent before
 defines the font cmmi10:

 %!PS-Adobe-3.0 Resource-Font
 %%Title: cmmi10
 %%Copyright: Copyright (C) 1994, Basil K. Malyshev. All Rights
 Reserved.012BaKoMa Fonts Colle
 ction, Level-B.
 %%Creator: Converted from TrueType by PPR
 .
 /FontName /Cmmi10 def

 And later, when the \chi glyph should be drawn, the font is
 changed to:
 /Cmmi10 findfont
 16.0 scalefont
 setfont
 0.00 4.921875 moveto
 /chi glyphshow

 Which is the same in your file, but your file only contains the
 Bitstreem Vera Sans font for the axis ticks. Cmmi10 is missing :-(

 Your pdf, however, does contain the cmmi10 font, you can check via
 file-properties-fonts.

 You should have the following in your matplotlibrc file (well, you
 said you have it, but let me repeat):
 mathtext.fontset : cm
 mathtext.fallback_to_cm : True
 ps.useafm : False
 ps.fonttype : 3

 Check the settings using the interpreter prompt:

 In [10]: p.rcParams['mathtext.fontset']
 Out[10]: 'cm'
 etc...

 Well, if they are all correctly set, it's probably a bug in the ps
 backend not including the mathtext font.

 A workaround would be to convert the pdf file to ps (either use
 command line options of acroread or print to file), edit the ps file
 to be a eps by changing the header to %!PS-Adobe-2.0 EPSF-2.0 and make
 sure the bounding box is specified (see
 http://www.postscript.org/FAQs/language/node82.html for details)

 Bernhard


 On Wed, Mar 19, 2008 at 10:22 AM, Mark Bakker [EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED] wrote:
  Hello Mike -
 
  Thanks for taking a look at this.
  Easy example:
 
  from pylab import *
  plot([1,2,3])
  text(1,1.5,r'$\chi$')
  savefig('d:/temp/test.eps')
 
  There shoud now be a line and the symbol chi.
  Works great in the pdf file, not in the eps file.
  Both are attached.
 
  Strangely enough at the end of the eps file there are statements:
 
  0.00 3.703125 moveto
  /chi glyphshow
 
  Which looks to me like writing chi.
  I have now tried this on 4 windows machines, with different
 installations of gsview, but it doesn't work on any.
 
  It works fine under mpl vs. 0.90.1. That has the same statement
 for chi, but defines chi internally inside the eps file (which is
 much bigger).
 
  Thanks, Mark
 
 
 
 
 
 
 
  On Tue, Mar 18, 2008 at 7:09 PM, mdroe [EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED] wrote:
 
   It looks like it may be Windows-specific.  I can create .eps
 files with
   math on mpl-0.91.2, Python 2.5, gs-7.07 on Linux without problems.
   Someone with a Windows installation may need to look at this.
  
   Just so I can have a deeper look -- can you please attach
  
a) the Python source of a minimal plot that causes this problem
b) your .eps file output (so I can compare it against mine).
  
   Mike
  
 
 



-- 
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: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Bug exporting mathtext to eps file in 0.91.2 on windows

2008-03-19 Thread John Hunter
On Wed, Mar 19, 2008 at 7:43 AM, Mark Bakker [EMAIL PROTECTED] wrote:
 I have confirmed that it is a bug in (at least the windows version) of mpl
 0.91.2.
 When saving eps files, and using mathtext, the cm fonts don't get saved, and
 the
 greek symbols (and others I presume) don't show up in the eps file.

 This works in mpl 0.90.1, where the eps file does store the fonts.
 %%BeginFont: Cmmi10

 When running the same problem with 0.91.2, the fonts are not stored.
 Either using ps.fonttype 3 or 42.

 Anybody who can fix this?

My guess is that you are picking up an rc file where useafm is set to
True.  Michael suggested checking this rc setting but I did not see
any response on this on list.  Have you checked it?  In the script
that is causing you trouble, print out the value

import matplotlib

print 'afm setting', matplotlib.rcParams['ps.useafm']

If this is True, then you need to find your matplotlibrc file and set
it to False.

I can't imagine a windows vs other platform issue that could cause
this since we do not use only matplotlib tools in our font conversion
pipeline

JDH

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Bug exporting mathtext to eps file in 0.91.2 on windows

2008-03-19 Thread Mark Bakker
Sorry, John, but here is my output, and it still doesn't work.

 from pylab import *
 rcParams['mathtext.fontset']
'cm'
 rcParams['mathtext.fallback_to_cm']
True
 rcParams['ps.useafm']
False
 rcParams['ps.fonttype']
3
 plot([1,2,3])
[matplotlib.lines.Line2D instance at 0x029F0120]
 text(1,1.5,r'$\chi$')
matplotlib.text.Text instance at 0x029F6968
 savefig('c:/temp/test.eps')

On the same machine, I get the correct eps file with 0.90.1.
So it really isn't my installation of GsView.

In the eps file created with 0.91.2, the cm fonts are not included, which I
think is causing the problem.

What happens when you guys read the attached eps file (created with commands
above)?
Do you see the chi symbol on the screen?

Thanks for looking into this,

Mark


On Wed, Mar 19, 2008 at 2:18 PM, John Hunter [EMAIL PROTECTED] wrote:

 On Wed, Mar 19, 2008 at 7:43 AM, Mark Bakker [EMAIL PROTECTED] wrote:
  I have confirmed that it is a bug in (at least the windows version) of
 mpl
  0.91.2.
  When saving eps files, and using mathtext, the cm fonts don't get saved,
 and
  the
  greek symbols (and others I presume) don't show up in the eps file.
 
  This works in mpl 0.90.1, where the eps file does store the fonts.
  %%BeginFont: Cmmi10
 
  When running the same problem with 0.91.2, the fonts are not stored.
  Either using ps.fonttype 3 or 42.
 
  Anybody who can fix this?

 My guess is that you are picking up an rc file where useafm is set to
 True.  Michael suggested checking this rc setting but I did not see
 any response on this on list.  Have you checked it?  In the script
 that is causing you trouble, print out the value

 import matplotlib

 print 'afm setting', matplotlib.rcParams['ps.useafm']

 If this is True, then you need to find your matplotlibrc file and set
 it to False.

 I can't imagine a windows vs other platform issue that could cause
 this since we do not use only matplotlib tools in our font conversion
 pipeline

 JDH



test.eps
Description: PostScript document
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Bug exporting mathtext to eps file in 0.91.2 on windows

2008-03-19 Thread Michael Droettboom
I don't see the character in the plot you sent.  So at least that's 
consistent.  ;)

However, I still can't get things to break locally (on Linux, at least), 
with all permutations of ps.fonttype, ps.useafm, ps.distiller, and 
mathtext.fontset.

Can you send your entire matplotlibrc file?  Perhaps there is some other 
obscure setting that's interacting in a negative way.

Mike

Mark Bakker wrote:
 Sorry, John, but here is my output, and it still doesn't work.

  from pylab import *
  rcParams['mathtext.fontset']
 'cm'
  rcParams['mathtext.fallback_to_cm']
 True
  rcParams['ps.useafm']
 False
  rcParams['ps.fonttype']
 3
  plot([1,2,3])
 [matplotlib.lines.Line2D instance at 0x029F0120]
  text(1,1.5,r'$\chi$')
 matplotlib.text.Text instance at 0x029F6968
  savefig('c:/temp/test.eps')

 On the same machine, I get the correct eps file with 0.90.1.
 So it really isn't my installation of GsView.

 In the eps file created with 0.91.2, the cm fonts are not included, 
 which I think is causing the problem.

 What happens when you guys read the attached eps file (created with 
 commands above)?
 Do you see the chi symbol on the screen?

 Thanks for looking into this,

 Mark


 On Wed, Mar 19, 2008 at 2:18 PM, John Hunter [EMAIL PROTECTED] 
 mailto:[EMAIL PROTECTED] wrote:

 On Wed, Mar 19, 2008 at 7:43 AM, Mark Bakker [EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED] wrote:
  I have confirmed that it is a bug in (at least the windows
 version) of mpl
  0.91.2.
  When saving eps files, and using mathtext, the cm fonts don't
 get saved, and
  the
  greek symbols (and others I presume) don't show up in the eps file.
 
  This works in mpl 0.90.1, where the eps file does store the fonts.
  %%BeginFont: Cmmi10
 
  When running the same problem with 0.91.2, the fonts are not stored.
  Either using ps.fonttype 3 or 42.
 
  Anybody who can fix this?

 My guess is that you are picking up an rc file where useafm is set to
 True.  Michael suggested checking this rc setting but I did not see
 any response on this on list.  Have you checked it?  In the script
 that is causing you trouble, print out the value

 import matplotlib

 print 'afm setting', matplotlib.rcParams['ps.useafm']

 If this is True, then you need to find your matplotlibrc file and set
 it to False.

 I can't imagine a windows vs other platform issue that could cause
 this since we do not use only matplotlib tools in our font conversion
 pipeline

 JDH



-- 
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: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users