Archived

This topic is now archived and is closed to further replies.

TDM

OpenGL Opengl font display list character width

Recommended Posts

Hi I''m using wglUseFontBitmaps to create a display list of a font which I use to generate texture fonts. The calculations of the character widths are not always accurate enough though, sometimes resulting in widths that are just a bit too small, cutting off a few pixels of the right side of characters. What is a right way to get the real accurate character widths? Is there maybe a way to get this information out of the display lists generated by wglUseFontBitmaps? Thanks.

Share this post


Link to post
Share on other sites
Some extra information

I''ve tried out several of the windows API functions for getting the width, like GetCharWidth32, GetCharABCWidths, GetTextExtentPoint32 but all seem to be giving the same problem. So since the API funtions apparently can''t give me the right widths for all characters, maybe there''s another more accurate way?

Share this post


Link to post
Share on other sites
I have neved had any problems with the ABC width, but i dont know how youre going to match up the wgl calls with those values since abc is pixelwidth and i guess the wgl calls arent.

I use ABC with when i create a texture containing the characters, to separate them ''enough'' and to make sure that they will overlap properly when i later draw them with opengl, and from what ive seen it works like a charm.

Share this post


Link to post
Share on other sites