Jump to content
  • Advertisement

Archived

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

TDM

OpenGL Opengl font display list character width

This topic is 5303 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!