Chris Barker wrote:
> Hi all,
>
> I'm successfully getting all the MPL data files into spy2exe with:
>
> DATA_FILES = matplotlib.get_py2exe_datafiles()
>
> The problem is that that dumps a LOT of stuff, and I don't need most of 
> it. I've already added to my script a few lines that delete the "images" 
> dir, but I'd like to trim down the fonts to just those I need.
>
> I'm using the wxAgg back-end, with all default fonts -- does anyone know 
> which those are?
>   
The default text font is Vera.ttf.  (If you want to support bold and 
italic etc, you'll also need VeraBd.tff, VeraBI.ttf and VeraIt.ttf).

If you need to support mathtext, the default font is the Computer Modern 
family, and you'll want all of the cm*.ttf fonts.

Alternatively, you can change the default fonts in the matplotlibrc to 
ones that are included with Windows (e.g. Arial) -- but that won't 
address the mathtext issue.
> MPL version: 0.91.2 on Windows (duh!)
>
> by the way, is there any way to dump that data into the exe itself, 
> rather than requiring it to be carried alongside?
>
> This makes me really appreciate application bundles on the Mac!
>   
There are ways, but they're pretty involved -- plus they would require fixing 
the parts of matplotlib that read in data files: they all implicitly assume 
that they are real files on a real file system.  See:

http://www.py2exe.org/index.cgi/SingleFileExecutable

I once worked on a commercial project that had a fairly complex network 
installer written in Python and distributed in a similar way.  Not for the 
faint of heart.

Cheers,
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 the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to