Jump to content
  • Advertisement
Sign in to follow this  
mateo

Using fonts in direct3d 9 without using d3dx utilities

This topic is 4590 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Does any body have an example on how to use fonts in Direct3d 9, but without using the d3dx utilities interface?

Share this post


Link to post
Share on other sites
Advertisement
Heya -

I don't have a specific example for you, but you could use Freetype. I can generate a font texture atlas using Freetype in around 30ms. Then, by generating quads for each character with the texture coords mapped to the texture map with the font, you can draw text on your surface, or you could use Freetype to draw a string on a texture, or whatever you want to do. It's quite nice.

Share this post


Link to post
Share on other sites
If you just want 2d sprite fonts then it's (relatively) easy, make a bmp containing the font your want and then render quads as each character from that texture.

Google it and theres a fair bit about it,

Paul

Share this post


Link to post
Share on other sites
Quote:
Original post by Paul Richardson
If you just want 2d sprite fonts then it's (relatively) easy, make a bmp containing the font your want and then render quads as each character from that texture.

BitmapFontBuilder is pretty nice for doing stuff like this.

Here is a tutorial about it.

Share this post


Link to post
Share on other sites
Thanks Everyone, I'll most likely use texture fonts at a later time, but right now I just want to use "TextOut" to output text.

Circlesoft: Thanks for the program info!, This could be really useful later.

Share this post


Link to post
Share on other sites
Just for reference purposes, I suppose you could use IDirect3DSurface9::GetDC() to grab an HDC that you can pass on to the regular Win32 functions. It'd almost certainly be horrifically slow - but if you want to knock up a quick and simple prototype it might be an option...

But, as has been said by others - if you don't use the D3DX fonts/text then you're going to have to either roll your own or use a 3rd party library.

hth
Jack

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!