Fonts using diferent rendering engines
in
Programming Questions
•
2 years ago
Hi there,
I was trying to render a simple text into an embedded processing application. I use the following code:
public void setup(){
size(this.getWidth(), this.getHeight(), P2D);
textFont(loadFont("Verdana-12.vlw"));
}
public void draw(){
background(255, 255, 255);
smooth();
fill(0,0,0);
text("I like reading Monteiro Lobato.", 100,100);
}
It works, but the text is rendered awfully. I looks like the text was blured and the first line of characters bitmap was cropped. I spent many hours reading the forum, trying different codes, comparing the processing IDE and mine. I was going to give it away, when I decided to be more drastic: I changed the rendering engine, that is, I changed
size(this.getWidth(), this.getHeight(), P2D);
to
size(this.getWidth(), this.getHeight(), JAVA2D);
All text became beautiful and marvelous! My post is that I can't understand why? Why?! Shouldn't be the processing rendering better qualified to be used than the Java2D?
Thanks in advance,
Flávio Mello
I was trying to render a simple text into an embedded processing application. I use the following code:
public void setup(){
size(this.getWidth(), this.getHeight(), P2D);
textFont(loadFont("Verdana-12.vlw"));
}
public void draw(){
background(255, 255, 255);
smooth();
fill(0,0,0);
text("I like reading Monteiro Lobato.", 100,100);
}
It works, but the text is rendered awfully. I looks like the text was blured and the first line of characters bitmap was cropped. I spent many hours reading the forum, trying different codes, comparing the processing IDE and mine. I was going to give it away, when I decided to be more drastic: I changed the rendering engine, that is, I changed
size(this.getWidth(), this.getHeight(), P2D);
to
size(this.getWidth(), this.getHeight(), JAVA2D);
All text became beautiful and marvelous! My post is that I can't understand why? Why?! Shouldn't be the processing rendering better qualified to be used than the Java2D?
Thanks in advance,
Flávio Mello
1