We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
PFonts (Read 851 times)
PFonts
Feb 13th, 2006, 11:22pm
 
I created a simple 'textBox' class, which has a Pfont as one of its properties.  Without thinking too much of it, I wrote a constructor that takes the name of the font as a string, then builds the Pfont in the constructor.  I found that with very few boxes on screen, I was running out of memory.  It turns out that Pfonts consume an extraordinary amount of memory, due to the .vlw format of the fonts.  The solution, of course, was to create some fonts that I want to use, then have the textBox objects simply point to the established Pfonts, rather than creating their own copies of the font.  While this is clearly the way it should have been done originally, it wasn't initially obvious that this was causing the problem.

Perhaps a warning regarding the size of PFonts would be useful in the Reference page for PFont or loadFont()...
Page Index Toggle Pages: 1