   LPD3DXFONT and string width
  Im using the LPD3DXFONT structure to create simple 2D fonts, but i am having problems layng out the text because I can''t find a way of pre-calculating the final width and height of the printed text. I know that LPD3DXFONT::DrawText returns the height of the string, but I cant find anyway of getting the width of the text.Any ideas?CheersSpree 
  As of Direct3D 8, you could pass a flag to DrawText() so that it filled the rect you passed it with the proper values, then you had to call it again with that rect to actually do the drawing.  IIRC, I took out the "filling rectangle" call, and it seemed to work fine, but then I realized how agonizingly slow it was.There are two Win32 functions that can return the width of a string, I can''t remember what they are offhand but one is something like GetABCWidths() or something.. *looks in psdk* they''re GetCharWidth32() and GetCharABCWidths(), but it seems that they''re only for single characters. Worst comes to worst, make a lookup table for your character widths, I guess. ;  You pass in the width and height of each character in the text.  You can multiply the width by the number of characters for the final width.  Is this what you mean?Chris 