Re: Fwd: [pygame] Problems with py2exe and Pygame

2007-12-05 Thread hwg
I did also manually put the font into library.zip.  Still had the same problem.

Then I took the suggestion from another post and explicitly loaded the 
freasnsbold.ttf font, instead of using None (and getting the default.)

That worked, but all my fonts rendered about 50% bigger than before.  Strange.  
But at least now I can distribute it.


hwg


 Try manually putting the font into library.zip.


On Dec 4, 2007 1:57 PM, Casey Duncan [EMAIL PROTECTED] wrote:


 On Dec 4, 2007, at 1:19 PM, Joe Johnston wrote:

  hwg wrote:
  I'm trying to make an exe of a simple Pygame program.
   Here's the setup.py http://setup.py/:
   from distutils.core import setup
 import py2exe, pygame
 import glob, shutil
 setup(windows=[lunarlander.py http://lunarlander.py/])
  shutil.copyfile('moonsurface.png', 'dist/moonsurface.png')
 shutil.copyfile('lunarlander2.png', 'dist/lunarlander2.png')
 shutil.copyfile('C:/Python25/Lib/site-packages/pygame/
  freesansbold.ttf',
 'dist/freesansbold.ttf')
 
  Maybe I'm a loser, but I generally keep the setup.py script short.
  If I've got to move files, I do that from a bat script which can
  call my Windows installer compiler too (inno, my case).

 A good reason to keep this stuff in python (regardless of whether it
 is in setup.py or not) is portability. bat files only work on
 Windows. But then again, absolute paths (especially ones that use
 drive letters) are highly non-portable anyhow no matter what language
 they're in (even on different machines that are running Windows).

 -Casey



  

Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs

Fwd: [pygame] Problems with py2exe and Pygame

2007-12-04 Thread Patrick Mullen
Yes my setup script uses py2exe on windows and cx_freeze on linux,
while keeping the data movement code generally shared for either
system.  So it is all in one nice, portable setup file.  Of course, I
really am a loser.  Instead of using shutil, I wrote all of my own
shell functions :)

To answer the actual question...
We really need to see what code is breaking to know what is wrong
here.  I think you may need to specify an actual named font rather
than relying on the default one, in order to pick up the ttf in the
exe directory.  Uh, one more thing.  Try manually putting the font
into library.zip.

You'll be safest to manually load the font yourself though, with the
pygame.Font function.

On Dec 4, 2007 1:57 PM, Casey Duncan [EMAIL PROTECTED] wrote:


 On Dec 4, 2007, at 1:19 PM, Joe Johnston wrote:

  hwg wrote:
  I'm trying to make an exe of a simple Pygame program.
   Here's the setup.py http://setup.py/:
   from distutils.core import setup
  import py2exe, pygame
  import glob, shutil
  setup(windows=[lunarlander.py http://lunarlander.py/])
  shutil.copyfile('moonsurface.png', 'dist/moonsurface.png')
  shutil.copyfile('lunarlander2.png', 'dist/lunarlander2.png')
  shutil.copyfile('C:/Python25/Lib/site-packages/pygame/
  freesansbold.ttf',
  'dist/freesansbold.ttf')
 
  Maybe I'm a loser, but I generally keep the setup.py script short.
  If I've got to move files, I do that from a bat script which can
  call my Windows installer compiler too (inno, my case).

 A good reason to keep this stuff in python (regardless of whether it
 is in setup.py or not) is portability. bat files only work on
 Windows. But then again, absolute paths (especially ones that use
 drive letters) are highly non-portable anyhow no matter what language
 they're in (even on different machines that are running Windows).

 -Casey