Last night a strange thing happened with a program I am developing in Processing 2.0.2 on Mac OS X 10.6.8. I use the sequence in setup()
hint(ENABLE_NATIVE_FONTS);
font = createFont("Helvetica", 32, true);
textFont(font, 32);
In other places I use the font in different sizes, using textSize(theSize) in various methods, where theSize is a method argument. This has worked well until yesterday afternoon, and it works fine this afternoon.
But last night, with no change in the code, nor as far as I know in the Processing application, which still says it is 2.0.2 in the "About" dialogue, I got a red console message saying that " hint(ENABLE_NATIVE_FONTS);" was not supported in Processing 2.0.4, and to use createFont() instead. All my text outputs were distorted, with irregular baselines, some fuzzy letters, some letters faded to near invisibility. This afternoon everything again works as it had been, with crisp text (I had originally put the "hint" in the code because without it I had been unable to get crisp text).
Two questions: (1) Where did this message come from and why was my text output distorted, when so far as I know, absolutely nothing changed between when I went for dinner and when I came back a couple of hours later?
(2) If the "hint" is indeed going to be not supported, how is one supposed to produce nice-looking text?
In a class, I want to have a method that takes a String as an argument. If a PShape of that name exists, the method will use it with the remaining arguments. If no such PShape exists, the method should create it, using the remaining arguments. The String is completely arbitrary and the number of such PShapes is unknown. Since Processing apparently does not have "if (exists (x))" or an equivalent that I can find, and the trick of predefining a boolean "theNameExists" obviously cannot work, I am stuck for a way to do this.
I'm sure it's not a novel problem, but I can't find that it has been asked in this forum or that it is addressed in tutorials or examples. If it has, I apologize.
How can I view the Language reference in the old alphabetical order? I find it useful for different purposes than the categorical listing, and switched a lot between the two listings, probably using the alphabetical version more than the categorical. But now the alphabetical listing seems to have disappeared, or maybe I have missed the link to it.
The HashMap Class example distributed with Processing 2.0b7 won't compile because "Iterator" is unknown. It needs "import java.util.*;" -- at least that makes it compile and work. I am a total novice Processing user and it's a long time since I used Java, so there may well be other ways of making the example work, but this seems pretty clean.