Get it? Clarification? OK, that was a bad pun.
I wanted to jump in on this thread because I feel like using an offscreen buffer does have aliasing issues, and not just with text. However, text provides a convenient testbed. Here is a test I wrote, and the result.
Code:
// Test to compare:
// * Rendering text directly to screen
// * Rendering text to an offscreen buffer and placing on screen
PGraphics buffer;
PFont myFont;
void setup() {
size(150, 100);
buffer = createGraphics(150, 50, P2D);
myFont = createFont("Verdana", 14);
}
void draw() {
renderText(g, "Direct to Screen");
renderText(buffer, "First to Buffer");
image(buffer, 0, 50);
}
void renderText(PGraphics target, String string) {
target.beginDraw();
target.fill(0);
target.rect(0, 0, width, 50);
target.fill(255);
target.textAlign(CENTER);
target.textFont(myFont);
target.text(string, width/2, 25);
target.endDraw();
}
It's pretty obvious to me that one thing is not like the other. But it's not clear why!
If I understand what's being said (and trust me, it's a good chance I don't!
), then I think I'm doing it right by drawing a "background" of black behind the text. If it's not a bug, then could you help me/us by fixing the code above?
Thank you!