Sign in to follow this  
Quinnie

Using Custom Fonts Without Registering Them

Recommended Posts

For my 3D Engine I needed to render some text to the screen, I got this to work, quite simply actually using the D3DXCreateFont() and DrawText() functions. Great! Because I wanted to be a bit more original I would like to use my own TTF fonts, but before I could use them I would need to register them with Windows. Is there a way to Create a font from a path/filename instead from a FaceName? Also I have another problem. I'm rendering 3 Layers... A Background image, A cursor and the Text... How would I get the rendered text to appear infront of the background image but behind the cursor? The Images are rendered using a textured quad. Thanks in advanced for anything that could help me out...

Share this post


Link to post
Share on other sites
Quote:
Original post by Quinnie
For my 3D Engine I needed to render some text to the screen, I got this to work, quite simply actually using the D3DXCreateFont() and DrawText() functions. Great! Because I wanted to be a bit more original I would like to use my own TTF fonts, but before I could use them I would need to register them with Windows.

Did you try putting the fonts in the same directory as the executable? I thought that you didn't need to register the font if you did that, since it searches the residing directory for fonts first.

Share this post


Link to post
Share on other sites
Thanks! The AddFontResourceEx helpt me out!

The only thing I'm wondering about now is how I could draw something over a Text, since somehow all texts are in the front and all other graphics are in the back :S

Share this post


Link to post
Share on other sites
The last past hours I searched the entire SDK and Internet but I couldn't find anything about rendering Textured Quads infront of Texts. Though I've seen it happening in a lot of games. Somehow it must be possible to show my cursor infront of text rendered using the DirectX DrawText function, right?

Thanks in advance.

Share this post


Link to post
Share on other sites
Quote:
Original post by Quinnie
The last past hours I searched the entire SDK and Internet but I couldn't find anything about rendering Textured Quads infront of Texts. Though I've seen it happening in a lot of games. Somehow it must be possible to show my cursor infront of text rendered using the DirectX DrawText function, right?

Did you try making the z-value of your cursor vector close to 0? I remember that I had the same problem once, but I solved it by playing around with small Z-values until it worked out.

Share this post


Link to post
Share on other sites
Seems not to be the most "clean" way to solve it, I'll first try using 3D Text that should hopefully solve my problem.

Share this post


Link to post
Share on other sites

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