|
Author |
Topic: fileglob for fonts, etc.? (Read 582 times) |
|
kevinP
|
fileglob for fonts, etc.?
« on: May 25th, 2004, 10:26pm » |
|
After adding "foreach", how about adding a fileglob? It seems that using a font would be much simpler if I could just do something like this... myFont = loadFont("Matrix*"); // or even "Ma*" if one has only one file or link in the data directory // instead of "MatrixScriptBook.vlw.gz" with all its possibilities of typos, etc. Also, I noticed that when a font is not loaded that Processing catches the exception and prints (24+ times per second if you are writing in the main loop): "text(): first set a font before drawing text" Maybe it would be better to quit the run? -K
|
« Last Edit: May 25th, 2004, 10:27pm by kevinP » |
|
Kevin Pfeiffer
|
|
|
mKoser
|
Re: fileglob for fonts, etc.?
« Reply #1 on: May 29th, 2004, 8:00pm » |
|
ehm... then what happens if accidently you have these two files in your data folder: MatrixScriptBook_1.vlw.gz MatrixScriptBook_2.vlw.gz what will your variabel 'myFont' then be? i dont think adding a fileGlob (never head that expression before!) is a good idea! * the point about stopping the sketch-run when no font is loaded is a good idea though! + m
|
« Last Edit: May 29th, 2004, 9:35pm by mKoser » |
|
mikkel crone koser | www.beyondthree.com | http://processing.beyondthree.com
|
|
|
TomC
|
Re: fileglob for fonts, etc.?
« Reply #2 on: May 29th, 2004, 8:05pm » |
|
Since the file glob would really only be there to save typing, I think it would be better just to have auto-complete in the editor, and include filenames from the data directory in the word list.
|
|
|
|
kevinP
|
Re: fileglob for fonts, etc.?
« Reply #3 on: Jun 1st, 2004, 1:23am » |
|
on May 29th, 2004, 8:00pm, mKoser wrote:ehm... then what happens if accidently you have these two files in your data folder: [...] |
| Picks the first match when reading directory. A glob is simply a wild card match (I believe).
|
« Last Edit: Jun 1st, 2004, 1:32am by kevinP » |
|
Kevin Pfeiffer
|
|
|
kevinP
|
Re: fileglob for fonts, etc.?
« Reply #4 on: Jun 1st, 2004, 1:24am » |
|
on May 29th, 2004, 8:05pm, TomC wrote:Since the file glob would really only be there to save typing, I think it would be better just to have auto-complete in the editor, and include filenames from the data directory in the word list. |
| Well, that would also be quite nice.
|
Kevin Pfeiffer
|
|
|
|