Sign in to follow this  

Using fonts in direct3d 9 without using d3dx utilities

This topic is 4304 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

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

This topic is 4304 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this