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.
IndexProgramming Questions & HelpSyntax Questions › Newb question re: "Visualizing Data" pp.
Page Index Toggle Pages: 1
Newb question re: "Visualizing Data" pp. (Read 253 times)
Newb question re: "Visualizing Data" pp.
Jul 30th, 2008, 12:51am
 
Why do the lines

 PFont font = loadFont("AgencyFB-Reg-12.vlw");
 textFont(font);

have to come at the very beginning of the setup() block? I originally added them after size(), and the sketch did not work properly.
Re: Newb question "Visualizing Data" pp.
Reply #1 - Jul 30th, 2008, 1:41am
 
You don't, there's just a current bug that has been around for a while but for some reason has become far more prevalent in recent months:
http://dev.processing.org/bugs/show_bug.cgi?id=726
The problem is that textFont(), when used inside setup(), is sometimes forgotten by the time that draw() runs.

The size() command should *always* be at the beginning of setup(), and loadFont() can happen any time after that (preferably inside setup(), so you aren't re-loading the font at 60 frames a second).

To get around the bug, you'll need to use textFont(font) inside draw() (or before you use text). This particular bit will be fixed in an upcoming release.
Re: Newb question "Visualizing Data" pp.
Reply #2 - Jul 30th, 2008, 1:51am
 
cool, thank you!
Page Index Toggle Pages: 1