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.
Page Index Toggle Pages: 1
Vector fonts. (Read 2920 times)
Vector fonts.
Nov 10th, 2009, 11:27am
 
Hi I don't really understand how fonts work in Processing, I looked at createFont and loadFont, but i'm still pretty confused. I'm trying to make a bit of 3D work, but when I move my text 'closer' it becomes really pixelated. How do I create a vector font that will stop this from happening? Thanks!
Re: Vector fonts.
Reply #1 - Nov 10th, 2009, 12:28pm
 
Vector fonts are available only with JAVA2D renderer (since that's Java that does the hard work of parsing the TTF file and drawing the characters).
From "createFont()" reference page: "With the P2D, P3D, and OPENGL renderer settings, the bitmapped version will be used."
There might be libraries allowing to use vector fonts in 3D, I don't know.
Re: Vector fonts.
Reply #2 - Nov 10th, 2009, 1:37pm
 
Take a look at Vertext
http://www.ghost-hack.com/p5/vertext/

V also wrote something..
http://www.pixelnerve.com/v/2009/03/08/text-render-for-javaprocessing-using-opengl/

Take a look at this thread.
http://processing.org/discourse/yabb2/?num=1213559873/15
Re: Vector fonts.
Reply #3 - Nov 11th, 2009, 5:07am
 
Ace, that Vertext looks perfect, I have downloaded it, so to make it work/load into my sketches, do I just place the whole file into the 'libraries' folder inside Processing application? W.
Re: Vector fonts.
Reply #4 - Nov 12th, 2009, 4:03am
 
I've tried to apply Vertext using the guide, but I keep getting an error saying " the function (P5Extend( MY SKETCH NAME )) does not exist". Any ideas what P5Extend is? Thanks.

Quote:
import flux.vertext.*;
Vertext myFont;


//PFont.list();
 void setup(){
 size(200, 200, OPENGL);
 P5Extend(this);
   myfont = new Vertext("ArialBold", 10, 0);
   
}

void draw(){
 
    myFont.text("Hello World?", 100, 100);
    
}

Re: Vector fonts.
Reply #5 - Nov 12th, 2009, 5:23am
 
P5Extend is a class, not a function.
The example on the home page shows it is used like: P5Extend.register(this);
Re: Vector fonts.
Reply #6 - Nov 12th, 2009, 10:50am
 
Hmm, something still seems wrong here, not sure what doesnt like!?

Quote:
import flux.vertext.*;
import processing.opengl.*;

Vertext myBigFont;



 void setup(){
 size(200, 200, OPENGL);
P5Extend.register(this);
   Vertext myBigfont = new Vertext("ArialBold", 10, 0);
   
}

void draw(){
 background(255);
    Vertext myBigFont.text("Hello World?", 100, 100);
    
}

Re: Vector fonts.
Reply #7 - Nov 12th, 2009, 12:03pm
 
You should use declaration (pre-pending with class name)  only once, at global level.
Re: Vector fonts.
Reply #8 - Nov 13th, 2009, 11:27am
 
Sorry i'm afraid I'm a complete novice to coding and Processing, can you put that in simpleton-speak for me please?  Shocked
Re: Vector fonts.
Reply #9 - Nov 13th, 2009, 11:35am
 
Once you've declared an object as 'Vertext' at the beginning of your programme you don't need to declare it as Vertext again when you assign it a value or call a method on it:

Code:
Vertext myBigFont;

void setup(){
size(200, 200, OPENGL);
P5Extend.register(this);
  myBigfont = new Vertext("ArialBold", 10, 0);
}

void draw(){
background(255);
   myBigFont.text("Hello World?", 100, 100);
   
}


Otherwise I think it gets treated as though you're declaring a new object whose scope is limited to the function in which you declare it...
Re: Vector fonts.
Reply #10 - Nov 19th, 2009, 4:10am
 
I still haven't found anything to help with this, has anyone got a sketch using verText that I could try pasting in in case its something to-do with my libaries?

Quote:
import flux.vertext.*;
import processing.opengl.*;



Vertext myBigFont;



 void setup(){
 size(200, 200, OPENGL);
 P5Extend.register(this);
 
 myBigfont = new Vertext("Times-Roman", 10, 0);
   
}

void draw(){
 background(255);
    myBigFont.text("Hello World?", 100, 100);
    
}

Re: Vector fonts.
Reply #11 - Nov 19th, 2009, 4:46am
 
that works for me, but even with a font size of 72

myBigFont = new Vertext("Times-Roman", 72, 128);

the text is *tiny*. (so tiny it's easy to miss, try a longer string)

> Ace, that Vertext looks perfect, I have downloaded it, so to make it work/load into my sketches, do I just place the whole file into the 'libraries' folder inside Processing application? W.

unzip the file into the libraries directory under the directory containing your sketches (you may need to create the libraries directory)

my sketchbook is here:

C:\Documents and Settings\koogy\My Documents\Processing

and i've unzipped into libraries there so that the vertext jar, for instance, is

C:\Documents and Settings\koogy\My Documents\Processing\libraries\vertext\library\vertext.jar
Re: Vector fonts.
Reply #12 - Mar 25th, 2010, 8:41am
 
Same problem here. I guess something changed inside processing since vertext is some years old now :/
Page Index Toggle Pages: 1