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 › loadFont() issue
Page Index Toggle Pages: 1
loadFont() issue (Read 2213 times)
loadFont() issue
May 27th, 2010, 3:06am
 
Hi everyone,

loading fonts won't work for me at all for some reason. If I include the code:

"PFont font=loadFont("font.vlw");"

in any of my programs I get this error: "Could not load font. Make sure that the font has been copied to the data folder of your sketch" (ofq I made sure of that several times).

Can anyone tell me what the problem might be and how to solve it?
It's really frustraing, since I'm about to publish some stuff I'm kinda proud of, and I all I'm missing is some text from my buttons...

Thanks a lot in advance!
Re: loadFont() issue
Reply #1 - May 27th, 2010, 3:40am
 
"PFont font=loadFont("font.vlw");" is a generic form.  It'll only work if you've named you file "font.vlw".  By default the .vlw files Processing generates are in the form "FontName-size.vlw," e.g. "Monaco-10.vlw."  If you generated your font file with Processing, renamed it "font.vlw," put it in the sketch/data folder, and it's still failing, maybe a full code paste would help...
Re: loadFont() issue
Reply #2 - May 27th, 2010, 3:44am
 
i prefere createFont()
you can easily change the size, share your code easier...

http://processing.org/reference/createFont_.html
Re: loadFont() issue
Reply #3 - May 27th, 2010, 4:04am
 
sure, but you're not guaranteed that the other user will have the font you prefer.  Nice for rough draft / code sharing as you say though
Re: loadFont() issue
Reply #4 - May 27th, 2010, 4:12am
 
true, if your sketch is final, or you want to upload it to a website loadFont is much better/the only option.

But as you said, for drafting/sharing its easier.
Re: loadFont() issue
Reply #5 - May 27th, 2010, 4:14am
 
Agreed.  For final drafts, loadFont() is the way to go.  But there sure is a case for createFont().  Especially, as we have both mentioned at this point, when sharing rough copies
Page Index Toggle Pages: 1