XNA Creators Club Online
Page 1 of 1 (3 items)
Sort Posts: Previous Next

Expanding Tabs: ID3DXFont / SlimDX.Direct3D9.Font

Last post 8/8/2009 1:01 AM by flimflam. 2 replies.
  • 8/3/2009 2:05 PM

    Expanding Tabs: ID3DXFont / SlimDX.Direct3D9.Font

    I've been using XNA for a while, and never really got into the use of ID3DXFont even when I was using Native DirectX. I always wrote my own routines because I wanted to use very stylized images.

    While looking through the documentation for ID3DXFont, there is a lovely option for expanding tabs. The documentation claims this is defaulted to eight characters. I would really like the functionality that tabs would give me in terms of aligning text but 8 is far overkill. The way the documentation states it, it leads me to believe that this is changeable but I've found absolutely no information on this possibility. Is it possible?

    Thanks in advance.
  • 8/5/2009 2:53 AM In reply to

    Re: Expanding Tabs: ID3DXFont / SlimDX.Direct3D9.Font

    They just copied that description from the documentation for the GDI function TextOut. In GDI they also provide TabbedTextOut that lets you specify the tab stops explicitly. There is no corresponding call on ID3DXFont. However, its a relatively simple process to expand the tabs in the string yourself to the appropriate number of spaces before you hand it to ID3DXFont for rendering.
  • 8/8/2009 1:01 AM In reply to

    Re: Expanding Tabs: ID3DXFont / SlimDX.Direct3D9.Font

    Ah, that makes sense then.

    As for expanding the tabs myself, I did consider that but I'm not exactly sure how to go about doing it. For some reason my mind just isn't really clicking when it comes to the best method to go about it.
Page 1 of 1 (3 items) Previous Next