AWT TextRenderer vs com.jogamp.graph.curve.opengl.TextRegionUtil

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

AWT TextRenderer vs com.jogamp.graph.curve.opengl.TextRegionUtil

mahesh
I am planning to write html renderer in jogl which obviously will need lot of styling in text. I am currently using awt textrenderer and I have to cache one textrenderer for each style, and hence eventually one texture for each.

Will it be more beneficial to use curve based textrenderer in point of view of performance and memory usage?

Where can I get some standalone working example for com.jogamp.graph.curve.opengl.TextRegionUtil, all seem to be outdated and do not work with jogl 2.3.3? Isn't there any tutorial to use this new way of rendering text?




Reply | Threaded
Open this post in threaded view
|

Re: AWT TextRenderer vs com.jogamp.graph.curve.opengl.TextRegionUtil

gouessej
Administrator
Hello

Which examples seem to be outdated? By the way, JOGL 2.3.3 isn't released yet, you're probably talking about JOGL 2.3.2.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: AWT TextRenderer vs com.jogamp.graph.curve.opengl.TextRegionUtil

mahesh
Oh sorry , I am using jogl 2.3.2 fat version

Only example that I could find in demos (from  https://github.com/sgothel/jogl-demos/tree/master/src/demos) is
experiments.TextRendererTest but lot of imports are missing especially com.jogamp.graph.curve.opengl.TextRenderer.

Can you please post some working examples,  and put some light on how new textrenderer is better than awt text renderer.

regards.
Reply | Threaded
Open this post in threaded view
|

Re: AWT TextRenderer vs com.jogamp.graph.curve.opengl.TextRegionUtil

gouessej
Administrator
TextRenderer doesn't exist in com.jogamp.graph.curve.opengl but RegionRenderer does.

There is no example using com.jogamp.graph in jogl-demos. You should rather look at those classes:
https://github.com/sgothel/jogl/tree/master/src/test/com/jogamp/opengl/test/junit/graph/demos

"better" is a subjectivity hint. Each solution has its pros and its cons. The legacy text renderer relies on AWT which means it can't work in AWT-free environment (typically Android) and it doesn't support forward compatible OpenGL contexts which is a serious limitation where no backward compatible context is available whereas the more recent API for text and curve drawing is resolution independent and supports both backward compatible contexts (as long as it supports shaders) and forward compatible contexts.

Personally, I use neither of them because I have different needs and their respective limitations bother me. My needs might be different of yours. I need to make my game work on terribly old hardware (OpenGL 1.3) with no shader and preferably without AWT. com.jogamp.graph.curve.opengl.TextRegionUtil goes to the right direction on the long term as some things seem to be almost impossible to achieve without shader but I persist in trying to find a more convenient solution for me.

Which kind of text do you need to draw?

Note that the new API has some widgets too.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: AWT TextRenderer vs com.jogamp.graph.curve.opengl.TextRegionUtil

mahesh
I am working on physics simulator (using Newt and targetting Desktop only) will involves atleast 5 different kind of fonts (symbols, subscripts, large,medium and small size), currently I am using 5 separate awt TextRenderers which is working absolutely fine.

But now I am thinking of adding some html support which will need bold italic version of these fonts to making requirement of 15 TextRenderers atleast, thats why I am thinking of switching to curve TextRenderer.

For widgets I am using my own library as you can see in screenshot.

in this context can you please suggest if I should switch to new curve based textrenderer if so please point out few resources to learn from. (except the  demos you suggested, since they are very abstract)

regards.
physics simulator screenshot
Reply | Threaded
Open this post in threaded view
|

Re: AWT TextRenderer vs com.jogamp.graph.curve.opengl.TextRegionUtil

gouessej
Administrator
Stick to the AWT text renderer as it works for you. If I were you, I wouldn't take the risk of switching to the curve renderer. If you find a memory leak or a problem of high memory footprint in the text renderer, let me know.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: AWT TextRenderer vs com.jogamp.graph.curve.opengl.TextRegionUtil

mahesh
Thanks for the tip...