We are about to switch to a new forum software. Until then we have removed the registration on this forum.
When I setup my code like this:
PFont f;
void setup(){
size(400, 400);
f = createFont("Arial", 16, true);
textFont(f);
fill(0);
text("Red", width/2, height/2);
}
I get nice, smoothly rendered text.
However, when I recode like this:
PFont f;
void setup(){
size(400, 400);
f = createFont("Arial", 16, true);
textFont(f);
}
void draw(){
fill(0);
text("Red", width/2, height/2);
}
I get incredibly jagged-looking text. How does one get smooth text in draw()?![smooth]
Answers
setup() runs once, draw() runs an 60 times per second (default) until your sketch is closed.
The text is smooth at the beginning, but as you are rendering more and more layers of text at the same spot (60 layers per second), without clearing the background, even anti-aliased fonts will become aliased.
Just insert something like background(#d1d1d1); before the text() call or add noLoop(); to your setup() function;
Technical FAQ: Why are text and graphics so ugly and blocky?
B-)
Perhaps the FAQ article should be something along the lines of "Why are my text and graphics so ugly and blocky?"