Jump to content
  • Advertisement
Sign in to follow this  
Calin

how to get the pixel length of a leter (GetGlyphData)

This topic is 3794 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

I've tried using GetGlyphData() but the X value of the returned rectangle is trash. I've searched more, the glyph parameter is not the ascii leter code as I thought [Edited by - Calin on February 4, 2008 11:00:35 AM]

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by Calin
I've tried using GetGlyphData() but the X value of the returned rectangle is trash.
I've searched more, the glyph parameter is not the ascii leter code as I thought
Correct, it's the Glyph ID, not the ASCII code.

Why do you want the blackbox size for one letter? Why not use DrawText with the DT_CALCRECT flag?

Share this post


Link to post
Share on other sites
Quote:
Original post by Evil Steve
Quote:
Original post by Calin
I've tried using GetGlyphData() but the X value of the returned rectangle is trash.
I've searched more, the glyph parameter is not the ascii leter code as I thought

Why do you want the blackbox size for one letter? Why not use DrawText with the DT_CALCRECT flag?


I didn't knew you can format the text using flags in DrawText. It will work for placing the text at the middle of the button however I am also trying to place the blinking cursor inside a textbox at the right location.

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!