We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › is it possible to render text clearly using P3D
Page Index Toggle Pages: 1
is it possible to render text clearly using P3D (Read 779 times)
is it possible to render text clearly using P3D
Apr 28th, 2007, 11:02pm
 
below are links for images of the text using each processing render mode. p3d is clearly the worse. is this a p3d bug? i can only use the p3d renderer and the text is dynamic so making the text an image can not isnt an option.

P3D http://hypehypehype.net/processing/text_p3d.jpg
JAVA2D http://hypehypehype.net/processing/text_java2d.jpg
OPENGL http://hypehypehype.net/processing/text_opengl.jpg

CODE

PFont f1, f2, f3, f4;

void setup(){
 size(800, 400, P3D);

 f1 = loadFont("AkzidenzGroteskBE-Md-10.vlw");    
 f2 = loadFont("AkzidenzGroteskBE-Md-12.vlw");
 f3 = loadFont("HelveticaNeue-Medium-10.vlw");    
 f4 = loadFont("HelveticaNeue-Medium-12.vlw");  
}


void draw(){  
 background(255);
 fill(0);
 String t = "Loading bizznizzle from the 812 (Evansville, Bloomington, Terre Haute, New Albany, Columbus), IN";
 textFont(f1, 10);
 text(t, 100, 100);
 textFont(f2, 12);
 text(t, 100, 120);
 textFont(f3, 10);
 text(t, 100, 140);
 textFont(f4, 12);
 text(t, 100, 160);
}
Re: is it possible to render text clearly using P3
Reply #1 - Apr 29th, 2007, 1:22am
 
what did the text look like in the Create Font tool? my guess is that Akzidenz Grotesk BE is gonna look wretched at 10 pt no matter what.

alternatives to make text look best:

1) use the create font tool to make a font at the size that you want, and do not specify a size with textSize() or textFont(). use this when drawing flat (2D) text. (applies mostly to P3D and JAVA2D).

2) use textMode(SCREEN) with P3D for flat text, which will be pixel accurate to your original font (and fast).

3) with OPENGL and P3D, create the font at a size that's larger than what's being used, in cases where text will be rotated/moved around/resized etc. (that's why the tool defaults to font size 48).

4) when using JAVA2D, use the createFont() method to use a ttf file or an installed font (dangerous when distributing via the web), which will make use of the native font, rather than bitmaps.

as said elsewhere, P3D is made to be fast, not pretty. JAVA2D is slow but prettier, and OPENGL is somewhere in between, depending on what you're doing.
Re: is it possible to render text clearly using P3
Reply #2 - Apr 29th, 2007, 7:36pm
 
true. i forgot about the textMode call. the SCREEN paramater fixed the issue. thanks.
Page Index Toggle Pages: 1