[visionegg] bug in Text, and workaround

Minor bug report... I have some code where I create a couple thousand Text 
objects before the experiment starts (the idea is to create all the stimuli at 
the beginning so that they can be instantly loaded during the experiment).  I 
found that VisionEgg crashes if you create too many Text objects; this is 
because Pygame crashes if you create too many Font objects ("IOError: unable to 
read font filename").  Perhaps there is a smarter way to code my experiment to 
avoid creating as many Text objects, but I opted to do a simple workaround 
where I keep a dictionary of Font objects, to avoid having to create duplicate 
Font objects for every Text object with the same font.  It might be good to 
take this bug into account in future versions of VisionEgg.
 
---------------------------------------------------------------
Mason Smith
Research Associate, Rick Lewis Lab
University of Michigan, Department of Psychology
530 Church St., Ann Arbor, MI 48109-1043
Lab: East Hall, Room B380      Phone: (734) 764-6827
Fax: (734) 763-7480      Email:  masonrs@xxxxxxxxx

Other related posts: