   How to change the font style in DirectX9
  Hi!Im asking myself how to change the font style after creating the global ID3DXFont font.I only know the following sequence:1.) Creating the global ID3DXFont font object with a font description:D3DXCreateFontIndirect(ptrD3DDevice,&FontDesc,&DxFont);2.)Use this font object to draw text with the DrawText-Method.Where can I change the style when I want to use "Arial" and then "Times New Roman"...ID3DXFont has a GetDesc-Method but no Set().   
  You'll need to create a new ID3DXFont object for each font/style you want to use. You can have several ID3DXFonts at the same time, and draw some of the text with one, and some with the other.   ;Quote:Original post by sirobYou'll need to create a new ID3DXFont object for each font/style you want to use. You can have several ID3DXFonts at the same time, and draw some of the text with one, and some with the other.I thought it would be the same as with the sprites where you only have ONE sprite object.Is there a limit for ID3DXFont-objects or could I create a Text-class, and each instance of this class would have its own font object?   ;Quote:Original post by DelrynIs there a limit for ID3DXFont-objects or could I create a Text-class, and each instance of this class would have its own font object?I'm not aware of any hard-set limit. Naturally, you'll be limited by memory, and it's important to note that each ID3DXFont object has it's own texture internally, and with larger fonts, this texture would be pretty big.You don't have to, but it's recommended that you only have one ID3DXFont object per possible font/style combination.Also, as long as you pass them all the same ID3DXSprite within one Begin/End sequence, you shouldn't have any particular performance issues with multiple ID3DXFont instances.Hope this helps.   ;  This helped, thx :)How can I use this function with a ID3DXSprite? Simple create a sprite and pass it? What does the drawtext function with it?;Quote:Original post by DelrynThis helped, thx :)How can I use this function with a ID3DXSprite? Simple create a sprite and pass it? What does the drawtext function with it?If you already have an ID3DXSprite, then you can pass it to DrawText.DrawText uses the sprite for batching - think of ID3DXSprite as a vertex buffer manager, when you call ID3DXSprite::Draw(), it just adds the sprite to the vertex buffer - likewise, passing the sprite to ID3DXFont::DrawText causes each letter to be drawn as a sprite, meaning better performance.You'll only see better performance if you're calling DrawText more than once. The font object manages a texture internally, and renders glyphs to that, then draws them applied to textured quads. If you call DrawText twice in a row with no sprite specified, the font object has to draw the text in two batches, otherwise it can queue both draw calls up to the sprite, and let it draw them in one go.My explanation sucks :P   