jogamp
›
jogl
Login
Register
Search
everywhere
only in this topic
Advanced Search
Font metrics in OpenGL
Classic
List
Threaded
♦
♦
Locked
4 messages
Options
Loading...
Subscribe via email
Move topic
Pin topic
Unpin topic
Lock topic
Unlock topic
Delete this topic
Delete this topic
Change title and meta tags
Embed post
Permalink
elect
Reply
|
Threaded
Open this post in threaded view
♦
♦
|
More
Loading...
Reply to author
Edit post
Move post
Delete this post
Delete this post and replies
Change post date
Print post
Permalink
Raw mail
May 10, 2012; 11:27am
Font metrics in OpenGL
Hallo,
In Java 2D we have font metrics to detect how much high and long is our text... does anything similar exist in OpenGL?
robbiezl
Reply
|
Threaded
Open this post in threaded view
♦
♦
|
More
Loading...
Reply to author
Edit post
Move post
Delete this post
Delete this post and replies
Change post date
Print post
Permalink
Raw mail
May 11, 2012; 6:32am
Re: Font metrics in OpenGL
this code is a sample in my project,i hope this can help u!
textRenderer.begin3DRendering();
textRenderer.setColor(255, 255, 255, 255);
Rectangle2D r2d=textRenderer.getBounds(flatLegendPicInforText);
float scaleFactor=0.0015f;
float textWidth3D=(float) (r2d.getWidth()*scaleFactor);
textRenderer.draw3D(flatLegendPicInforText, x-textWidth3D/2, y,z,scaleFactor);
textRenderer.flush();
textRenderer.end3DRendering();
elect
Reply
|
Threaded
Open this post in threaded view
♦
♦
|
More
Loading...
Reply to author
Edit post
Move post
Delete this post
Delete this post and replies
Change post date
Print post
Permalink
Raw mail
May 11, 2012; 9:10am
Re: Font metrics in OpenGL
Great, thank you very much robbiezl :)
gouessej
Reply
|
Threaded
Open this post in threaded view
♦
♦
|
More
Loading...
Reply to author
Edit post
Move post
Delete this post
Delete this post and replies
Change post date
Print post
Permalink
Raw mail
May 11, 2012; 10:22am
Re: Font metrics in OpenGL
Administrator
Hi
robbiezl showed an example of use with the legacy text renderer that uses Java2D fonts. I don't know how it works with the "new" shader-based text renderer.
Julien Gouesse |
Personal blog
|
Website
Free forum by Nabble
Edit this page