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.
IndexProcessing DevelopmentLibraries,  Tool Development › Vertext: scalable fast typography!
Page Index Toggle Pages: 1
Vertext: scalable fast typography! (Read 1959 times)
Vertext: scalable fast typography!
Dec 1st, 2007, 1:56pm
 
Hello all. Posting a new library for the Processors.

http://www.ghost-hack.com/p5/vertext/

It's kind of ALPHA-ALPHA right now, not exactly ready for everybody. Although it does exactly as advertised: fast-rendering vector typography.

Technically, the library records each character as a textMode(SHAPE) drawing into OpenGL display-lists for callback. You can then scale them up to whatever size you want without losing detail but also have it render incredibly fast.

Last tested on Processing 0125 and haven't had time to try the latest versions yet.

Please test and let me know how it works for you!
Re: Vertext: scalable fast typography!
Reply #1 - Dec 1st, 2007, 2:49pm
 
hello mflux

it runs and it works like a charm.
thanks a lot.
that's what we need.
exactly this stuff.
great.

btw: very cute illustration on the site.

the hack to use display lists for fonts is a great idea.

i tried to set up a camera to rotate around the type.
that works only for the usual font. the vertext does not move or rotate... so it looks like it's only 2d. :(

however i guess it's alpha-alpha.... i hope you follow that one, it's really a great improvement.
Re: Vertext: scalable fast typography!
Reply #2 - Dec 1st, 2007, 2:56pm
 
You'd need to wrap the text drawing bit of code in a ((PGraphicsOpenGL)g).beginGL();/endGL(); to make rotations etc work.
Re: Vertext: scalable fast typography!
Reply #3 - Dec 1st, 2007, 3:04pm
 
yeah, works!
ah, this is amazing. wow.

thanks JohnG. :)
Re: Vertext: scalable fast typography!
Reply #4 - Dec 1st, 2007, 3:05pm
 
Oh crap.. thanks for the quick test guys. It's like.. 6AM where I'm at... dunno about you crazy people Smiley


Yeah. Display lists only respond to pure gl transform calls and I've been using my own wrapped-P5-wrapped-gl-transform calls for a while now and have totally forgot they do nothing to them. The methods are already in DisplayListManager.java (in my source code) but it requires the user to use those transform calls instead of Processing's!

Crap Sad

I'll scratch my head for a cleaner solution after some sleep. Maybe the library will hijack all the transform calls?
Re: Vertext: scalable fast typography!
Reply #5 - Dec 1st, 2007, 3:27pm
 
Your library can do the beginGL()/endGL() calls, since you pass in the PApplet in your P5Extend.register() method.

So all you need to do is ((PGraphicsOpenGL)passedPApplet.g).beginGL(); at the start of your text function, and ...g).endGL(); at the end, and it should Just Work™
Re: Vertext: scalable fast typography!
Reply #6 - Dec 1st, 2007, 9:58pm
 
Cool, thanks again JohnG. That's fixed and uploaded now.

Scary, though since I had to use my versions of GL transform calls between drawing the typography, but now with beginGL() the display lists will now also listen for transform calls outside the method.

Kind of janky Smiley but it indeed Just Work™s
Re: Vertext: scalable fast typography!
Reply #7 - Dec 1st, 2007, 10:34pm
 
beginGL() takes all the processing side transformations and applies them to the GL side, so after beginGL() everything is as it would be if all the transformations had been GL ones so you don't need to keep track of them in any way or form in your library.

endGL() then returns the GL transforms to processing ones. It's similar to pushMatrix/popMatrix, but it jumps the matrix from processing to/from GL.
Re: Vertext: scalable fast typography!
Reply #8 - Dec 1st, 2007, 11:01pm
 
how does this differ from just using textMode(SHAPE)?  specifically, any difference other than using display lists for speed?

sorry if that sounds like i'm questioning it's purpose, (NOT my intent!) just trying to understand exactly what it does.  guess what i was hoping for was outlines.

one thing that has annoyed me about text is that you can't draw it ONLY with outline stroke, it HAS to be filled.

what i started doing was grabbing points from the outline - see textCharImplShape() from PGraphicsOpenGL, or Sun has a demo that does the same thing - here's what my version sorta looks like:
http://www.davebollinger.com/works/p5/fontnoise2/
except it actually draws the lines instead of returning the points for the user to do something particle-based with.  (and the advantage of having the raw outlines, as opposed to the GLU tesselation polys, is you can now draw them with ANY renderer :)

anyway, just wanted to chime in and mention that code in case you might find a use for it, perhaps including it somehow in your more-polished library (a task i'd probably never get around to doing, and the Geomerative library already does better than mine anyway ;D)
Re: Vertext: scalable fast typography!
Reply #9 - Jan 5th, 2008, 1:36pm
 
Quote:
how does this differ from just using textMode(SHAPE)?  specifically, any difference other than using display lists for speed?

sorry if that sounds like i'm questioning it's purpose, (NOT my intent!) just trying to understand exactly what it does.  guess what i was hoping for was outlines.



Not at all. There's no difference, besides using display-lists for speed. A project I'm currently working on requires resolution-independent typography so they are required to be vectors. The results I got from textMode(SHAPE) was simply unacceptable, so I wrote this.


Quote:
one thing that has annoyed me about text is that you can't draw it ONLY with outline stroke, it HAS to be filled.

what i started doing was grabbing points from the outline - see textCharImplShape() from PGraphicsOpenGL, or Sun has a demo that does the same thing - here's what my version sorta looks like:
http://www.davebollinger.com/works/p5/fontnoise2/
except it actually draws the lines instead of returning the points for the user to do something particle-based with.  (and the advantage of having the raw outlines, as opposed to the GLU tesselation polys, is you can now draw them with ANY renderer Smiley


This is great! I think I've also read a similar (same?) technique from ProcessingHacks. If I ever get time I might be able to implement this for Vertext as well.
Page Index Toggle Pages: 1