PDA

View Full Version : Pixel Lenght of 3DFont



Rajiv Mishra
11-20-2001, 11:39 PM
By using wglUseFontOutlines(),I have draw a text in 3D font,now i wants to calculate the PixelLenght of that text in given format.

mikael_aronsson
11-21-2001, 04:38 AM
Hi !

There is no way to do that with OpenGL, you have to calculate it on your own using GDI functions.

GetTextExtent(Ex) might be of some help.

Mikael

mikael_aronsson
11-21-2001, 04:39 AM
Also remember that an outline font does not have a "pixellength" it's just a set of polylines or triangle(strips/fans), so the length depends on how you display it in OpenGL to.

Mikael

Rajiv Mishra
11-21-2001, 07:42 PM
Hello mikael_aronsson,
I think you are correct,but what do mean by "so the length depends on how you display it in OpenGL to",it means the lenght is equal to starting co-ordinates of text to end co-ordinates of text in OpenGL Co-ordinate system after that I have to calculate the pixellenght by pixel mapping?