Author Topic: DirectX9 - Font with outline ?  (Read 5927 times)

0 Members and 1 Guest are viewing this topic.

Offline va!n

  • Pentium
  • *****
  • Posts: 1435
  • Karma: 109
    • View Profile
    • http://www.secretly.de
DirectX9 - Font with outline ?
« on: January 28, 2008 »
I just have a small question regarding drawing DX9 Fonts! I am using D3DXCreateFont() for creating and DrawTextA() to display the string/DXFont. This works without any problems!

The question, how to display the DXFont in color red with a blue outline? Is it still possible with this two commands? I have tried a search on google but i did not really found something usefull. Thanks in advance.
- hp EliteBook 8540p, 4 GB RAM, Windows 8.1 x64
- Asus P5Q, Intel Q8200, 6 GB DDR2, Radeon 4870, Windows 8.1 x64
http://www.secretly.de
Challenge Trophies Won:

Offline Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5301
  • Karma: 402
    • View Profile
Re: DirectX9 - Font with outline ?
« Reply #1 on: January 28, 2008 »
If you can change the colour at all, then you'd need to draw it in blue, then slightly smaller and offset in red.
That doesn't sound like a brilliant solution to me, 'cos you'd probably need 2 fonts at different sizes to do that.
Combine that with the fact that d3dxfont is not a fast API at all.

...later...
Actually, I was looking for a Text3D sample that used to be with DirectX.  It implemented a class called CD3DFont which pre-rendered a font onto a texture, then let you draw it at any size/position/colour/orientation and it was really quick.  Looks like that sample has been dropped in favour of d3dxfont sample, and I wonder why.

I've used CD3DFont before and it was cool, but it needs big textures to look good, and right now I can't find an archive of the sample - it's part of older DirectX9 SDK samples.

Jim
Challenge Trophies Won:

Offline Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5301
  • Karma: 402
    • View Profile
Re: DirectX9 - Font with outline ?
« Reply #2 on: January 28, 2008 »
OK, here's your answer, ID3DXFont got a massive speed boost at some point
http://www.gamedev.net/community/forums/topic.asp?topic_id=182032

Jim
Challenge Trophies Won:

Offline va!n

  • Pentium
  • *****
  • Posts: 1435
  • Karma: 109
    • View Profile
    • http://www.secretly.de
Re: DirectX9 - Font with outline ?
« Reply #3 on: January 30, 2008 »
@jim. ok thanks. i think i will first continue some other parts in my project and then i will spend some time with the outlined font ^^
- hp EliteBook 8540p, 4 GB RAM, Windows 8.1 x64
- Asus P5Q, Intel Q8200, 6 GB DDR2, Radeon 4870, Windows 8.1 x64
http://www.secretly.de
Challenge Trophies Won: