On 01/13/2011 11:38 AM, Alex S wrote:
> Hi there,
> I've made a program that makes plots using New Century Schoolbook Lt Std
> font.  I did this by inserting this into the matplotlibrc file:
>
> font.family         :  New Century Schoolbook LT Std # serif #sans-serif
>
> There's also a "fontlist.cache" file that I think points to it when it says:
>
> .
> .
> .
> (dp283
> g12
> g45
> sg14
> S'New Century Schoolbook LT Std'
> p284
> sg16
> I400
> sg17
> g13
> sg18
> .
> .
> .
>
> This all works fine on my computer.  But I'm trying to make it run on other
> people's computers (off a network drive) but when I do the plots all go back
> into Ariel font and all the spacing and stuff gets screwed up.  Running the
> exact same exe from the same place, my computer continues to make them with
> the correct font.  I have copied the matplotlibrc file and the
> fontlist.cache file from my hard drive (C:...Matplotlib) to the mpl-data
> folder in the dist folder (from py2exe) but that didn't work.
>
> Does anyone have any ideas for fixing this stuff?  I think it might just be
> a matter of including the right files in the Py2Exe setup file but I don't
> know which ones.  Or maybe changing how I select the font, which was a
> roundabout way of doing it from the start.
The fontList.cache file maps from the properties (names, weights, 
slants) etc. of the fonts available on a particular system to their file 
path.  You should definitely not ship this file with the exe, but rather 
allow it to be regenerated from scratch on each system, since the 
selection and locations of fonts is very likely to be different.

I think "New Century Schoolbook" is one of the fonts that ships with 
Windows, so you can probably count on it being there.  If not, you need 
to ship the font as part of the exe by adding it to mpl-data/fonts/ttf 
and then following the instructions to include the fonts given here:

http://www.py2exe.org/index.cgi/MatPlotLib
>    When I run the plots
> (successfully on my computer) it says this at one point:
>
> c:\Python26\lib\site-packages\matplotlib\backends\backend_pdf.py:982:
> UserWarning: 'newcenturyschlbkltstd-roman.otf' can not be subsetted into a
> Type 3 font. The entire font will be embedded in the output.
>
> Maybe that has somethign to do with what's going on?
>    
I don't think that's related.  All this means is that when it embeds the 
font into the PDF file, it has to embed the entire thing rather than 
only the characters that are being used.  (Resulting in a larger PDF 
file, but otherwise fine.)  To avoid this message, you can set the 
rcParam "pdf.fonttype" to 42.

Cheers,
Mike
>
>
> Thanks a lot,
> Alex
>    


-- 
Michael Droettboom
Science Software Branch
Space Telescope Science Institute
Baltimore, Maryland, USA


------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to