Jump to content
  • Advertisement
Sign in to follow this  
mameman

Bounding Rectangle For Text?

This topic is 4066 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, Does anyone know of a good way to calculate the EXACT bounding rectangle for some text using any TrueType font?. I've gone through a hole host of techniques (including examining the GDI path) for the font but I've not had ANY success :(. I always seem to be one or two pixels out either on the horizontal or vertical axis. Using Win32/C++ and OGL. ANY ideas/suggestions on how to lance this problem MUCH appreciated. MAMEman.

Share this post


Link to post
Share on other sites
Advertisement
Thanks for the infos prototype but this isn't what I'm looking for!. Probably didn't explain the problem correctly. Anyways let me simplify. Basically try to draw some text at 0, 0 using DrawText(), TextOut() or any other GDI function you care to use, and try to put a rectangle around it WITHOUT leaving any space on the left, top, right and bottom sides of the text. Note this assumes that you can use any TrueType font and memory permitting any pointsize too.

Hope this simplifies,

MAMEman.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!