FontRenderContext

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

FontRenderContext

snakedoctor
When instantiating a TextRenderer object the underlying FontRenderContext object is null.

I am experiencing an error when using the TextRenderer's public getCharWidth() method.

Apparently the code works in some cases in and in other cases a stack trace shows this error:

fontRenderContext never initialized!

The stack trace shows The GlyphProducer (another underlying object) failing on its getGlyphPixelWidth() method.

Anyone have a solution or workaround for this?
Reply | Threaded
Open this post in threaded view
|

Re: FontRenderContext

gouessej
Administrator
Hi

Which version of JOGL do you use? You can't get the char width very early. I'm looking at the source code...
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: FontRenderContext

gouessej
Administrator
In reply to this post by snakedoctor
Please fill a bug report, fontRenderContext is always set to null, getFontRenderContext() should be called here:
https://github.com/sgothel/jogl/blob/master/src/jogl/classes/com/jogamp/opengl/util/awt/TextRenderer.java#L1682
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: FontRenderContext

snakedoctor
In reply to this post by gouessej
v2.3.1, I am not sure if it's really a bug or perhaps the way we are using it.
Reply | Threaded
Open this post in threaded view
|

Re: FontRenderContext

gouessej
Administrator
No it's a bug, there is a code path that attempts to use a font render context never assigned, it works when you ask the char width of an already cached character.

Please switch to JOGL 2.3.2. We only maintain the very latest version.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

RE: FontRenderContext

snakedoctor

Hey man,

 

Would you mind submitting the bug report then?

 

You can take full credit for it, I don’t care – I am kind of a newb when it comes to this jogl stuff anyway.

 

I will buy you a couple of drinks if you are ever in my hood.

 

With kind regards,

 

 

 

From: gouessej [via jogamp] [mailto:ml-node+[hidden email]]
Sent: Wednesday, November 25, 2015 18:01
To: Etkins, Dave (HGR) <[hidden email]>
Subject: Re: FontRenderContext

 

No it's a bug, there is a code path that attempts to use a font render context never assigned, it works when you ask the char width of an already cached character.

 


If you reply to this email, your message will be added to the discussion below:

http://forum.jogamp.org/FontRenderContext-tp4035841p4035848.html

To unsubscribe from FontRenderContext, click here.
NAML