On any sketch I make, text looks absolutely horrible unless I create something larger than intended size (like 96 for size 48) and use that font, shrunk down, to create text. And if I shrink it down too much, it begins to display incorrectly again.
Characters are not only overly pixelated and blurry, they also clip the top and left sides of the text off.
Am I doing something wrong? It's only sketches that I create, sketches on the website look fine, and I get the same results when I use the same font and the same size as the examples.
I think that the problem here is that particular font- it doesn't seem to like displaying at small sizes. If you increase the size, or try a different font, it should look better. I don't have time to test it right now, but I will get back to you as soon as I can.
The ArialMT-16 name is strange... Perhaps it isn't found on the system and using a default font. With createFont, I use names as seen in font selectors, like "Arial", "Tahoma", "Lucida Sans Unicode", "Bitstream Vera Sans Mono", and so on.
I guess the "-16" should prevent it from recognizing it as ArialMT (not sure what I was thinking there), but it produced the same result as creating a size 16 ArialMT font and loading it from the font selector.
Your answer is strange. Either you use createFont("ArialMT", 16), or a loadFont("ArialMT-16.vlw") if you generated the font beforehand. As said, in Java2D mode, the former redraws the font on each use, can be slower, but works well if you use several sizes.
Sorry for the confusion. I initially noticed this problem in a much larger project where I had generated the font beforehand and used load font. I didn't want to include the entire thing, so I made this for an example then just copied and pasted the loadFont() line, changed it to createFont, added the size, and removed the .vlw but didn't think to remove the '-16' from the end.
I'm not really sure why this even works, maybe createFont() can recognize the font name and ignore the size denotation.