   DirectX Font Question - character size?
  Hello :)It might be simple and I am missing it, but here is my problem:I am writing a text box and I want to have a Caret (that flashing line that marks where you are now). Of course I can just insert it into the string but then it can move the whole screen all the time.Instead, I am trying to render it at the right position.My question is, how do I know what is the width of each individual character? can I know it? how might I reposition the Caret without causing the line to drop?I could probably stop using DirectX flag to auto break lines when needed and then I could easily insert it without worrying about breaking the line, but then I can only know at what width they break, rather than how many letters (considering every letter can have a different width). So I still won't know how to split my characters properly (render from this word to that word), unless I choose to break it by the amount of chars which seems a bit unreasonable to me.Thank you :)   
  Using 2d fonts, you can get them with the Win32 metrics methods, of which there are many :http://msdn.microsoft.com/en-us/library/dd144821(v=VS.85).aspxIf using 3D mesh-based fonts, the function to create a string optionally returns the glyph metrics for each character in the string.   ;  I think I can manage with this :) Thank you very much!Although this is probably what I needed more specifically:http://msdn.microsoft.com/en-us/library/bb173966(v=VS.85).aspxBut I found it thanks to your link :)   ;  I didn't know about that one.  Thanks! :p   ;  I am afraid it isn't working, GetGlyphData gives me incorrect rect values, am I missing something?(PS: I am using rect.right - rect.left, it seems to go a bit too much to the right each time)   ;  How are you using the black box?* edit:Also look here:http://www.gamedev.net/community/forums/topic.asp?topic_id=230309Towards the bottom, they discuss the glyph position.   ;  Thanks but I found a work around :)dc = (*pFont)->GetFontCOM()->GetDC();GetTextExtentPoint(dc, &m_Caption, 1, &size);This gives me perfect width :)And to answer your question, I was trying to use rect.right - rect.left to get the width, but from what I understand I can also get a texture (option I didn't use) and I should have found its size and use it as offsets to calculate the true size of the letter?Curious to know :)Anyways, it's working now :) Thank you!