Dark Bit Factory & Gravity

PROGRAMMING => General coding questions => Topic started by: va!n on January 28, 2008

Title: DirectX9 - Font with outline ?
Post by: va!n 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.
Title: Re: DirectX9 - Font with outline ?
Post by: Jim 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
Title: Re: DirectX9 - Font with outline ?
Post by: Jim 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 (http://www.gamedev.net/community/forums/topic.asp?topic_id=182032)

Jim
Title: Re: DirectX9 - Font with outline ?
Post by: va!n 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 ^^