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 & HelpPrograms › problems with ttfs in data folder
Page Index Toggle Pages: 1
problems with ttfs in data folder (Read 982 times)
problems with ttfs in data folder
Feb 14th, 2010, 12:33pm
 
Hey,

I'm working on a project, where it is necessary to use some ttfs, which should be included to the applictation. so after hours of trying to make it run in vain, i'm asking now for a hint.

I'm working on mac osx and firstly i deactivated all fonts. then i read out the fonts still active fonts by using the following code:

Code:
String[] fontList = PFont.list();
println(fontList);


There were some fonts found, that couldn't be deactivated ok, but now the problem: if i copy some ttfs into the sketches datafolder, nothing changes. also if i copy them to the sketch folder itself, it doesn't want to find any new font files.

is there a solution for this problem?
or do u need more information?

thanks,

oli.rennt
Re: problems with ttfs in data folder
Reply #1 - Feb 14th, 2010, 9:59pm
 
If you just need the font in your sketch, the common method is to use Processing's built-in Tools/Create Font... dialog to create a .vlw file from the .ttf font.
Re: problems with ttfs in data folder
Reply #2 - Feb 15th, 2010, 2:16am
 
I don't understand your problem. But I believe that PFont.list() will list only the fonts installed on the system. If you need to list font files elsewhere, use File.list().
How do you plan to use the TTF files you found?
Re: problems with ttfs in data folder
Reply #3 - Feb 15th, 2010, 10:56am
 
hey,

thanks for your replies.

@BenHem: the idea with vlw-conversion doesn't work because it is only possible to save them with a maximum of 255pt. an i need letters of different types with about 400-500pt. when i enlarge them in the program with the vlw at 255pt, the quality is quite bad. but it is is possible with the following code:

Code:
 PFont font = createFont(font, size, char[]); 



now i take a medium size, that it doesn't need too long to load, because the larger the font, the larger to loading process.

Code:
 textFont(fonts, 500); 



now i set the font and it works, with good quality.

the problem is now to pack the whole application for transport. i have to put all the ttfs in the data folder, like it is said here on processing.org.

"Another option for type, is to use createFont() with a TrueType font (some OpenType fonts also work). Any font that shows up in PFont.list() should work, or if not, adding a .ttf file to the data directory and calling createFont("fontname.ttf") will also work."

but as i told you, processing doesn't find my ttfs in the data folder.

thanks for your answers...
Re: problems with ttfs in data folder
Reply #4 - Feb 15th, 2010, 2:26pm
 
Quote:
processing doesn't find my ttfs in the data folder.

You mean that createFont("fontname.ttf", fontSize) doesn't work if fontname.ttf is in the data folder?
Just tested on Windows XP and it works...
Re: problems with ttfs in data folder
Reply #5 - Feb 16th, 2010, 2:50pm
 


yeah this was the trick Wink

the problem was to use the FILEname of the font, not the FONTname, how it is installed on the system. after i really took the "filename.ttf"-version, it worked. thanks Wink
Page Index Toggle Pages: 1